Use group_names to check a host belongs to group

Change-Id: I65f7b6265e7e35ea0cde4cdad0b7f6d32cab1871
This commit is contained in:
Cuong Nguyen 2017-11-28 09:11:25 +07:00 committed by Jesse Pretorius (odyssey4me)
parent ceb12b1088
commit 4f21a97aef
2 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@
state: "stopped"
daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
with_dict: "{{ designate_services }}"
when: inventory_hostname in groups[item.value.group]
when: "item.value.group in group_names"
register: _stop
until: _stop | success
retries: 5
@ -58,7 +58,7 @@
state: "started"
daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
with_dict: "{{ designate_services }}"
when: inventory_hostname in groups[item.value.group]
when: "item.value.group in group_names"
register: _start
until: _start | success
retries: 5

View File

@ -21,7 +21,7 @@
group: "{{ designate_system_group_name }}"
mode: "02755"
with_dict: "{{ designate_services }}"
when: inventory_hostname in groups[item.value.group]
when: "item.value.group in group_names"
- name: Create TEMP lock dir
file:
@ -31,7 +31,7 @@
group: "{{ designate_system_group_name }}"
mode: "02755"
with_dict: "{{ designate_services }}"
when: inventory_hostname in groups[item.value.group]
when: "item.value.group in group_names"
- name: Create tempfile.d entry
template:
@ -41,7 +41,7 @@
owner: "root"
group: "root"
with_dict: "{{ designate_services }}"
when: inventory_hostname in groups[item.value.group]
when: "item.value.group in group_names"
notify:
- Restart designate services
@ -55,6 +55,6 @@
config_overrides: "{{ item.value.init_config_overrides }}"
config_type: "ini"
with_dict: "{{ designate_services }}"
when: inventory_hostname in groups[item.value.group]
when: "item.value.group in group_names"
notify:
- Restart designate services