From 1c3c611f40654f0db41d9840e661b157a6664501 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Tue, 14 Feb 2017 11:19:26 +0800 Subject: [PATCH] Add the missing condition for config.yml - add "item.value.enabled | bool" - add "| bool" to keystone - add group check for searchlight Change-Id: Id4555a0a96ea1670e99c88a1da9d3e07bf253497 --- ansible/roles/elasticsearch/tasks/config.yml | 4 +++- ansible/roles/glance/tasks/config.yml | 4 +++- ansible/roles/gnocchi/tasks/config.yml | 4 +++- ansible/roles/heat/tasks/config.yml | 4 +++- ansible/roles/horizon/tasks/config.yml | 4 +++- ansible/roles/keystone/tasks/config.yml | 4 ++-- ansible/roles/magnum/tasks/config.yml | 4 +++- ansible/roles/rally/tasks/config.yml | 4 +++- ansible/roles/sahara/tasks/config.yml | 4 +++- ansible/roles/searchlight/tasks/config.yml | 3 +++ ansible/roles/senlin/tasks/config.yml | 4 +++- ansible/roles/watcher/tasks/config.yml | 4 +++- 12 files changed, 35 insertions(+), 12 deletions(-) diff --git a/ansible/roles/elasticsearch/tasks/config.yml b/ansible/roles/elasticsearch/tasks/config.yml index 8dc59b4632..47182787f5 100644 --- a/ansible/roles/elasticsearch/tasks/config.yml +++ b/ansible/roles/elasticsearch/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ elasticsearch_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index 8f8c2a0857..719f92392a 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ glance_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/gnocchi/tasks/config.yml b/ansible/roles/gnocchi/tasks/config.yml index c60f8a7818..76cdb04d49 100644 --- a/ansible/roles/gnocchi/tasks/config.yml +++ b/ansible/roles/gnocchi/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ gnocchi_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/heat/tasks/config.yml b/ansible/roles/heat/tasks/config.yml index 6c22d47f5f..0f8340ca97 100644 --- a/ansible/roles/heat/tasks/config.yml +++ b/ansible/roles/heat/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ heat_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml index e5f7f1cabc..ac8cd272de 100644 --- a/ansible/roles/horizon/tasks/config.yml +++ b/ansible/roles/horizon/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ horizon_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml index 0066941bf5..821b2d0691 100644 --- a/ansible/roles/keystone/tasks/config.yml +++ b/ansible/roles/keystone/tasks/config.yml @@ -14,7 +14,7 @@ recurse: yes when: - inventory_hostname in groups[item.value.group] - - item.value.enabled + - item.value.enabled | bool with_dict: "{{ keystone_services }}" - name: Copying over config.json files for services @@ -25,7 +25,7 @@ with_dict: "{{ keystone_services }}" when: - inventory_hostname in groups[item.value.group] - - item.value.enabled + - item.value.enabled | bool notify: - Restart keystone container - Restart keystone-ssh container diff --git a/ansible/roles/magnum/tasks/config.yml b/ansible/roles/magnum/tasks/config.yml index 514740fbc4..9b4e71f880 100644 --- a/ansible/roles/magnum/tasks/config.yml +++ b/ansible/roles/magnum/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ magnum_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/rally/tasks/config.yml b/ansible/roles/rally/tasks/config.yml index 48a4012a4e..be8d8ffbf5 100644 --- a/ansible/roles/rally/tasks/config.yml +++ b/ansible/roles/rally/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ rally_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/sahara/tasks/config.yml b/ansible/roles/sahara/tasks/config.yml index 5634ab3246..7eba441e8f 100644 --- a/ansible/roles/sahara/tasks/config.yml +++ b/ansible/roles/sahara/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ sahara_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/searchlight/tasks/config.yml b/ansible/roles/searchlight/tasks/config.yml index 3e95292a25..a3868da315 100644 --- a/ansible/roles/searchlight/tasks/config.yml +++ b/ansible/roles/searchlight/tasks/config.yml @@ -4,6 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ searchlight_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml index 8b36946c5a..4bb2878ca5 100644 --- a/ansible/roles/senlin/tasks/config.yml +++ b/ansible/roles/senlin/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ senlin_services }}" - name: Copying over config.json files for services diff --git a/ansible/roles/watcher/tasks/config.yml b/ansible/roles/watcher/tasks/config.yml index b7a3fe4fa5..f86b7acb6d 100644 --- a/ansible/roles/watcher/tasks/config.yml +++ b/ansible/roles/watcher/tasks/config.yml @@ -4,7 +4,9 @@ path: "{{ node_config_directory }}/{{ item.key }}" state: "directory" recurse: yes - when: inventory_hostname in groups[item.value.group] + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ watcher_services }}" - name: Copying over config.json files for services