From bb475911d30201bf6cfa8661876bcb71cd99a1fe Mon Sep 17 00:00:00 2001 From: Borne Mace Date: Mon, 23 Jan 2017 19:13:11 -0800 Subject: [PATCH] Fixed config generation to check correct actions A config generation check was added to a few services but the action name checked was "genconfig" where the kolla-ansible genconfig command actually uses the action name "config". Stop run the handlers when action is "config". Co-Authored-By: Jeffrey Zhang Partially-implements: blueprint better-reconfigure Change-Id: I9d3be2f674087f340108b176c8e8e2209ffa8806 --- ansible/roles/glance/handlers/main.yml | 2 ++ ansible/roles/glance/tasks/config.yml | 2 +- ansible/roles/heat/handlers/main.yml | 3 +++ ansible/roles/heat/tasks/config.yml | 1 + ansible/roles/keystone/handlers/main.yml | 3 +++ ansible/roles/keystone/tasks/config.yml | 2 +- ansible/roles/memcached/handlers/main.yml | 1 + ansible/roles/memcached/tasks/config.yml | 2 +- ansible/roles/searchlight/handlers/main.yml | 2 ++ ansible/roles/searchlight/tasks/config.yml | 2 +- ansible/roles/senlin/handlers/main.yml | 2 ++ ansible/roles/senlin/tasks/config.yml | 2 +- 12 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ansible/roles/glance/handlers/main.yml b/ansible/roles/glance/handlers/main.yml index d2ec351ae1..c914190cb6 100644 --- a/ansible/roles/glance/handlers/main.yml +++ b/ansible/roles/glance/handlers/main.yml @@ -14,6 +14,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -37,6 +38,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index 49e56e8008..8f8c2a0857 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -68,9 +68,9 @@ volumes: "{{ item.value.volumes }}" register: check_glance_containers when: + - action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool - - action != "genconfig" with_dict: "{{ glance_services }}" notify: - Restart glance-api container diff --git a/ansible/roles/heat/handlers/main.yml b/ansible/roles/heat/handlers/main.yml index 94f0b4aa29..c85ff2b477 100644 --- a/ansible/roles/heat/handlers/main.yml +++ b/ansible/roles/heat/handlers/main.yml @@ -14,6 +14,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -36,6 +37,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -58,6 +60,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool diff --git a/ansible/roles/heat/tasks/config.yml b/ansible/roles/heat/tasks/config.yml index 232f04a8e5..6c22d47f5f 100644 --- a/ansible/roles/heat/tasks/config.yml +++ b/ansible/roles/heat/tasks/config.yml @@ -78,6 +78,7 @@ volumes: "{{ item.value.volumes }}" register: check_heat_containers when: + - action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ heat_services }}" diff --git a/ansible/roles/keystone/handlers/main.yml b/ansible/roles/keystone/handlers/main.yml index 59b9168548..49889e2b91 100644 --- a/ansible/roles/keystone/handlers/main.yml +++ b/ansible/roles/keystone/handlers/main.yml @@ -14,6 +14,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -39,6 +40,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -60,6 +62,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml index c818d6fe61..3efc8844c1 100644 --- a/ansible/roles/keystone/tasks/config.yml +++ b/ansible/roles/keystone/tasks/config.yml @@ -179,7 +179,7 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" when: - - action != 'genconfig' + - action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool register: check_keystone_containers diff --git a/ansible/roles/memcached/handlers/main.yml b/ansible/roles/memcached/handlers/main.yml index 1054d721bc..093975864c 100644 --- a/ansible/roles/memcached/handlers/main.yml +++ b/ansible/roles/memcached/handlers/main.yml @@ -8,6 +8,7 @@ name: "{{ service.container_name }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - memcached_config_json.changed | bool diff --git a/ansible/roles/memcached/tasks/config.yml b/ansible/roles/memcached/tasks/config.yml index 6b008168c8..63438c6e8a 100644 --- a/ansible/roles/memcached/tasks/config.yml +++ b/ansible/roles/memcached/tasks/config.yml @@ -29,5 +29,5 @@ when: - inventory_hostname in groups[service.group] - service.enabled | bool - - action != "genconfig" + - action != "config" notify: Restart memcached container diff --git a/ansible/roles/searchlight/handlers/main.yml b/ansible/roles/searchlight/handlers/main.yml index e37ec9acfa..715217dee2 100644 --- a/ansible/roles/searchlight/handlers/main.yml +++ b/ansible/roles/searchlight/handlers/main.yml @@ -14,6 +14,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -36,6 +37,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool diff --git a/ansible/roles/searchlight/tasks/config.yml b/ansible/roles/searchlight/tasks/config.yml index d1f960158b..3e95292a25 100644 --- a/ansible/roles/searchlight/tasks/config.yml +++ b/ansible/roles/searchlight/tasks/config.yml @@ -63,7 +63,7 @@ volumes: "{{ item.value.volumes }}" register: check_searchlight_containers when: - - action != 'genconfig' + - action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ searchlight_services }}" diff --git a/ansible/roles/senlin/handlers/main.yml b/ansible/roles/senlin/handlers/main.yml index 9e85395801..df0ac9c42c 100644 --- a/ansible/roles/senlin/handlers/main.yml +++ b/ansible/roles/senlin/handlers/main.yml @@ -14,6 +14,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool @@ -36,6 +37,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" when: + - action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml index 50b50419b1..8b36946c5a 100644 --- a/ansible/roles/senlin/tasks/config.yml +++ b/ansible/roles/senlin/tasks/config.yml @@ -69,7 +69,7 @@ volumes: "{{ item.value.volumes }}" register: check_senlin_containers when: - - action != 'genconfig' + - action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ senlin_services }}"