Revert "Use group_names to check a host belongs to group"

This reverts commit def3818792.

Those changes are causing troubles when running Zuul functional tests.

Change-Id: I13627b11c2a85b7a7dfc6c9950a36d08b162b9f5
This commit is contained in:
Kaio Kassiano Moura Oliveira 2017-12-22 12:49:09 +00:00
parent def3818792
commit 800324d599
5 changed files with 19 additions and 19 deletions

View File

@ -42,4 +42,4 @@
state: "restarted"
daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
with_dict: "{{ monasca_services }}"
when: "item.value.group in group_names"
when: inventory_hostname in groups[item.value.group]

View File

@ -44,14 +44,14 @@ dependencies:
- ansible_pkg_mgr == 'apt'
- role: ansible-zookeeper
when:
- "monasca_services['monasca-zookeeper']['group'] in group_names"
- inventory_hostname in groups['monasca_zookeeper']
tags:
- zookeeper
- skip_ansible_lint
- role: ansible-kafka
kafka_listen_address: "{{ ansible_host }}"
when:
- "monasca_services['monasca-kafka']['group'] in group_names"
- inventory_hostname in groups['monasca_kafka']
tags:
- kafka
- skip_ansible_lint
@ -60,13 +60,13 @@ dependencies:
storm_supervisor_enabled: True
nimbus_host: "{{ ansible_ssh_host }}"
when:
- "monasca_services['monasca-api']['group'] in group_names"
- inventory_hostname in groups['monasca_api']
tags:
- storm
- skip_ansible_lint
- role: ansible-influxdb
when:
- "monasca_services['monasca-influxdb']['group'] in group_names"
- inventory_hostname in groups['monasca_influxdb']
tags:
- influxdb
- skip_ansible_lint
@ -77,7 +77,7 @@ dependencies:
grafana_mysql_password: "{{ grafana_galera_password }}"
grafana_keystone_url: "{{ keystone_service_internaluri }}"
when:
- "monasca_services['monasca-grafana']['group'] in group_names"
- inventory_hostname in groups['monasca_grafana']
tags:
- grafana
- skip_ansible_lint

View File

@ -29,27 +29,27 @@
- always
- include: monasca_pre_install.yml
when: "monasca_services['monasca-api']['group'] in group_names"
when: inventory_hostname in groups['monasca_api']
tags:
- monasca-install
- include: monasca_install.yml
when: "monasca_services['monasca-api']['group'] in group_names"
when: inventory_hostname in groups['monasca_api']
tags:
- monasca-install
- include: monasca_thresh_install.yml
when: "monasca_services['monasca-api']['group'] in group_names"
when: inventory_hostname in groups['monasca_api']
tags:
- monasca-install
- include: monasca_post_install.yml
when: "monasca_services['monasca-api']['group'] in group_names"
when: inventory_hostname in groups['monasca_api']
tags:
- monasca-config
- include: monasca_init_{{ ansible_service_mgr }}.yml
when: "monasca_services['monasca-api']['group'] in group_names"
when: inventory_hostname in groups['monasca_api']
tags:
- monasca-config

View File

@ -12,10 +12,10 @@
# limitations under the License.
- include: monasca_influxdb_setup.yml
when: "monasca_services['monasca-influxdb']['group'] in group_names"
when: inventory_hostname in groups['monasca_influxdb']
- include: monasca_mysql_setup.yml
when: "monasca_services['monasca-api']['group'] in group_names"
when: inventory_hostname in groups['monasca_api']
- include: monasca_kafka_setup.yml
when: "monasca_services['monasca-kafka']['group'] in group_names"
when: inventory_hostname in groups['monasca_kafka']

View File

@ -21,7 +21,7 @@
group: "{{ monasca_system_group_name }}"
mode: "02755"
with_dict: "{{ monasca_services }}"
when: "item.value.group in group_names"
when: inventory_hostname in groups[item.value.group]
- name: Create TEMP lock dir
file:
@ -31,7 +31,7 @@
group: "{{ monasca_system_group_name }}"
mode: "02755"
with_dict: "{{ monasca_services }}"
when: "item.value.group in group_names"
when: inventory_hostname in groups[item.value.group]
# TODO:
# Remove this in Pike as it only needed to handle upgrades
@ -41,7 +41,7 @@
path: "/etc/tmpfiles.d/{{ item.value.service_name }}.conf"
state: absent
with_dict: "{{ monasca_services }}"
when: "item.value.group in group_names"
when: inventory_hostname in groups[item.value.group]
- name: Create tmpfiles.d entry
template:
@ -51,7 +51,7 @@
owner: "root"
group: "root"
with_dict: "{{ monasca_services }}"
when: "item.value.group in group_names"
when: inventory_hostname in groups[item.value.group]
notify:
- Restart monasca services
@ -65,6 +65,6 @@
config_overrides: "{{ item.value.init_config_overrides }}"
config_type: "ini"
with_dict: "{{ monasca_services }}"
when: "item.value.group in group_names"
when: inventory_hostname in groups[item.value.group]
notify:
- Restart monasca services