Check host is within group

A fix on my patch: https://review.opendev.org/#/c/694055/
If the current host is not in the ceilometer-agent-notification group
then the intersection of the current hosts group_names will produce an
empty list. This should be checked before evaluating the next conditional.

Change-Id: Ib3a84516e0f00e84c6869fa58e9595062c6fbede
This commit is contained in:
Georgina Shippey 2019-12-19 11:34:52 +00:00
parent 9893bd696b
commit fe9208c08a
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@
password: "{{ ceilometer_service_password }}"
role: "{{ ceilometer_role_name }}"
when:
- (groups[(ceilometer_services['ceilometer-agent-notification']['group'] | intersect(group_names))[0]] | intersect(ansible_play_hosts))[0] | length > 0
- ceilometer_services['ceilometer-agent-notification']['group'] | intersect(group_names) | length > 0
- inventory_hostname == (groups[(ceilometer_services['ceilometer-agent-notification']['group'] | intersect(group_names))[0]] | intersect(ansible_play_hosts))[0]
tags:
- ceilometer-config