diff --git a/ansible/roles/aodh/handlers/main.yml b/ansible/roles/aodh/handlers/main.yml index ad1905119e..c18cace4a9 100644 --- a/ansible/roles/aodh/handlers/main.yml +++ b/ansible/roles/aodh/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "aodh-api" service: "{{ aodh_services[service_name] }}" - config_json: "{{ aodh_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_conf: "{{ aodh_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ aodh_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_api_container: "{{ check_aodh_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or aodh_conf.changed | bool - or policy_overwriting.changed | bool - or aodh_conf_wsgi.changed | bool - or aodh_api_container.changed | bool - name: Restart aodh-evaluator container vars: service_name: "aodh-evaluator" service: "{{ aodh_services[service_name] }}" - config_json: "{{ aodh_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_conf: "{{ aodh_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ aodh_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_evaluator_container: "{{ check_aodh_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or aodh_conf.changed | bool - or policy_overwriting.changed | bool - or aodh_evaluator_container.changed | bool - name: Restart aodh-listener container vars: service_name: "aodh-listener" service: "{{ aodh_services[service_name] }}" - config_json: "{{ aodh_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_conf: "{{ aodh_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ aodh_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_listener_container: "{{ check_aodh_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -68,21 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or aodh_conf.changed | bool - or policy_overwriting.changed | bool - or aodh_listener_container.changed | bool - name: Restart aodh-notifier container vars: service_name: "aodh-notifier" service: "{{ aodh_services[service_name] }}" - config_json: "{{ aodh_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_conf: "{{ aodh_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ aodh_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - aodh_notifier_container: "{{ check_aodh_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -93,9 +58,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or aodh_conf.changed | bool - or policy_overwriting.changed | bool - or aodh_notifier_container.changed | bool diff --git a/ansible/roles/aodh/tasks/config.yml b/ansible/roles/aodh/tasks/config.yml index 22e2c0c7c7..a5e8279709 100644 --- a/ansible/roles/aodh/tasks/config.yml +++ b/ansible/roles/aodh/tasks/config.yml @@ -35,17 +35,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ aodh_policy_file }}" mode: "0660" become: true - register: aodh_policy_overwriting when: - aodh_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ aodh_services }}" notify: - - Restart aodh-api container - - Restart aodh-evaluator container - - Restart aodh-listener container - - Restart aodh-notifier container + - "Restart {{ item.key }} container" - name: Copying over config.json files for services template: @@ -53,16 +49,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: aodh_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ aodh_services }}" notify: - - Restart aodh-api container - - Restart aodh-evaluator container - - Restart aodh-listener container - - Restart aodh-notifier container + - "Restart {{ item.key }} container" - name: Copying over aodh.conf vars: @@ -77,16 +69,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/aodh.conf" mode: "0660" become: true - register: aodh_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ aodh_services }}" notify: - - Restart aodh-api container - - Restart aodh-evaluator container - - Restart aodh-listener container - - Restart aodh-notifier container + - "Restart {{ item.key }} container" - name: Copying over wsgi-aodh files for services vars: @@ -96,12 +84,11 @@ dest: "{{ node_config_directory }}/aodh-api/wsgi-aodh.conf" mode: "0660" become: true - register: aodh_conf_wsgi when: - inventory_hostname in groups[service.group] - service.enabled | bool notify: - - Restart aodh-api container + - "Restart aodh-api container" - name: Check aodh containers become: true @@ -112,14 +99,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_aodh_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ aodh_services }}" notify: - - Restart aodh-api container - - Restart aodh-evaluator container - - Restart aodh-listener container - - Restart aodh-notifier container + - "Restart {{ item.key }} container" diff --git a/ansible/roles/barbican/handlers/main.yml b/ansible/roles/barbican/handlers/main.yml index ea164f9a9e..5b4e487667 100644 --- a/ansible/roles/barbican/handlers/main.yml +++ b/ansible/roles/barbican/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "barbican-api" service: "{{ barbican_services[service_name] }}" - config_json: "{{ barbican_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - barbican_conf: "{{ barbican_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ barbican_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - barbican_api_container: "{{ check_barbican_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,23 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or barbican_conf.changed | bool - or policy_overwriting.changed | bool - or barbican_api_ini.changed | bool - or barbican_api_paste.changed | bool - or barbican_api_container.changed | bool - name: Restart barbican-keystone-listener container vars: service_name: "barbican-keystone-listener" service: "{{ barbican_services[service_name] }}" - config_json: "{{ barbican_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - barbican_conf: "{{ barbican_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ barbican_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - barbican_keystone_listener_container: "{{ check_barbican_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -44,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or barbican_conf.changed | bool - or policy_overwriting.changed | bool - or barbican_keystone_listener_container.changed | bool - name: Restart barbican-worker container vars: service_name: "barbican-worker" service: "{{ barbican_services[service_name] }}" - config_json: "{{ barbican_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - barbican_conf: "{{ barbican_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ barbican_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - barbican_worker_container: "{{ check_barbican_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -69,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or barbican_conf.changed | bool - or policy_overwriting.changed | bool - or barbican_worker_container.changed | bool diff --git a/ansible/roles/barbican/tasks/config.yml b/ansible/roles/barbican/tasks/config.yml index 5c6b554705..b983e19e0b 100644 --- a/ansible/roles/barbican/tasks/config.yml +++ b/ansible/roles/barbican/tasks/config.yml @@ -1,5 +1,20 @@ --- - name: Ensuring config directories exist + file: + path: "{{ node_config_directory }}/{{ item.key }}" + state: "directory" + owner: "{{ config_owner_user }}" + group: "{{ config_owner_group }}" + mode: "0770" + become: true + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ barbican_services }}" + +- name: Ensuring vassals config directories exist + vars: + service: "{{ barbican_services['barbican-api'] }}" file: path: "{{ node_config_directory }}/{{ item }}" state: "directory" @@ -7,10 +22,11 @@ group: "{{ config_owner_group }}" mode: "0770" become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool with_items: - "barbican-api/vassals" - - "barbican-keystone-listener" - - "barbican-worker" - name: Check if policies shall be overwritten local_action: stat path="{{ item }}" @@ -35,7 +51,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: barbican_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -54,9 +69,8 @@ dest: "{{ node_config_directory }}/barbican-api/vassals/barbican-api.ini" mode: "0660" become: true - register: barbican_api_ini when: - - inventory_hostname in groups['barbican-api'] + - inventory_hostname in groups[service.group] - service.enabled | bool notify: - Restart barbican-api container @@ -68,6 +82,7 @@ run_once: True register: check_barbican_api_paste_ini when: + - inventory_hostname in groups[service.group] - service.enabled | bool - name: Copying over barbican-api-paste.ini @@ -79,10 +94,9 @@ mode: "0660" become: true when: - - inventory_hostname in groups['barbican-api'] + - inventory_hostname in groups[service.group] - service.enabled | bool - check_barbican_api_paste_ini.stat.exists - register: barbican_api_paste notify: - Restart barbican-api container @@ -99,7 +113,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/barbican.conf" mode: "0660" become: true - register: barbican_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -113,7 +126,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ barbican_policy_file }}" mode: "0660" become: true - register: barbican_policy_overwriting when: - barbican_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -131,7 +143,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_barbican_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/blazar/handlers/main.yml b/ansible/roles/blazar/handlers/main.yml index f410f249c3..c1559f8a55 100644 --- a/ansible/roles/blazar/handlers/main.yml +++ b/ansible/roles/blazar/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "blazar-api" service: "{{ blazar_services[service_name] }}" - config_json: "{{ blazar_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - blazar_conf: "{{ blazar_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ blazar_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - blazar_api_container: "{{ check_blazar_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or blazar_conf.changed | bool - or policy_overwriting | bool - or blazar_api_container.changed | bool - name: Restart blazar-manager container vars: service_name: "blazar-manager" service: "{{ blazar_services[service_name] }}" - config_json: "{{ blazar_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - blazar_conf: "{{ blazar_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ blazar_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - blazar_manager_container: "{{ check_blazar_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or blazar_conf.changed | bool - or policy_overwriting.changed | bool - or blazar_manager_container.changed | bool diff --git a/ansible/roles/blazar/tasks/config.yml b/ansible/roles/blazar/tasks/config.yml index f86c815dc1..f959c3250d 100644 --- a/ansible/roles/blazar/tasks/config.yml +++ b/ansible/roles/blazar/tasks/config.yml @@ -35,14 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: blazar_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ blazar_services }}" notify: - - Restart blazar-api container - - Restart blazar-manager container + - Restart {{ item.key }} container - name: Copying over blazar.conf vars: @@ -57,14 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/blazar.conf" mode: "0660" become: true - register: blazar_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ blazar_services }}" notify: - - Restart blazar-api container - - Restart blazar-manager container + - Restart {{ item.key }} container - name: Copying over existing policy file template: @@ -72,14 +68,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ blazar_policy_file }}" mode: "0660" become: true - register: blazar_policy_overwriting when: - blazar_policy_file is defined - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool with_dict: "{{ blazar_services }}" notify: - - Restart blazar-api container - - Restart blazar-manager container + - Restart {{ item.key }} container - name: Check blazar containers become: true @@ -90,12 +85,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_blazar_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ blazar_services }}" notify: - - Restart blazar-api container - - Restart blazar-manager container + - Restart {{ item.key }} container diff --git a/ansible/roles/ceilometer/handlers/main.yml b/ansible/roles/ceilometer/handlers/main.yml index 82f0327788..87a541148c 100644 --- a/ansible/roles/ceilometer/handlers/main.yml +++ b/ansible/roles/ceilometer/handlers/main.yml @@ -3,15 +3,6 @@ vars: service_name: "ceilometer-notification" service: "{{ ceilometer_services[service_name] }}" - config_json: "{{ ceilometer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_resources_overwriting: "{{ ceilometer_gnocchi_resources_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - pipeline_overwriting: "{{ ceilometer_pipeline_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_notification_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" - panko_conf: "{{ panko_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -22,34 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ceilometer_conf.changed | bool - or ceilometer_event_definitions_overwriting.changed | bool - or ceilometer_event_pipeline_overwriting.changed | bool - or gnocchi_resources_overwriting.changed | bool - or pipeline_overwriting.changed | bool - or policy_overwriting.changed | bool - or polling_overwriting.changed | bool - or ceilometer_event_definitions.changed | bool - or ceilometer_event_pipeline.changed | bool - or ceilometer_pipeline.changed | bool - or ceilometer_notification_container.changed | bool - or panko_conf.changed | bool - name: Restart ceilometer-central container vars: service_name: "ceilometer-central" service: "{{ ceilometer_services[service_name] }}" - config_json: "{{ ceilometer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_resources_overwriting: "{{ ceilometer_gnocchi_resources_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - pipeline_overwriting: "{{ ceilometer_pipeline_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_central_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -60,29 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ceilometer_conf.changed | bool - or ceilometer_pipeline.changed | bool - or gnocchi_resources_overwriting.changed | bool - or pipeline_overwriting.changed | bool - or policy_overwriting.changed | bool - or polling_overwriting.changed | bool - or ceilometer_central_container.changed | bool - name: Restart ceilometer-compute container vars: service_name: "ceilometer-compute" service: "{{ ceilometer_services[service_name] }}" - config_json: "{{ ceilometer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_resources_overwriting: "{{ ceilometer_gnocchi_resources_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - pipeline_overwriting: "{{ ceilometer_pipeline_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_compute_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -94,29 +44,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ceilometer_conf.changed | bool - or ceilometer_pipeline.changed | bool - or gnocchi_resources_overwriting.changed | bool - or pipeline_overwriting.changed | bool - or policy_overwriting.changed | bool - or polling_overwriting.changed | bool - or vcenter_ca_file.changed | bool - or ceilometer_compute_container.changed | bool - name: Restart ceilometer-ipmi container vars: service_name: "ceilometer-ipmi" service: "{{ ceilometer_services[service_name] }}" - config_json: "{{ ceilometer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_resources_overwriting: "{{ ceilometer_gnocchi_resources_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceilometer_ipmi_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -127,12 +59,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ceilometer_conf.changed | bool - or ceilometer_pipeline.changed | bool - or gnocchi_resources_overwriting.changed | bool - or policy_overwriting.changed | bool - or polling_overwriting.changed | bool - or ceilometer_ipmi_container.changed | bool diff --git a/ansible/roles/ceilometer/tasks/config.yml b/ansible/roles/ceilometer/tasks/config.yml index 34d32a9e1e..ec2a0c60af 100644 --- a/ansible/roles/ceilometer/tasks/config.yml +++ b/ansible/roles/ceilometer/tasks/config.yml @@ -69,7 +69,6 @@ force: True mode: "0660" become: true - register: ceilometer_polling_overwriting when: - ceilometer_polling_file.stat.exists - inventory_hostname in groups[item.value.group] @@ -95,7 +94,6 @@ force: True mode: "0660" become: true - register: ceilometer_gnocchi_resources_overwriting when: - ceilometer_gnocchi_resources_file.stat.exists - inventory_hostname in groups[item.value.group] @@ -133,16 +131,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: ceilometer_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ ceilometer_services }}" notify: - - Restart ceilometer-notification container - - Restart ceilometer-central container - - Restart ceilometer-compute container - - Restart ceilometer-ipmi container + - "Restart {{ item.key }} container" - name: Copying over ceilometer.conf vars: @@ -157,16 +151,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/ceilometer.conf" mode: "0660" become: true - register: ceilometer_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ ceilometer_services }}" notify: - - Restart ceilometer-notification container - - Restart ceilometer-central container - - Restart ceilometer-compute container - - Restart ceilometer-ipmi container + - "Restart {{ item.key }} container" - name: Check custom event_definitions.yaml exists local_action: stat path="{{ node_custom_config }}/ceilometer/event_definitions.yaml" @@ -234,7 +224,6 @@ dest: "{{ node_config_directory }}/ceilometer-notification/event_pipeline.yaml" mode: "0660" become: true - register: ceilometer_event_pipeline when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -279,7 +268,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/pipeline.yaml" mode: "0660" become: true - register: ceilometer_pipelines when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -303,7 +291,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/panko.conf" mode: "0660" become: true - register: panko_confs when: - enable_panko | bool - item.value.enabled | bool @@ -320,7 +307,6 @@ src: "{{ node_custom_config }}/vmware_ca" dest: "{{ node_config_directory }}/ceilometer-compute/vmware_ca" mode: "0660" - register: vcenter_ca_file when: - nova_compute_virt_type == "vmware" - not vmware_vcenter_insecure | bool @@ -335,17 +321,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ ceilometer_policy_file }}" mode: "0660" become: true - register: ceilometer_policy_overwriting when: - ceilometer_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ ceilometer_services }}" notify: - - Restart ceilometer-notification container - - Restart ceilometer-central container - - Restart ceilometer-compute container - - Restart ceilometer-ipmi container + - "Restart {{ item.key }} container" # check whether the containers parameter is changed. If yes, trigger the handler. - name: Check ceilometer containers @@ -358,14 +340,10 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes | reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_ceilometer_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ ceilometer_services }}" notify: - - Restart ceilometer-notification container - - Restart ceilometer-central container - - Restart ceilometer-compute container - - Restart ceilometer-ipmi container + - "Restart {{ item.key }} container" diff --git a/ansible/roles/chrony/handlers/main.yml b/ansible/roles/chrony/handlers/main.yml index 67b224cc36..3c800c7d28 100644 --- a/ansible/roles/chrony/handlers/main.yml +++ b/ansible/roles/chrony/handlers/main.yml @@ -14,5 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool diff --git a/ansible/roles/chrony/tasks/config.yml b/ansible/roles/chrony/tasks/config.yml index 002de5bcb0..0d3690fad8 100644 --- a/ansible/roles/chrony/tasks/config.yml +++ b/ansible/roles/chrony/tasks/config.yml @@ -1,5 +1,8 @@ --- - name: Ensuring config directories exist + vars: + service_name: "chrony" + service: "{{ chrony_services[service_name] }}" file: path: "{{ node_config_directory }}/{{ item }}" state: "directory" @@ -7,26 +10,41 @@ group: "{{ config_owner_group }}" mode: "0770" become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool with_items: - "chrony" - name: Copying over config.json files for services + vars: + service_name: "chrony" + service: "{{ chrony_services[service_name] }}" template: src: "{{ item }}.json.j2" dest: "{{ node_config_directory }}/{{ item }}/config.json" mode: "0660" become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool with_items: - "chrony" notify: - Restart chrony container - name: Copying over chrony.conf + vars: + service_name: "chrony" + service: "{{ chrony_services[service_name] }}" template: src: "{{ item }}" dest: "{{ node_config_directory }}/chrony/chrony.conf" mode: "0660" become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool with_first_found: - "{{ node_custom_config }}/chrony/{{ inventory_hostname }}/chrony.conf" - "{{ node_custom_config }}/chrony/chrony.conf" @@ -50,4 +68,4 @@ - item.value.enabled | bool with_dict: "{{ chrony_services }}" notify: - - Restart chrony container + - "Restart {{ item.key }} container" diff --git a/ansible/roles/cinder/handlers/main.yml b/ansible/roles/cinder/handlers/main.yml index 08122965a4..47a470f7fc 100644 --- a/ansible/roles/cinder/handlers/main.yml +++ b/ansible/roles/cinder/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "cinder-api" service: "{{ cinder_services[service_name] }}" - config_json: "{{ cinder_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_api_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cinder_conf.changed | bool - or wsgi_cinder_api.changed | bool - or policy_overwriting.changed | bool - or cinder_api_container.changed | bool - name: Restart cinder-scheduler container vars: service_name: "cinder-scheduler" service: "{{ cinder_services[service_name] }}" - config_json: "{{ cinder_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_scheduler_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,22 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cinder_conf.changed | bool - or policy_overwriting.changed | bool - or cinder_scheduler_container.changed | bool - name: Restart cinder-volume container vars: service_name: "cinder-volume" service: "{{ cinder_services[service_name] }}" - config_json: "{{ cinder_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceph_conf: "{{ ceph_confs.results|selectattr('item.key', 'equalto', service_name)|first if ceph_confs is defined else none }}" - policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_volume_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -71,24 +45,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cinder_conf.changed | bool - or policy_overwriting.changed | bool - or cinder_volume_container.changed | bool - or ( ceph_conf is not none and ceph_conf.changed | bool ) - or ( cinder_volume_ceph_keyring is defined and cinder_volume_ceph_keyring.changed | bool ) - name: Restart cinder-backup container vars: service_name: "cinder-backup" service: "{{ cinder_services[service_name] }}" - config_json: "{{ cinder_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceph_conf: "{{ ceph_confs.results|selectattr('item.key', 'equalto', service_name)|first if ceph_confs is defined else none }}" - policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cinder_backup_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -100,11 +61,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cinder_conf.changed | bool - or policy_overwriting.changed | bool - or cinder_backup_container.changed | bool - or ( ceph_conf is not none and ceph_conf.changed | bool ) - or ( cinder_backup_ceph_keyring is defined and cinder_backup_ceph_keyring.changed | bool ) diff --git a/ansible/roles/cinder/tasks/ceph.yml b/ansible/roles/cinder/tasks/ceph.yml index dae58d1d1b..5e318db480 100644 --- a/ansible/roles/cinder/tasks/ceph.yml +++ b/ansible/roles/cinder/tasks/ceph.yml @@ -12,7 +12,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf" mode: "0660" become: true - register: ceph_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -72,3 +71,5 @@ when: - inventory_hostname in groups[item.service_name] - cinder_services[item.service_name].enabled | bool + notify: + - "Restart {{ item.service_name }} container" diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index 9b87c1c0ae..a094d6b7f7 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -50,16 +50,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: cinder_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cinder_services }}" notify: - - Restart cinder-api container - - Restart cinder-scheduler container - - Restart cinder-volume container - - Restart cinder-backup container + - "Restart {{ item.key }} container" - name: Copying over cinder-wsgi.conf vars: @@ -73,7 +69,6 @@ - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder-wsgi.conf" - "{{ node_custom_config }}/cinder/cinder-wsgi.conf" - "cinder-wsgi.conf.j2" - register: wsgi_cinder_api when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -93,16 +88,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/cinder.conf" mode: "0660" become: true - register: cinder_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ cinder_services }}" notify: - - Restart cinder-api container - - Restart cinder-scheduler container - - Restart cinder-volume container - - Restart cinder-backup container + - "Restart {{ item.key }} container" - name: Copying over existing policy file become: true @@ -110,17 +101,13 @@ src: "{{ cinder_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ cinder_policy_file }}" mode: "0660" - register: cinder_policy_overwriting when: - item.value.enabled | bool - cinder_policy_file is defined - inventory_hostname in groups[item.value.group] with_dict: "{{ cinder_services }}" notify: - - Restart cinder-api container - - Restart cinder-scheduler container - - Restart cinder-volume container - - Restart cinder-backup container + - "Restart {{ item.key }} container" - name: Copying over nfs_shares files for cinder_volume become: true @@ -140,6 +127,8 @@ - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares" skip: "{{ not enable_cinder_backend_nfs | bool and not enable_cinder_backend_hnas_nfs | bool }}" when: inventory_hostname in groups['cinder-volume'] + notify: + - Restart cinder-volume container - name: Check cinder containers become: true @@ -152,14 +141,10 @@ dimensions: "{{ item.value.dimensions }}" privileged: "{{ item.value.privileged | default(False) }}" ipc_mode: "{{ item.value.ipc_mode | default('') }}" - register: check_cinder_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cinder_services }}" notify: - - Restart cinder-api container - - Restart cinder-scheduler container - - Restart cinder-volume container - - Restart cinder-backup container + - "Restart {{ item.key }} container" diff --git a/ansible/roles/cinder/tasks/external_ceph.yml b/ansible/roles/cinder/tasks/external_ceph.yml index f60614974e..48663935ce 100644 --- a/ansible/roles/cinder/tasks/external_ceph.yml +++ b/ansible/roles/cinder/tasks/external_ceph.yml @@ -11,7 +11,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf" mode: "0660" become: true - register: ceph_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -26,7 +25,6 @@ dest: "{{ node_config_directory }}/cinder-volume/" mode: "0660" become: true - register: cinder_volume_ceph_keyring with_fileglob: - "{{ node_custom_config }}/cinder/cinder-volume/ceph.client*" when: diff --git a/ansible/roles/cloudkitty/handlers/main.yml b/ansible/roles/cloudkitty/handlers/main.yml index d8b76fe32e..a49a0319ee 100644 --- a/ansible/roles/cloudkitty/handlers/main.yml +++ b/ansible/roles/cloudkitty/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "cloudkitty-api" service: "{{ cloudkitty_services[service_name] }}" - config_json: "{{ cloudkitty_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cloudkitty_conf: "{{ cloudkitty_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cloudkitty_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cloudkitty_api_container: "{{ check_cloudkitty_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cloudkitty_conf.changed | bool - or cloudkitty_conf_wsgi.changed | bool - or policy_overwriting.changed | bool - or cloudkitty_api_container.changed | bool - name: Restart cloudkitty-processor container vars: service_name: "cloudkitty-processor" service: "{{ cloudkitty_services[service_name] }}" - config_json: "{{ cloudkitty_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cloudkitty_conf: "{{ cloudkitty_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cloudkitty_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cloudkitty_processor_container: "{{ check_cloudkitty_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cloudkitty_conf.changed | bool - or policy_overwriting.changed | bool - or cloudkitty_processor_container.changed | bool diff --git a/ansible/roles/cloudkitty/tasks/config.yml b/ansible/roles/cloudkitty/tasks/config.yml index 7758f06352..709b134426 100644 --- a/ansible/roles/cloudkitty/tasks/config.yml +++ b/ansible/roles/cloudkitty/tasks/config.yml @@ -57,14 +57,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: cloudkitty_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ cloudkitty_services }}" notify: - - Restart cloudkitty-api container - - Restart cloudkitty-processor container + - Restart {{ item.key }} container - name: Copying over cloudkitty.conf vars: @@ -79,14 +77,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/cloudkitty.conf" mode: "0660" become: true - register: cloudkitty_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cloudkitty_services }}" notify: - - Restart cloudkitty-api container - - Restart cloudkitty-processor container + - Restart {{ item.key }} container - name: Copying over wsgi-cloudkitty.conf vars: @@ -96,7 +92,6 @@ dest: "{{ node_config_directory }}/cloudkitty-api/wsgi-cloudkitty.conf" mode: "0660" become: true - register: cloudkitty_conf_wsgi when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -109,15 +104,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ cloudkitty_policy_file }}" mode: "0660" become: true - register: cloudkitty_policy_overwriting when: - cloudkitty_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cloudkitty_services }}" notify: - - Restart cloudkitty-api container - - Restart cloudkitty-processor container + - Restart {{ item.key }} container - name: Check cloudkitty containers become: true @@ -128,12 +121,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_cloudkitty_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cloudkitty_services }}" notify: - - Restart cloudkitty-api container - - Restart cloudkitty-processor container + - Restart {{ item.key }} container diff --git a/ansible/roles/collectd/handlers/main.yml b/ansible/roles/collectd/handlers/main.yml index 806482e4b5..b80f41c1bb 100644 --- a/ansible/roles/collectd/handlers/main.yml +++ b/ansible/roles/collectd/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "collectd" service: "{{ collectd_services[service_name] }}" - config_json: "{{ collectd_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - collectd_container: "{{ check_collectd_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,8 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or collectd_conf.changed | bool - or collectd_container.changed | bool diff --git a/ansible/roles/collectd/tasks/config.yml b/ansible/roles/collectd/tasks/config.yml index 3577d535f3..d15ab2eca3 100644 --- a/ansible/roles/collectd/tasks/config.yml +++ b/ansible/roles/collectd/tasks/config.yml @@ -31,7 +31,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: collectd_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -52,7 +51,6 @@ - "{{ node_custom_config }}/collectd/collectd.conf" - "{{ node_custom_config }}/collectd.conf" - "collectd.conf.j2" - register: collectd_conf when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -69,7 +67,6 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_collectd_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/common/handlers/main.yml b/ansible/roles/common/handlers/main.yml index 8bf5267647..0cffc22713 100644 --- a/ansible/roles/common/handlers/main.yml +++ b/ansible/roles/common/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "fluentd" service: "{{ common_services[service_name] }}" - config_json: "{{ common_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - fluentd_container: "{{ check_common_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,25 +14,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - config_json.changed | bool - or fluentd_input.changed | bool - or fluentd_input_custom.changed | bool - or fluentd_output.changed | bool - or fluentd_output_custom.changed | bool - or fluentd_format.changed | bool - or fluentd_format_custom.changed | bool - or fluentd_filter.changed | bool - or fluentd_filter_custom.changed | bool - or fluentd_td_agent.changed | bool - or fluentd_container.changed | bool - name: Restart kolla-toolbox container vars: service_name: "kolla-toolbox" service: "{{ common_services[service_name] }}" - config_json: "{{ common_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - kolla_toolbox_container: "{{ check_common_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -47,9 +31,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - config_json.changed | bool - or kolla_toolbox_container.changed | bool notify: - Initializing toolbox container using normal user @@ -62,8 +43,6 @@ vars: service_name: "cron" service: "{{ common_services[service_name] }}" - config_json: "{{ common_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cron_container: "{{ check_common_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -75,7 +54,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - config_json.changed | bool - or cron_confs.changed | bool - or cron_container.changed | bool diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index a62da29328..94f2068993 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -32,7 +32,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: common_config_jsons when: item.value.enabled | bool with_dict: "{{ common_services }}" notify: @@ -44,7 +43,6 @@ dest: "{{ node_config_directory }}/fluentd/input/{{ item }}.conf" mode: "0660" become: true - register: fluentd_input when: enable_fluentd | bool with_items: - "00-global" @@ -75,7 +73,6 @@ src: "{{ item.path }}" dest: "{{ node_config_directory }}/fluentd/input/{{ item.path | basename }}" mode: "0660" - register: fluentd_input_custom when: - enable_fluentd | bool with_items: "{{ find_custom_fluentd_inputs.files }}" @@ -94,7 +91,6 @@ dest: "{{ node_config_directory }}/fluentd/output/{{ item.name }}.conf" mode: "0660" become: true - register: fluentd_output when: - enable_fluentd | bool - item.enabled | bool @@ -140,7 +136,6 @@ dest: "{{ node_config_directory }}/fluentd/output/{{ item.path | basename }}" mode: "0660" become: true - register: fluentd_output_custom when: - enable_fluentd | bool with_items: "{{ find_custom_fluentd_outputs.files }}" @@ -153,7 +148,6 @@ dest: "{{ node_config_directory }}/fluentd/format/{{ item }}.conf" mode: "0660" become: true - register: fluentd_format with_items: - "apache_access" - "wsgi_access" @@ -176,7 +170,6 @@ src: "{{ item.path }}" dest: "{{ node_config_directory }}/fluentd/format/{{ item.path | basename }}" mode: "0660" - register: fluentd_format_custom when: - enable_fluentd | bool with_items: "{{ find_custom_fluentd_format.files }}" @@ -189,7 +182,6 @@ dest: "{{ node_config_directory }}/fluentd/filter/{{ item.dest }}.conf" mode: "0660" become: true - register: fluentd_filter with_items: - src: 00-record_transformer dest: 00-record_transformer @@ -214,7 +206,6 @@ dest: "{{ node_config_directory }}/fluentd/filter/{{ item.path | basename }}" mode: "0660" become: true - register: fluentd_filter_custom with_items: "{{ find_custom_fluentd_filters.files }}" when: enable_fluentd | bool notify: @@ -226,7 +217,6 @@ dest: "{{ node_config_directory }}/{{ item }}/td-agent.conf" mode: "0660" become: true - register: fluentd_td_agent with_items: - "fluentd" when: enable_fluentd | bool @@ -239,7 +229,6 @@ dest: "{{ node_config_directory }}/cron/logrotate/{{ item.name }}.conf" mode: "0660" become: true - register: cron_confs when: item.enabled | bool with_items: - { name: "ansible", enabled: "yes" } @@ -332,7 +321,6 @@ dimensions: "{{ item.value.dimensions }}" privileged: "{{ item.value.privileged | default(False) }}" environment: "{{ item.value.environment }}" - register: check_common_containers when: - kolla_action != "config" - item.value.enabled | bool diff --git a/ansible/roles/common/tasks/inspect.yml b/ansible/roles/common/tasks/inspect.yml new file mode 100644 index 0000000000..e5ee6727e3 --- /dev/null +++ b/ansible/roles/common/tasks/inspect.yml @@ -0,0 +1,6 @@ +--- +- name: Inspect common services + include_role: + name: inspect + vars: + inspect_services: "{{ common_services }}" diff --git a/ansible/roles/congress/handlers/main.yml b/ansible/roles/congress/handlers/main.yml index e71c2cc523..7295a953ac 100644 --- a/ansible/roles/congress/handlers/main.yml +++ b/ansible/roles/congress/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "congress-api" service: "{{ congress_services[service_name] }}" - config_json: "{{ congress_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - congress_conf: "{{ congress_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ congress_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - congress_api_container: "{{ check_congress_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or congress_conf.changed | bool - or policy_overwriting.changed | bool - or congress_api_container.changed | bool - name: Restart congress-policy-engine container vars: service_name: "congress-policy-engine" service: "{{ congress_services[service_name] }}" - config_json: "{{ congress_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - congress_conf: "{{ congress_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ congress_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - congress_policy_engin_container: "{{ check_congress_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or congress_conf.changed | bool - or policy_overwriting.changed | bool - or congress_policy_engin_container.changed | bool - name: Restart congress-datasource container vars: service_name: "congress-datasource" service: "{{ congress_services[service_name] }}" - config_json: "{{ congress_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - congress_conf: "{{ congress_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ congress_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - congress_datasource_container: "{{ check_congress_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -67,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or congress_conf.changed | bool - or policy_overwriting.changed | bool - or congress_datasource_container.changed | bool diff --git a/ansible/roles/congress/tasks/config.yml b/ansible/roles/congress/tasks/config.yml index 120e15bb8f..269bcd25b1 100644 --- a/ansible/roles/congress/tasks/config.yml +++ b/ansible/roles/congress/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: congress_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -56,7 +55,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/congress.conf" mode: "0660" become: true - register: congress_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -70,7 +68,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ congress_policy_file }}" mode: "0660" become: true - register: congress_policy_overwriting when: - congress_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -88,7 +85,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_congress_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/cyborg/handlers/main.yml b/ansible/roles/cyborg/handlers/main.yml index 97dcbcdb4e..a888384be2 100644 --- a/ansible/roles/cyborg/handlers/main.yml +++ b/ansible/roles/cyborg/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "cyborg-api" service: "{{ cyborg_services[service_name] }}" - config_json: "{{ cyborg_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cyborg_conf: "{{ cyborg_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cyborg_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cyborg_api_container: "{{ check_cyborg_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cyborg_conf.changed | bool - or policy_overwriting.changed | bool - or cyborg_api_container.changed | bool - name: Restart cyborg-conductor container vars: service_name: "cyborg-conductor" service: "{{ cyborg_services[service_name] }}" - config_json: "{{ cyborg_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cyborg_conf: "{{ cyborg_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cyborg_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cyborg_conductor_container: "{{ check_cyborg_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cyborg_conf.changed | bool - or policy_overwriting.changed | bool - or cyborg_conductor_container.changed | bool - name: Restart cyborg-agent container vars: service_name: "cyborg-agent" service: "{{ cyborg_services[service_name] }}" - config_json: "{{ cyborg_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - cyborg_conf: "{{ cyborg_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ cyborg_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - cyborg_agent_container: "{{ check_cyborg_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -67,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or cyborg_conf.changed | bool - or policy_overwriting.changed | bool - or cyborg_agent_container.changed | bool diff --git a/ansible/roles/cyborg/tasks/config.yml b/ansible/roles/cyborg/tasks/config.yml index 0c24e72810..b222b5ae3f 100644 --- a/ansible/roles/cyborg/tasks/config.yml +++ b/ansible/roles/cyborg/tasks/config.yml @@ -35,16 +35,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ cyborg_policy_file }}" mode: "0660" become: true - register: cyborg_policy_overwriting when: - cyborg_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cyborg_services }}" notify: - - Restart cyborg-api container - - Restart cyborg-agent container - - Restart cyborg-conductor container + - Restart {{ item.key }} container - name: Copying over config.json files for services template: @@ -52,15 +49,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: cyborg_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ cyborg_services }}" notify: - - Restart cyborg-api container - - Restart cyborg-agent container - - Restart cyborg-conductor container + - Restart {{ item.key }} container - name: Copying over cyborg.conf vars: @@ -75,15 +69,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/cyborg.conf" mode: "0660" become: true - register: cyborg_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ cyborg_services }}" notify: - - Restart cyborg-api container - - Restart cyborg-agent container - - Restart cyborg-conductor container + - Restart {{ item.key }} container - name: Checking whether cyborg-api-paste.ini file exists vars: @@ -100,11 +91,11 @@ template: src: "{{ node_custom_config }}/cyborg/cyborg-api-paste.ini" dest: "{{ node_config_directory }}/cyborg-api/api-paste.ini" + mode: "0660" when: - inventory_hostname in groups['cyborg-api'] - service.enabled | bool - check_cyborg_api_paste_ini.stat.exists - register: cyborg_api_paste notify: - Restart cyborg-api container @@ -117,13 +108,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_cyborg_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ cyborg_services }}" notify: - - Restart cyborg-api container - - Restart cyborg-agent container - - Restart cyborg-conductor container + - Restart {{ item.key }} container diff --git a/ansible/roles/designate/handlers/main.yml b/ansible/roles/designate/handlers/main.yml index 5f6207f96a..1fa1740fec 100644 --- a/ansible/roles/designate/handlers/main.yml +++ b/ansible/roles/designate/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "designate-backend-bind9" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_backend_bind9_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_rndc_conf.changed | bool - or designate_rndc_key_file.changed | bool - or designate_named.changed | bool - or designate_backend_bind9_container.changed | bool - name: Restart designate-api container vars: service_name: "designate-api" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_conf: "{{ designate_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ designate_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_api_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -41,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_conf.changed | bool - or policy_overwriting.changed | bool - or designate_api_container.changed | bool - name: Restart designate-central container vars: service_name: "designate-central" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_conf: "{{ designate_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ designate_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_central_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -66,21 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_conf.changed | bool - or policy_overwriting.changed | bool - or designate_central_container.changed | bool - name: Restart designate-producer container vars: service_name: "designate-producer" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_conf: "{{ designate_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ designate_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_producer_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -91,21 +58,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_conf.changed | bool - or policy_overwriting.changed | bool - or designate_producer_container.changed | bool - name: Restart designate-mdns container vars: service_name: "designate-mdns" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_conf: "{{ designate_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ designate_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_mdns_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -116,21 +73,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_conf.changed | bool - or policy_overwriting.changed | bool - or designate_mdns_container.changed | bool - name: Restart designate-worker container vars: service_name: "designate-worker" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_conf: "{{ designate_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ designate_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_worker_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -141,24 +88,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_conf.changed | bool - or designate_rndc_conf.changed | bool - or designate_rndc_key_file.changed | bool - or policy_overwriting.changed | bool - or designate_worker_container.changed | bool - or designate_pool.changed | bool - name: Restart designate-sink container vars: service_name: "designate-sink" service: "{{ designate_services[service_name] }}" - config_json: "{{ designate_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_conf: "{{ designate_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ designate_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - designate_sink_container: "{{ check_designate_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -169,9 +103,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or designate_conf.changed | bool - or policy_overwriting.changed | bool - or designate_sink_container.changed | bool diff --git a/ansible/roles/designate/tasks/backend_external.yml b/ansible/roles/designate/tasks/backend_external.yml index 888928633a..717fb5f525 100644 --- a/ansible/roles/designate/tasks/backend_external.yml +++ b/ansible/roles/designate/tasks/backend_external.yml @@ -4,7 +4,6 @@ src: "{{ node_custom_config }}/designate/rndc.conf" dest: "{{ node_config_directory }}/{{ item.key }}/rndc.conf" mode: "0660" - register: designate_rndc_conf when: - designate_backend_external == 'bind9' - item.key in [ "designate-worker" ] @@ -12,14 +11,13 @@ - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-worker container + - Restart {{ item.key }} container - name: Copying over rndc.key (designate_backend_external) template: src: "{{ node_custom_config }}/designate/rndc.key" dest: "{{ node_config_directory }}/{{ item.key }}/rndc.key" mode: "0660" - register: designate_rndc_key_file when: - designate_backend_external == 'bind9' - item.key in [ "designate-worker" ] @@ -27,4 +25,4 @@ - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-worker container + - Restart {{ item.key }} container diff --git a/ansible/roles/designate/tasks/config.yml b/ansible/roles/designate/tasks/config.yml index 7cbf431dd0..cb1e3d4875 100644 --- a/ansible/roles/designate/tasks/config.yml +++ b/ansible/roles/designate/tasks/config.yml @@ -35,19 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: designate_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-api container - - Restart designate-central container - - Restart designate-producer container - - Restart designate-mdns container - - Restart designate-sink container - - Restart designate-backend-bind9 container - - Restart designate-worker container + - Restart {{ item.key }} container - name: Copying over designate.conf vars: @@ -62,18 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/designate.conf" mode: "0660" become: true - register: designate_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-api container - - Restart designate-central container - - Restart designate-producer container - - Restart designate-mdns container - - Restart designate-sink container - - Restart designate-worker container + - Restart {{ item.key }} container - name: Copying over pools.yaml vars: @@ -83,7 +70,6 @@ dest: "{{ node_config_directory }}/designate-worker/pools.yaml" mode: "0660" become: true - register: designate_pool when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -101,7 +87,6 @@ dest: "{{ node_config_directory }}/designate-backend-bind9/named.conf" mode: "0660" become: true - register: designate_named when: - designate_backend == 'bind9' - inventory_hostname in groups[service.group] @@ -120,7 +105,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/rndc.conf" mode: "0660" become: true - register: designate_rndc_conf when: - designate_backend == 'bind9' and designate_backend_external == 'no' - item.key in [ "designate-backend-bind9", "designate-worker" ] @@ -128,8 +112,7 @@ - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-backend-bind9 container - - Restart designate-worker container + - Restart {{ item.key }} container - name: Copying over rndc.key template: @@ -137,7 +120,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/rndc.key" mode: "0660" become: true - register: designate_rndc_key_file when: - designate_backend == 'bind9' and designate_backend_external == 'no' - item.key in [ "designate-backend-bind9", "designate-worker" ] @@ -145,8 +127,7 @@ - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-backend-bind9 container - - Restart designate-worker container + - Restart {{ item.key }} container - include_tasks: backend_external.yml when: designate_backend_external == 'bind9' @@ -157,19 +138,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ designate_policy_file }}" mode: "0660" become: true - register: designate_policy_overwriting when: - designate_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-api container - - Restart designate-central container - - Restart designate-producer container - - Restart designate-mdns container - - Restart designate-sink container - - Restart designate-worker container + - Restart {{ item.key }} container - name: Check designate containers become: true @@ -180,17 +155,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_designate_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ designate_services }}" notify: - - Restart designate-api container - - Restart designate-central container - - Restart designate-producer container - - Restart designate-mdns container - - Restart designate-sink container - - Restart designate-backend-bind9 container - - Restart designate-worker container + - Restart {{ item.key }} container diff --git a/ansible/roles/elasticsearch/handlers/main.yml b/ansible/roles/elasticsearch/handlers/main.yml index 31b82c9087..790cfb7d9f 100644 --- a/ansible/roles/elasticsearch/handlers/main.yml +++ b/ansible/roles/elasticsearch/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "elasticsearch" service: "{{ elasticsearch_services[service_name] }}" - config_json: "{{ elasticsearch_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - elasticsearch_conf: "{{ elasticsearch_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - elasticsearch_container: "{{ check_elasticsearch_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,8 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or elasticsearch_conf.changed | bool - or elasticsearch_container.changed | bool diff --git a/ansible/roles/elasticsearch/tasks/config.yml b/ansible/roles/elasticsearch/tasks/config.yml index 1b450b0f59..096c09d873 100644 --- a/ansible/roles/elasticsearch/tasks/config.yml +++ b/ansible/roles/elasticsearch/tasks/config.yml @@ -27,13 +27,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: elasticsearch_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ elasticsearch_services }}" notify: - - Restart elasticsearch container + - Restart {{ item.key }} container - name: Copying over elasticsearch.yml template: @@ -41,13 +40,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.yml" mode: "0660" become: true - register: elasticsearch_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ elasticsearch_services }}" notify: - - Restart elasticsearch container + - Restart {{ item.key }} container - name: Check elasticsearch containers become: true @@ -59,11 +57,10 @@ volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" environment: "{{ item.value.environment }}" - register: check_elasticsearch_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ elasticsearch_services }}" notify: - - Restart elasticsearch container + - Restart {{ item.key }} container diff --git a/ansible/roles/etcd/handlers/main.yml b/ansible/roles/etcd/handlers/main.yml index c9fd38d132..dd5a3d1f99 100644 --- a/ansible/roles/etcd/handlers/main.yml +++ b/ansible/roles/etcd/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "etcd" service: "{{ etcd_services[service_name] }}" - config_json: "{{ etcd_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - etcd_container: "{{ check_etcd_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,7 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - inventory_hostname in groups[service.group] - - config_json.changed | bool - or etcd_container.changed | bool diff --git a/ansible/roles/etcd/tasks/config.yml b/ansible/roles/etcd/tasks/config.yml index dd827b2223..0d98fef79c 100644 --- a/ansible/roles/etcd/tasks/config.yml +++ b/ansible/roles/etcd/tasks/config.yml @@ -18,13 +18,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: etcd_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ etcd_services }}" notify: - - Restart etcd container + - Restart {{ item.key }} container - name: Check etcd containers become: true @@ -36,11 +35,10 @@ volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" environment: "{{ item.value.environment }}" - register: check_etcd_containers when: - kolla_action != "config" - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ etcd_services }}" notify: - - Restart etcd container + - Restart {{ item.key }} container diff --git a/ansible/roles/freezer/handlers/main.yml b/ansible/roles/freezer/handlers/main.yml index 3a5be2c0b0..69074b3184 100644 --- a/ansible/roles/freezer/handlers/main.yml +++ b/ansible/roles/freezer/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "freezer-api" service: "{{ freezer_services[service_name] }}" - config_json: "{{ freezer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - freezer_conf: "{{ freezer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ freezer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - freezer_api_container: "{{ check_freezer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or wsgi_freezer_api.changed | bool - or freezer_conf.changed | bool - or policy_overwriting.changed | bool - or freezer_api_container.changed | bool - name: Restart freezer-scheduler container vars: service_name: "freezer-scheduler" service: "{{ freezer_services[service_name] }}" - config_json: "{{ freezer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - freezer_conf: "{{ freezer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ freezer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - freezer_scheduler_container: "{{ check_freezer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or freezer_conf.changed | bool - or policy_overwriting.changed | bool - or freezer_scheduler_container.changed | bool diff --git a/ansible/roles/freezer/tasks/config.yml b/ansible/roles/freezer/tasks/config.yml index eb969317b1..cf85a2789a 100644 --- a/ansible/roles/freezer/tasks/config.yml +++ b/ansible/roles/freezer/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: freezer_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -51,7 +50,6 @@ dest: "{{ node_config_directory }}/freezer-api/wsgi-freezer-api.conf" mode: "0660" become: true - register: wsgi_freezer_api when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -71,7 +69,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/freezer.conf" mode: "0660" become: true - register: freezer_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -85,7 +82,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ freezer_policy_file }}" mode: "0660" become: true - register: freezer_policy_overwriting when: - freezer_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -103,7 +99,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" dimensions: "{{ item.value.dimensions }}" - register: check_freezer_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/glance/handlers/main.yml b/ansible/roles/glance/handlers/main.yml index 1c17704121..93218c02d3 100644 --- a/ansible/roles/glance/handlers/main.yml +++ b/ansible/roles/glance/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "glance-api" service: "{{ glance_services[service_name] }}" - config_json: "{{ glance_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - glance_conf: "{{ glance_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ glance_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - glance_api_container: "{{ check_glance_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -18,13 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in glance_api_hosts - - service.enabled | bool - - config_json.changed | bool - or glance_cache_conf.changed | bool - or glance_conf.changed | bool - or glance_swift_conf.changed | bool - or policy_overwriting.changed | bool - or glance_api_container.changed | bool - or ( glance_upgrading is defined and glance_upgrading | bool ) - or ( glance_api_ceph_files is defined and glance_api_ceph_files.changed | bool ) diff --git a/ansible/roles/glance/tasks/ceph.yml b/ansible/roles/glance/tasks/ceph.yml index f8fd4979d7..8acec68ea1 100644 --- a/ansible/roles/glance/tasks/ceph.yml +++ b/ansible/roles/glance/tasks/ceph.yml @@ -9,6 +9,8 @@ mode: "0660" become: true when: inventory_hostname in groups['glance-api'] + notify: + - Restart glance-api container - include_tasks: ../../ceph_pools.yml vars: @@ -37,6 +39,8 @@ mode: "0600" become: true when: inventory_hostname in groups['glance-api'] + notify: + - Restart glance-api container - name: Ensuring config directory has correct owner and permission become: true diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index c8618676ec..dd34fbadca 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -45,13 +45,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: glance_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ glance_services }}" notify: - - Restart glance-api container + - Restart {{ item.key }} container - name: Copying over glance-*.conf vars: @@ -66,13 +65,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.conf" mode: "0660" become: true - register: glance_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ glance_services }}" notify: - - Restart glance-api container + - Restart {{ item.key }} container - name: Copying over glance-cache.conf for glance_api vars: @@ -86,7 +84,6 @@ dest: "{{ node_config_directory }}/glance-api/glance-cache.conf" mode: "0660" become: true - register: glance_cache_conf when: - glance_api.enabled | bool - inventory_hostname in groups[glance_api.group] @@ -106,7 +103,6 @@ dest: "{{ node_config_directory }}/glance-api/glance-swift.conf" mode: "0660" become: true - register: glance_swift_conf when: - glance_api.enabled | bool - inventory_hostname in groups[glance_api.group] @@ -120,14 +116,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ glance_policy_file }}" mode: "0660" become: true - register: glance_policy_overwriting when: - glance_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ glance_services }}" notify: - - Restart glance-api container + - Restart {{ item.key }} container - name: Check glance containers become: true @@ -139,11 +134,10 @@ environment: "{{ item.value.environment | default(omit) }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_glance_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ glance_services }}" notify: - - Restart glance-api container + - Restart {{ item.key }} container diff --git a/ansible/roles/glance/tasks/external_ceph.yml b/ansible/roles/glance/tasks/external_ceph.yml index 4bf6f8f87d..33b20731b8 100644 --- a/ansible/roles/glance/tasks/external_ceph.yml +++ b/ansible/roles/glance/tasks/external_ceph.yml @@ -5,7 +5,6 @@ dest: "{{ node_config_directory }}/glance-api/" mode: "0660" become: true - register: glance_api_ceph_files when: inventory_hostname in groups['glance-api'] with_fileglob: - "{{ node_custom_config }}/glance/ceph*" diff --git a/ansible/roles/gnocchi/handlers/main.yml b/ansible/roles/gnocchi/handlers/main.yml index bf90fc3a87..d7ca93a660 100644 --- a/ansible/roles/gnocchi/handlers/main.yml +++ b/ansible/roles/gnocchi/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "gnocchi-api" service: "{{ gnocchi_services[service_name] }}" - config_json: "{{ gnocchi_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_conf: "{{ gnocchi_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ gnocchi_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_api_container: "{{ check_gnocchi_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or gnocchi_conf.changed | bool - or policy_overwriting.changed | bool - or gnocchi_wsgi_conf.changed | bool - or gnocchi_api_container.changed | bool - name: Restart gnocchi-metricd container vars: service_name: "gnocchi-metricd" service: "{{ gnocchi_services[service_name] }}" - config_json: "{{ gnocchi_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_conf: "{{ gnocchi_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ gnocchi_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_metricd_container: "{{ check_gnocchi_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or gnocchi_conf.changed | bool - or policy_overwriting.changed | bool - or gnocchi_metricd_container.changed | bool - name: Restart gnocchi-statsd container vars: service_name: "gnocchi-statsd" service: "{{ gnocchi_services[service_name] }}" - config_json: "{{ gnocchi_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_conf: "{{ gnocchi_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ gnocchi_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - gnocchi_statsd_container: "{{ check_gnocchi_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -68,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or gnocchi_conf.changed | bool - or policy_overwriting.changed | bool - or gnocchi_statsd_container.changed | bool diff --git a/ansible/roles/gnocchi/tasks/ceph.yml b/ansible/roles/gnocchi/tasks/ceph.yml index 8a16656599..e26d54b041 100644 --- a/ansible/roles/gnocchi/tasks/ceph.yml +++ b/ansible/roles/gnocchi/tasks/ceph.yml @@ -13,6 +13,8 @@ - "gnocchi-api" - "gnocchi-metricd" - "gnocchi-statsd" + notify: + - Restart {{ item }} container - include_tasks: ../../ceph_pools.yml vars: @@ -45,3 +47,5 @@ - "gnocchi-api" - "gnocchi-metricd" - "gnocchi-statsd" + notify: + - Restart {{ item }} container diff --git a/ansible/roles/gnocchi/tasks/config.yml b/ansible/roles/gnocchi/tasks/config.yml index 88fca1614b..1468e77b68 100644 --- a/ansible/roles/gnocchi/tasks/config.yml +++ b/ansible/roles/gnocchi/tasks/config.yml @@ -45,15 +45,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: gnocchi_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ gnocchi_services }}" notify: - - Restart gnocchi-api container - - Restart gnocchi-metricd container - - Restart gnocchi-statsd container + - Restart {{ item.key }} container - name: Copying over gnocchi.conf vars: @@ -68,15 +65,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/gnocchi.conf" mode: "0660" become: true - register: gnocchi_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ gnocchi_services }}" notify: - - Restart gnocchi-api container - - Restart gnocchi-metricd container - - Restart gnocchi-statsd container + - Restart {{ item.key }} container - name: Copying over wsgi-gnocchi.conf vars: @@ -86,7 +80,6 @@ dest: "{{ node_config_directory }}/{{ item }}/wsgi-gnocchi.conf" mode: "0660" become: true - register: gnocchi_wsgi_conf when: - inventory_hostname in groups['gnocchi-api'] - service.enabled | bool @@ -101,16 +94,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ gnocchi_policy_file }}" mode: "0660" become: true - register: gnocchi_policy_overwriting when: - gnocchi_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ gnocchi_services }}" notify: - - Restart gnocchi-api container - - Restart gnocchi-metricd container - - Restart gnocchi-statsd container + - Restart {{ item.key }} container - name: Check gnocchi containers become: true @@ -121,13 +111,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_gnocchi_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ gnocchi_services }}" notify: - - Restart gnocchi-api container - - Restart gnocchi-metricd container - - Restart gnocchi-statsd container + - Restart {{ item.key }} container diff --git a/ansible/roles/gnocchi/tasks/external_ceph.yml b/ansible/roles/gnocchi/tasks/external_ceph.yml index 48e2bb5290..e75c1ac269 100644 --- a/ansible/roles/gnocchi/tasks/external_ceph.yml +++ b/ansible/roles/gnocchi/tasks/external_ceph.yml @@ -11,9 +11,7 @@ - "gnocchi-metricd" - "gnocchi-statsd" notify: - - Restart gnocchi-api container - - Restart gnocchi-metricd container - - Restart gnocchi-statsd container + - Restart {{ item }} container - name: Copy over ceph gnocchi keyring copy: @@ -27,9 +25,7 @@ - "gnocchi-metricd" - "gnocchi-statsd" notify: - - Restart gnocchi-api container - - Restart gnocchi-metricd container - - Restart gnocchi-statsd container + - Restart {{ item }} container - name: Ensuring config directory has correct owner and permission become: true diff --git a/ansible/roles/grafana/handlers/main.yml b/ansible/roles/grafana/handlers/main.yml index a8fb340e1c..871c9a8c03 100644 --- a/ansible/roles/grafana/handlers/main.yml +++ b/ansible/roles/grafana/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "grafana" service: "{{ grafana_services[service_name] }}" - config_json: "{{ grafana_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - grafana_conf: "{{ grafana_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - grafana_container: "{{ check_grafana_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,10 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or grafana_conf.changed | bool - or grafana_container.changed | bool - or grafana_home_dashboard.changed | bool - or grafana_prometheus_data_source.changed | bool diff --git a/ansible/roles/grafana/tasks/config.yml b/ansible/roles/grafana/tasks/config.yml index 6e90192029..d2a27751a4 100644 --- a/ansible/roles/grafana/tasks/config.yml +++ b/ansible/roles/grafana/tasks/config.yml @@ -24,13 +24,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: grafana_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ grafana_services }}" notify: - - Restart grafana container + - Restart {{ item.key }} container - name: Copying over grafana.ini vars: @@ -43,13 +42,12 @@ dest: "{{ node_config_directory }}/grafana/grafana.ini" mode: "0660" become: true - register: grafana_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ grafana_services }}" notify: - - Restart grafana container + - Restart {{ item.key }} container - name: Copying over extra configuration file become: true @@ -62,7 +60,7 @@ with_items: - "{{ check_extra_conf_grafana.files }}" notify: - - Restart grafana container + - Restart {{ item.key }} container - name: Check if custom grafana home dashboard exists local_action: "stat path={{ node_custom_config }}/grafana/grafana_home_dashboard.json" @@ -74,10 +72,9 @@ src: "{{ node_custom_config }}/grafana/grafana_home_dashboard.json" dest: "{{ node_config_directory }}/grafana/grafana_home_dashboard.json" mode: "0660" - register: grafana_home_dashboard when: grafana_custom_dashboard_file.stat.exists notify: - - Restart grafana container + - Restart {{ item.key }} container - name: Configuring Prometheus as data source for Grafana vars: @@ -87,7 +84,6 @@ dest: "{{ node_config_directory }}/grafana/prometheus.yaml" mode: "0660" become: true - register: grafana_prometheus_data_source when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -97,7 +93,7 @@ - "{{ node_custom_config }}/grafana/prometheus.yaml" - "prometheus.yaml.j2" notify: - - Restart grafana container + - Restart {{ item.key }} container - name: Check grafana containers become: true @@ -108,11 +104,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_grafana_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ grafana_services }}" notify: - - Restart grafana container + - Restart {{ item.key }} container diff --git a/ansible/roles/heat/handlers/main.yml b/ansible/roles/heat/handlers/main.yml index a28dd2744e..f2a4a47ae6 100644 --- a/ansible/roles/heat/handlers/main.yml +++ b/ansible/roles/heat/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "heat-api" service: "{{ heat_services[service_name] }}" - config_json: "{{ heat_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - heat_conf: "{{ heat_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ heat_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - heat_api_container: "{{ check_heat_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or heat_conf.changed | bool - or policy_overwriting.changed | bool - or heat_api_container.changed | bool - name: Restart heat-api-cfn container vars: service_name: "heat-api-cfn" service: "{{ heat_services[service_name] }}" - config_json: "{{ heat_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - heat_conf: "{{ heat_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ heat_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - heat_api_cfn_container: "{{ check_heat_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or heat_conf.changed | bool - or policy_overwriting.changed | bool - or heat_api_cfn_container.changed | bool - name: Restart heat-engine container vars: service_name: "heat-engine" service: "{{ heat_services[service_name] }}" - config_json: "{{ heat_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - heat_conf: "{{ heat_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ heat_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - heat_engine_container: "{{ check_heat_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -67,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or heat_conf.changed | bool - or policy_overwriting.changed | bool - or heat_engine_container.changed | bool diff --git a/ansible/roles/heat/tasks/config.yml b/ansible/roles/heat/tasks/config.yml index 38063d33dd..7195830bab 100644 --- a/ansible/roles/heat/tasks/config.yml +++ b/ansible/roles/heat/tasks/config.yml @@ -35,15 +35,12 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: heat_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ heat_services }}" notify: - - Restart heat-api container - - Restart heat-api-cfn container - - Restart heat-engine container + - Restart {{ item.key }} container - name: Copying over the heat-engine environment file become: true @@ -67,15 +64,12 @@ - "{{ node_custom_config }}/heat/{{ inventory_hostname }}/heat.conf" dest: "{{ node_config_directory }}/{{ item.key }}/heat.conf" mode: "0660" - register: heat_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ heat_services }}" notify: - - Restart heat-api container - - Restart heat-api-cfn container - - Restart heat-engine container + - Restart {{ item.key }} container - name: Copying over existing policy file become: true @@ -83,15 +77,13 @@ src: "{{ heat_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ heat_policy_file }}" mode: "0660" - register: heat_policy_overwriting when: - heat_policy_file is defined + - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ heat_services }}" notify: - - Restart heat-api container - - Restart heat-api-cfn container - - Restart heat-engine container + - Restart {{ item.key }} container - name: Check heat containers become: true @@ -102,13 +94,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_heat_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ heat_services }}" notify: - - Restart heat-api container - - Restart heat-api-cfn container - - Restart heat-engine container + - Restart {{ item.key }} container diff --git a/ansible/roles/horizon/handlers/main.yml b/ansible/roles/horizon/handlers/main.yml index bf15bee9f4..c1f7110e5e 100644 --- a/ansible/roles/horizon/handlers/main.yml +++ b/ansible/roles/horizon/handlers/main.yml @@ -14,11 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - horizon_config_json is changed - or horizon_conf is changed - or horizon_local_settings is changed - or horizon_custom_local_settings is changed - or policy_jsons is changed - or check_horizon_container is changed diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml index 0ea4b3bfc0..59242ba04a 100644 --- a/ansible/roles/horizon/tasks/config.yml +++ b/ansible/roles/horizon/tasks/config.yml @@ -54,7 +54,6 @@ src: "horizon.json.j2" dest: "{{ node_config_directory }}/horizon/config.json" mode: "0660" - register: horizon_config_json when: - horizon.enabled | bool - inventory_hostname in groups[horizon.group] @@ -69,7 +68,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/horizon/horizon.conf" mode: "0660" - register: horizon_conf with_first_found: - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/horizon.conf" - "{{ node_custom_config }}/horizon/horizon.conf" @@ -92,7 +90,6 @@ - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/local_settings" - "{{ node_custom_config }}/horizon/local_settings" - "local_settings.j2" - register: horizon_local_settings when: - horizon.enabled | bool - inventory_hostname in groups[horizon.group] @@ -111,7 +108,6 @@ - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/custom_local_settings" - "{{ node_custom_config }}/horizon/custom_local_settings" - "custom_local_settings.j2" - register: horizon_custom_local_settings when: - horizon.enabled | bool - inventory_hostname in groups[horizon.group] @@ -126,7 +122,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/horizon/{{ item | basename }}" mode: "0660" - register: policy_jsons when: - horizon.enabled | bool - inventory_hostname in groups[horizon.group] @@ -146,7 +141,6 @@ environment: "{{ horizon.environment }}" volumes: "{{ horizon.volumes }}" dimensions: "{{ horizon.dimensions }}" - register: check_horizon_container when: - kolla_action != "config" - inventory_hostname in groups[horizon.group] diff --git a/ansible/roles/influxdb/handlers/main.yml b/ansible/roles/influxdb/handlers/main.yml index 2e9bd3bc13..493df20750 100644 --- a/ansible/roles/influxdb/handlers/main.yml +++ b/ansible/roles/influxdb/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "influxdb" service: "{{ influxdb_services[service_name] }}" - config_json: "{{ influxdb_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - influxdb_container: "{{ check_influxdb_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,8 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or influxdb_confs.changed | bool - or influxdb_container.changed | bool diff --git a/ansible/roles/influxdb/tasks/config.yml b/ansible/roles/influxdb/tasks/config.yml index 91e4ace933..16b3fc5efb 100644 --- a/ansible/roles/influxdb/tasks/config.yml +++ b/ansible/roles/influxdb/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/influxdb/config.json" mode: "0660" become: true - register: influxdb_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -34,7 +33,6 @@ dest: "{{ node_config_directory }}/influxdb/influxdb.conf" mode: "0660" become: true - register: influxdb_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -54,7 +52,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_influxdb_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/ironic/handlers/main.yml b/ansible/roles/ironic/handlers/main.yml index 7fbbc317af..35fa73d021 100644 --- a/ansible/roles/ironic/handlers/main.yml +++ b/ansible/roles/ironic/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "ironic-conductor" service: "{{ ironic_services[service_name] }}" - config_json: "{{ ironic_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_conf: "{{ ironic_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ ironic_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_conductor_container: "{{ check_ironic_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -18,21 +14,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ironic_conf.changed | bool - or policy_json.changed | bool - or ironic_conductor_container.changed | bool - name: Restart ironic-api container vars: service_name: "ironic-api" service: "{{ ironic_services[service_name] }}" - config_json: "{{ ironic_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_conf: "{{ ironic_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ ironic_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_api_container: "{{ check_ironic_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,20 +29,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ironic_conf.changed | bool - or policy_json.changed | bool - or ironic_api_container.changed | bool - name: Restart ironic-inspector container vars: service_name: "ironic-inspector" service: "{{ ironic_services[service_name] }}" - config_json: "{{ ironic_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ ironic_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_inspector_container: "{{ check_ironic_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -68,19 +45,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ironic_inspector_confs.changed | bool - or policy_json.changed | bool - or ironic_inspector_container.changed | bool - name: Restart ironic-pxe container vars: service_name: "ironic-pxe" service: "{{ ironic_services[service_name] }}" - config_json: "{{ ironic_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_pxe_container: "{{ check_ironic_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -91,20 +60,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ironic_pxe_confs.changed | bool - or ironic_pxe_uefi_confs.changed | bool - or ironic_kernel.changed | bool - or ironic_pxe_container.changed | bool - name: Restart ironic-ipxe container vars: service_name: "ironic-ipxe" service: "{{ ironic_services[service_name] }}" - config_json: "{{ ironic_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_ipxe_container: "{{ check_ironic_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -115,20 +75,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ironic_ipxe_inspector_boot_script.changed | bool - or ironic_ipxe_apache_confs.changed | bool - or ironic_kernel_ipxe.changed | bool - or ironic_ipxe_container.changed | bool - name: Restart ironic-dnsmasq container vars: service_name: "ironic-dnsmasq" service: "{{ ironic_services[service_name] }}" - config_json: "{{ ironic_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_dnsmasq_container: "{{ check_ironic_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -140,8 +91,3 @@ cap_add: "{{ service.cap_add }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or ironic_dnsmasq_confs.changed | bool - or ironic_dnsmasq_container.changed | bool diff --git a/ansible/roles/ironic/tasks/config.yml b/ansible/roles/ironic/tasks/config.yml index 552f8adc9b..fa270f62a7 100644 --- a/ansible/roles/ironic/tasks/config.yml +++ b/ansible/roles/ironic/tasks/config.yml @@ -42,7 +42,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: ironic_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -63,7 +62,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/ironic.conf" mode: "0660" become: true - register: ironic_confs when: - item.key in [ "ironic-api", "ironic-conductor" ] - inventory_hostname in groups[item.value.group] @@ -85,7 +83,6 @@ dest: "{{ node_config_directory }}/ironic-inspector/inspector.conf" mode: "0660" become: true - register: ironic_inspector_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -100,7 +97,6 @@ dest: "{{ node_config_directory }}/ironic-dnsmasq/dnsmasq.conf" mode: "0660" become: true - register: ironic_dnsmasq_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -119,7 +115,6 @@ dest: "{{ node_config_directory }}/ironic-pxe/default" mode: "0660" become: true - register: ironic_pxe_confs with_first_found: - "{{ node_custom_config }}/ironic/pxelinux.default" - "{{ node_custom_config }}/ironic/{{ inventory_hostname }}/pxelinux.default" @@ -142,7 +137,6 @@ dest: "{{ node_config_directory }}/ironic-pxe/default" mode: "0660" become: true - register: ironic_pxe_uefi_confs with_first_found: - "{{ node_custom_config }}/ironic/ironic_pxe_uefi.default" - "{{ node_custom_config }}/ironic/{{ inventory_hostname }}/ironic_pxe_uefi.default" @@ -162,14 +156,12 @@ dest: "{{ node_config_directory }}/ironic-pxe/{{ item }}" mode: "0660" become: true - register: ironic_kernel with_items: - "ironic-agent.kernel" - "ironic-agent.initramfs" when: # Only required when Ironic inspector is in use. - groups['ironic-inspector'] | length > 0 - - inventory_hostname in groups['ironic-pxe'] - inventory_hostname in groups[service.group] - service.enabled | bool - not enable_ironic_pxe_uefi | bool @@ -185,7 +177,6 @@ dest: "{{ node_config_directory }}/ironic-ipxe/{{ item }}" mode: "0660" become: true - register: ironic_kernel_ipxe with_items: - "ironic-agent.kernel" - "ironic-agent.initramfs" @@ -205,7 +196,6 @@ dest: "{{ node_config_directory }}/ironic-ipxe/inspector.ipxe" mode: "0660" become: true - register: ironic_ipxe_inspector_boot_script with_first_found: - "{{ node_custom_config }}/ironic/{{ inventory_hostname }}/inspector.ipxe" - "{{ node_custom_config }}/ironic/inspector.ipxe" @@ -226,7 +216,6 @@ dest: "{{ node_config_directory }}/ironic-ipxe/httpd.conf" mode: "0660" become: true - register: ironic_ipxe_apache_confs with_first_found: - "{{ node_custom_config }}/ironic/ironic-ipxe-httpd.conf" - "ironic-ipxe-httpd.conf.j2" @@ -247,7 +236,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ ironic_policy_file }}" mode: "0660" become: true - register: ironic_policy_jsons when: - ironic_policy_file is defined - item.key in services_require_policy_json @@ -268,7 +256,6 @@ cap_add: "{{ item.value.cap_add|default([]) }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_ironic_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/kafka/handlers/main.yml b/ansible/roles/kafka/handlers/main.yml index ba71ff36f2..28b45dc303 100644 --- a/ansible/roles/kafka/handlers/main.yml +++ b/ansible/roles/kafka/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "kafka" service: "{{ kafka_services[service_name] }}" - config_json: "{{ kafka_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - kafka_conf: "{{ kafka_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - kafka_container: "{{ check_kafka_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,8 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or kafka_conf.changed | bool - or kafka_container.changed | bool diff --git a/ansible/roles/kafka/tasks/config.yml b/ansible/roles/kafka/tasks/config.yml index 05a926dcca..83da40425e 100644 --- a/ansible/roles/kafka/tasks/config.yml +++ b/ansible/roles/kafka/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: kafka_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -35,7 +34,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/kafka.server.properties" mode: "0660" become: true - register: kafka_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -53,7 +51,6 @@ volumes: "{{ item.value.volumes }}" environment: "{{ item.value.environment }}" dimensions: "{{ item.value.dimensions }}" - register: check_kafka_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/karbor/handlers/main.yml b/ansible/roles/karbor/handlers/main.yml index 9dcd077400..6865792ba0 100644 --- a/ansible/roles/karbor/handlers/main.yml +++ b/ansible/roles/karbor/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "karbor-api" service: "{{ karbor_services[service_name] }}" - config_json: "{{ karbor_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - karbor_conf: "{{ karbor_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - karbor_api_container: "{{ check_karbor_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,19 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or karbor_conf.changed | bool - or karbor_api_container.changed | bool - name: Restart karbor-protection container vars: service_name: "karbor-protection" service: "{{ karbor_services[service_name] }}" - config_json: "{{ karbor_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - karbor_conf: "{{ karbor_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - karbor_protection_container: "{{ check_karbor_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -39,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or karbor_conf.changed | bool - or providers_conf.changed - or openstack_infra_conf.changed | bool - or karbor_protection_container.changed | bool - name: Restart karbor-operationengine container vars: service_name: "karbor-operationengine" service: "{{ karbor_services[service_name] }}" - config_json: "{{ karbor_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - karbor_conf: "{{ karbor_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - karbor_operationengine_container: "{{ check_karbor_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -64,8 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or karbor_conf.changed | bool - or karbor_operationengine_container.changed | bool diff --git a/ansible/roles/karbor/tasks/config.yml b/ansible/roles/karbor/tasks/config.yml index be84f3c0db..953175bf29 100644 --- a/ansible/roles/karbor/tasks/config.yml +++ b/ansible/roles/karbor/tasks/config.yml @@ -18,15 +18,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: karbor_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ karbor_services }}" notify: - - Restart karbor-api container - - Restart karbor-protection container - - Restart karbor-operationengine container + - Restart {{ item.key }} container - name: Copying over karbor.conf vars: @@ -41,15 +38,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/karbor.conf" mode: "0660" become: true - register: karbor_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ karbor_services }}" notify: - - Restart karbor-api container - - Restart karbor-protection container - - Restart karbor-operationengine container + - Restart {{ item.key }} container - name: Copying over provider configs vars: @@ -62,7 +56,6 @@ become: true with_fileglob: - "{{ node_custom_config }}/karbor/{{ service_name }}/providers.d/*" - register: providers_conf when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -80,7 +73,6 @@ dest: "{{ node_config_directory }}/{{ service_name }}/providers.d/openstack-infra.conf" mode: "0660" become: true - register: openstack_infra_conf when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -96,13 +88,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_karbor_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ karbor_services }}" notify: - - Restart karbor-api container - - Restart karbor-protection container - - Restart karbor-operationengine container + - Restart {{ item.key }} container diff --git a/ansible/roles/keystone/handlers/main.yml b/ansible/roles/keystone/handlers/main.yml index 3173a86308..fa6b30e0c1 100644 --- a/ansible/roles/keystone/handlers/main.yml +++ b/ansible/roles/keystone/handlers/main.yml @@ -24,17 +24,12 @@ run_once: True when: - kolla_action == "upgrade" - - service.enabled | bool - inventory_hostname == groups[service.group][0] - name: Restart keystone container vars: service_name: "keystone" service: "{{ keystone_services[service_name] }}" - config_json: "{{ keystone_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - keystone_conf: "{{ keystone_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ keystone_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - keystone_container: "{{ check_keystone_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -45,22 +40,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or keystone_conf.changed | bool - or keystone_domains.changed | bool - or policy_overwriting.changed | bool - or keystone_wsgi.changed | bool - or keystone_paste_ini.changed | bool - or keystone_container.changed | bool - name: Restart keystone-ssh container vars: service_name: "keystone-ssh" service: "{{ keystone_services[service_name] }}" - config_json: "{{ keystone_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - keystone_ssh_container: "{{ check_keystone_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -71,20 +55,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or keystone_ssh_confs.changed | bool - or keystone_ssh_container.changed | bool - name: Restart keystone-fernet container vars: service_name: "keystone-fernet" service: "{{ keystone_services[service_name] }}" - config_json: "{{ keystone_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - keystone_conf: "{{ keystone_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ keystone_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - keystone_fernet_container: "{{ check_keystone_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -95,13 +70,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or keystone_conf.changed | bool - or policy_overwriting.changed | bool - or keystone_fernet_confs.changed | bool - or keystone_fernet_container.changed | bool - name: Finish keystone database upgrade vars: @@ -125,5 +93,4 @@ run_once: True when: - kolla_action == "upgrade" - - service.enabled | bool - inventory_hostname == groups[service.group][-1] diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml index 49bfe6bec8..c4020b96c8 100644 --- a/ansible/roles/keystone/tasks/config.yml +++ b/ansible/roles/keystone/tasks/config.yml @@ -39,16 +39,13 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: keystone_config_jsons become: true with_dict: "{{ keystone_services }}" when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool notify: - - Restart keystone container - - Restart keystone-ssh container - - Restart keystone-fernet container + - Restart {{ item.key }} container - name: Copying over keystone.conf vars: @@ -63,15 +60,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/keystone.conf" mode: "0660" become: true - register: keystone_confs with_dict: "{{ keystone_services }}" when: - inventory_hostname in groups[item.value.group] - item.key in [ "keystone", "keystone-fernet" ] - item.value.enabled | bool notify: - - Restart keystone container - - Restart keystone-fernet container + - Restart {{ item.key }} container - name: Create Keystone domain-specific config directory vars: @@ -114,7 +109,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ keystone_policy_file }}" mode: "0660" become: true - register: keystone_policy_overwriting when: - inventory_hostname in groups[item.value.group] - item.key in [ "keystone", "keystone-fernet" ] @@ -122,8 +116,7 @@ - keystone_policy_file is defined with_dict: "{{ keystone_services }}" notify: - - Restart keystone container - - Restart keystone-fernet container + - Restart {{ item.key }} container - name: Copying over wsgi-keystone.conf vars: @@ -133,7 +126,6 @@ dest: "{{ node_config_directory }}/keystone/wsgi-keystone.conf" mode: "0660" become: true - register: keystone_wsgi when: - inventory_hostname in groups[keystone.group] - keystone.enabled | bool @@ -161,7 +153,6 @@ dest: "{{ node_config_directory }}/keystone/keystone-paste.ini" mode: "0660" become: true - register: keystone_paste_ini when: - inventory_hostname in groups[keystone.group] - keystone.enabled | bool @@ -194,7 +185,6 @@ dest: "{{ node_config_directory }}/keystone-fernet/{{ item.dest }}" mode: "0660" become: true - register: keystone_fernet_confs ignore_errors: "{{ ansible_check_mode }}" with_items: - { src: "crontab.j2", dest: "crontab" } @@ -216,7 +206,6 @@ dest: "{{ node_config_directory }}/keystone-ssh/{{ item.dest }}" mode: "0660" become: true - register: keystone_ssh_confs with_items: - { src: "sshd_config.j2", dest: "sshd_config" } - { src: "id_rsa.pub", dest: "id_rsa.pub" } @@ -239,9 +228,6 @@ - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool - register: check_keystone_containers with_dict: "{{ keystone_services }}" notify: - - Restart keystone container - - Restart keystone-ssh container - - Restart keystone-fernet container + - Restart {{ item.key }} container diff --git a/ansible/roles/kibana/handlers/main.yml b/ansible/roles/kibana/handlers/main.yml index 97def7aab2..5a2b7960ba 100644 --- a/ansible/roles/kibana/handlers/main.yml +++ b/ansible/roles/kibana/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "kibana" service: "{{ kibana_services[service_name] }}" - config_json: "{{ kibana_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - kibana_container: "{{ check_kibana_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,8 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or kibana_conf.changed | bool - or kibana_container.changed | bool diff --git a/ansible/roles/kibana/tasks/config.yml b/ansible/roles/kibana/tasks/config.yml index 11000f0af8..84bc175e43 100644 --- a/ansible/roles/kibana/tasks/config.yml +++ b/ansible/roles/kibana/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: kibana_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -34,7 +33,6 @@ dest: "{{ node_config_directory }}/kibana/kibana.yml" mode: "0660" become: true - register: kibana_conf with_first_found: - "{{ node_custom_config }}/kibana/{{ inventory_hostname }}/kibana.yml" - "{{ node_custom_config }}/kibana/kibana.yml" @@ -54,7 +52,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_kibana_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/kuryr/handlers/main.yml b/ansible/roles/kuryr/handlers/main.yml index f9dc1c8751..76d79ab28b 100644 --- a/ansible/roles/kuryr/handlers/main.yml +++ b/ansible/roles/kuryr/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "kuryr" service: "{{ kuryr_services[service_name] }}" - config_json: "{{ kuryr_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - kuryr_conf: "{{ kuryr_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ kuryr_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - kuryr_container: "{{ check_kuryr_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -19,10 +15,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or kuryr_conf.changed | bool - or kuryr_spec.changed | bool - or policy_overwriting.changed | bool - or kuryr_container.changed | bool diff --git a/ansible/roles/kuryr/tasks/config.yml b/ansible/roles/kuryr/tasks/config.yml index adffced301..67ce6b74b6 100644 --- a/ansible/roles/kuryr/tasks/config.yml +++ b/ansible/roles/kuryr/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: kuryr_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -56,7 +55,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/kuryr.conf" mode: "0660" become: true - register: kuryr_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -72,7 +70,6 @@ dest: "{{ node_config_directory }}/{{ item }}/kuryr.spec" mode: "0660" become: true - register: kuryr_spec when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -87,7 +84,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ kuryr_policy_file }}" mode: "0660" become: true - register: kuryr_policy_overwriting when: - kuryr_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -107,7 +103,6 @@ cap_add: "{{ item.value.cap_add }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_kuryr_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/magnum/handlers/main.yml b/ansible/roles/magnum/handlers/main.yml index 82205c44a8..1fd190f17d 100644 --- a/ansible/roles/magnum/handlers/main.yml +++ b/ansible/roles/magnum/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "magnum-api" service: "{{ magnum_services[service_name] }}" - config_json: "{{ magnum_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - magnum_conf: "{{ magnum_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ magnum_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - magnum_api_container: "{{ check_magnum_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -18,21 +14,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or magnum_conf.changed | bool - or policy_overwriting.changed | bool - or magnum_api_container.changed | bool - name: Restart magnum-conductor container vars: service_name: "magnum-conductor" service: "{{ magnum_services[service_name] }}" - config_json: "{{ magnum_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - magnum_conf: "{{ magnum_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ magnum_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - magnum_conductor_container: "{{ check_magnum_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -44,9 +30,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or magnum_conf.changed | bool - or policy_overwriting.changed | bool - or magnum_conductor_container.changed | bool diff --git a/ansible/roles/magnum/tasks/config.yml b/ansible/roles/magnum/tasks/config.yml index a8d1aadec7..6deee91196 100644 --- a/ansible/roles/magnum/tasks/config.yml +++ b/ansible/roles/magnum/tasks/config.yml @@ -35,14 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: magnum_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ magnum_services }}" notify: - - Restart magnum-api container - - Restart magnum-conductor container + - Restart {{ item.key }} container - name: Copying over magnum.conf vars: @@ -57,14 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/magnum.conf" mode: "0660" become: true - register: magnum_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ magnum_services }}" notify: - - Restart magnum-api container - - Restart magnum-conductor container + - Restart {{ item.key }} container - name: Copying over existing policy file template: @@ -72,15 +68,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ magnum_policy_file }}" mode: "0660" become: true - register: magnum_policy_overwriting when: - magnum_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ magnum_services }}" notify: - - Restart magnum-api container - - Restart magnum-conductor container + - Restart {{ item.key }} container - name: Check magnum containers become: true @@ -92,12 +86,10 @@ volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" environment: "{{ item.value.environment }}" - register: check_magnum_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ magnum_services }}" notify: - - Restart magnum-api container - - Restart magnum-conductor container + - Restart {{ item.key }} container diff --git a/ansible/roles/manila/handlers/main.yml b/ansible/roles/manila/handlers/main.yml index 17f03b88e0..da4ec8615f 100644 --- a/ansible/roles/manila/handlers/main.yml +++ b/ansible/roles/manila/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "manila-api" service: "{{ manila_services[service_name] }}" - config_json: "{{ manila_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_conf: "{{ manila_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ manila_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_api_container: "{{ check_manila_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or manila_conf.changed | bool - or policy_overwriting.changed | bool - or manila_api_container.changed | bool - name: Restart manila-data container vars: service_name: "manila-data" service: "{{ manila_services[service_name] }}" - config_json: "{{ manila_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_conf: "{{ manila_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ manila_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_data_container: "{{ check_manila_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,21 +29,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or manila_conf.changed | bool - or policy_overwriting.changed | bool - or manila_data_container.changed | bool - name: Restart manila-scheduler container vars: service_name: "manila-scheduler" service: "{{ manila_services[service_name] }}" - config_json: "{{ manila_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_conf: "{{ manila_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ manila_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_scheduler_container: "{{ check_manila_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -68,20 +44,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or manila_conf.changed | bool - or policy_overwriting.changed | bool - or manila_scheduler_container.changed | bool - name: Restart manila-share container vars: service_name: "manila-share" service: "{{ manila_services[service_name] }}" - config_json: "{{ manila_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ manila_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - manila_share_container: "{{ check_manila_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -94,9 +61,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or manila_conf_share.changed | bool - or policy_overwriting.changed | bool - or manila_share_container.changed | bool diff --git a/ansible/roles/manila/tasks/ceph.yml b/ansible/roles/manila/tasks/ceph.yml index 1deaf6b0c0..dc02f7e589 100644 --- a/ansible/roles/manila/tasks/ceph.yml +++ b/ansible/roles/manila/tasks/ceph.yml @@ -8,6 +8,8 @@ dest: "{{ node_config_directory }}/manila-share/ceph.conf" mode: "0660" become: true + notify: + - Restart manila-share container - name: Pulling cephx keyring for manila become: true @@ -26,3 +28,5 @@ dest: "{{ node_config_directory }}/manila-share/ceph.client.manila.keyring" mode: "0600" become: true + notify: + - Restart manila-share container diff --git a/ansible/roles/manila/tasks/config.yml b/ansible/roles/manila/tasks/config.yml index dc22c9a8b4..127ee82815 100644 --- a/ansible/roles/manila/tasks/config.yml +++ b/ansible/roles/manila/tasks/config.yml @@ -49,7 +49,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: manila_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -70,16 +69,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/manila.conf" mode: "0660" become: true - register: manila_confs when: - item.key in [ "manila-api", "manila-data", "manila-scheduler" ] - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ manila_services }}" notify: - - Restart manila-api container - - Restart manila-data container - - Restart manila-scheduler container + - Restart {{ item.key }} container - name: Copying over manila-share.conf vars: @@ -97,7 +93,6 @@ dest: "{{ node_config_directory }}/{{ item }}/manila.conf" mode: "0660" become: true - register: manila_conf_share when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -111,7 +106,6 @@ src: "{{ manila_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ manila_policy_file }}" mode: "0660" - register: manila_policy_overwriting when: - manila_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -130,7 +124,6 @@ privileged: "{{ item.value.privileged|default(False) }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_manila_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/memcached/handlers/main.yml b/ansible/roles/memcached/handlers/main.yml index f9c470e092..b76466d620 100644 --- a/ansible/roles/memcached/handlers/main.yml +++ b/ansible/roles/memcached/handlers/main.yml @@ -12,7 +12,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - memcached_config_json.changed | bool - or check_memcached_container.changed | bool diff --git a/ansible/roles/memcached/tasks/config.yml b/ansible/roles/memcached/tasks/config.yml index 27e56118d2..153d933b48 100644 --- a/ansible/roles/memcached/tasks/config.yml +++ b/ansible/roles/memcached/tasks/config.yml @@ -11,14 +11,18 @@ - "memcached" - name: Copying over config.json files for services + vars: + service: "{{ memcached_services.memcached }}" template: src: "{{ item }}.json.j2" dest: "{{ node_config_directory }}/{{ item }}/config.json" mode: "0660" - register: memcached_config_json become: true with_items: - "memcached" + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool notify: Restart memcached container - name: Check memcached container @@ -32,9 +36,8 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" dimensions: "{{ service.dimensions }}" - register: check_memcached_container when: + - kolla_action != "config" - inventory_hostname in groups[service.group] - service.enabled | bool - - kolla_action != "config" notify: Restart memcached container diff --git a/ansible/roles/mistral/handlers/main.yml b/ansible/roles/mistral/handlers/main.yml index a5ab566546..a9e0ce810a 100644 --- a/ansible/roles/mistral/handlers/main.yml +++ b/ansible/roles/mistral/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "mistral-api" service: "{{ mistral_services[service_name] }}" - config_json: "{{ mistral_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_conf: "{{ mistral_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ mistral_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_api_container: "{{ check_mistral_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or mistral_conf.changed | bool - or policy_overwriting.changed | bool - or mistral_api_container.changed | bool - name: Restart mistral-engine container vars: service_name: "mistral-engine" service: "{{ mistral_services[service_name] }}" - config_json: "{{ mistral_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_conf: "{{ mistral_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ mistral_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_engine_container: "{{ check_mistral_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or mistral_conf.changed | bool - or policy_overwriting.changed | bool - or mistral_engine_container.changed | bool - name: Restart mistral-event-engine container vars: service_name: "mistral-event-engine" service: "{{ mistral_services[service_name] }}" - config_json: "{{ mistral_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_conf: "{{ mistral_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ mistral_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_event_engine_container: "{{ check_mistral_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -67,22 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or mistral_conf.changed | bool - or policy_overwriting.changed | bool - or mistral_event_definitions_confs.changed | bool - or mistral_event_engine_container.changed | bool - name: Restart mistral-executor container vars: service_name: "mistral-executor" service: "{{ mistral_services[service_name] }}" - config_json: "{{ mistral_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_conf: "{{ mistral_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ mistral_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - mistral_executor_container: "{{ check_mistral_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -93,9 +58,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or mistral_conf.changed | bool - or policy_overwriting.changed | bool - or mistral_executor_container.changed | bool diff --git a/ansible/roles/mistral/tasks/config.yml b/ansible/roles/mistral/tasks/config.yml index 42dc00c410..a8d0784eae 100644 --- a/ansible/roles/mistral/tasks/config.yml +++ b/ansible/roles/mistral/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: mistral_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -56,7 +55,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/mistral.conf" mode: "0660" become: true - register: mistral_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -70,7 +68,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ mistral_policy_file }}" mode: "0660" become: true - register: mistral_policy_overwriting when: - mistral_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -87,7 +84,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/mistral-event-engine/event_definitions.yaml" mode: "0660" - register: mistral_event_definitions_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -107,7 +103,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_mistral_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/monasca/handlers/main.yml b/ansible/roles/monasca/handlers/main.yml index 50c19637e8..fa1e811d5b 100644 --- a/ansible/roles/monasca/handlers/main.yml +++ b/ansible/roles/monasca/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "monasca-api" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_api_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,19 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_api_confs.changed | bool - or monasca_api_wsgi_confs.changed | bool - or monasca_api_container.changed | bool - name: Restart monasca-log-api container vars: service_name: "monasca-log-api" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_log_api_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -38,19 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_log_api_confs.changed | bool - or monasca_log_api_wsgi_confs.changed | bool - or monasca_log_api_container.changed | bool - name: Restart monasca-log-transformer container vars: service_name: "monasca-log-transformer" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_log_transformer_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -61,18 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_log_transformer_confs.changed | bool - or monasca_log_transformer_container.changed | bool - name: Restart monasca-log-persister container vars: service_name: "monasca-log-persister" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_log_persister_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -83,19 +58,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_log_persister_confs.changed | bool - or monasca_log_persister_elasticsearch_template.changed | bool - or monasca_log_persister_container.changed | bool - name: Restart monasca-log-metrics container vars: service_name: "monasca-log-metrics" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_log_metrics_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -106,18 +73,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_log_metrics_confs.changed | bool - or monasca_log_metrics_container.changed | bool - name: Restart monasca-thresh container vars: service_name: "monasca-thresh" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_thresh_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -128,19 +88,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_thresh_confs.changed | bool - or monasca_thresh_storm_conf.changed | bool - or monasca_thresh_container.changed | bool - name: Restart monasca-notification container vars: service_name: "monasca-notification" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_notification_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -151,19 +103,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_notification_confs.changed | bool - or monasca_notification_plugin_templates.changed | bool - or monasca_notification_container.changed | bool - name: Restart monasca-persister container vars: service_name: "monasca-persister" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_persister_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -174,18 +118,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_persister_confs.changed | bool - or monasca_persister_container.changed | bool - name: Restart monasca-agent-collector container vars: service_name: "monasca-agent-collector" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_agent_collector_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -197,19 +134,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_agent_collector_confs.changed | bool - or monasca_agent_collector_plugin_confs.changed | bool - or monasca_agent_collector_container.changed | bool - name: Restart monasca-agent-forwarder container vars: service_name: "monasca-agent-forwarder" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_agent_forwarder_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -220,18 +149,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_agent_forwarder_confs.changed | bool - or monasca_agent_forwarder_container.changed | bool - name: Restart monasca-agent-statsd container vars: service_name: "monasca-agent-statsd" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_agent_statsd_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -242,18 +164,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_agent_statsd_confs.changed | bool - or monasca_agent_statsd_container.changed | bool - name: Restart monasca-grafana container vars: service_name: "monasca-grafana" service: "{{ monasca_services[service_name] }}" - config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - monasca_grafana_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -264,8 +179,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or monasca_grafana_confs.changed | bool - or monasca_grafana_container.changed | bool diff --git a/ansible/roles/monasca/tasks/config.yml b/ansible/roles/monasca/tasks/config.yml index 1bce0f5328..e047089060 100644 --- a/ansible/roles/monasca/tasks/config.yml +++ b/ansible/roles/monasca/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: monasca_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -37,7 +36,6 @@ dest: "{{ node_config_directory }}/monasca-agent-collector/{{ item }}" mode: "0660" become: true - register: monasca_agent_collector_confs with_items: - agent-collector.yml when: @@ -78,7 +76,6 @@ dest: "{{ node_config_directory }}/monasca-agent-collector/plugins/{{ item.path | basename }}" mode: "0660" become: true - register: monasca_agent_collector_plugin_confs with_items: "{{ agent_plugins.files }}" when: @@ -98,7 +95,6 @@ dest: "{{ node_config_directory }}/monasca-agent-forwarder/{{ item }}" mode: "0660" become: true - register: monasca_agent_forwarder_confs with_items: - agent-forwarder.yml when: @@ -118,7 +114,6 @@ dest: "{{ node_config_directory }}/monasca-agent-statsd/{{ item }}" mode: "0660" become: true - register: monasca_agent_statsd_confs with_items: - agent-statsd.yml when: @@ -138,7 +133,6 @@ dest: "{{ node_config_directory }}/monasca-api/{{ item }}" mode: "0660" become: true - register: monasca_api_confs with_items: - api.conf - api-config.ini @@ -156,7 +150,6 @@ dest: "{{ node_config_directory }}/monasca-api/wsgi-api.conf" mode: "0660" become: true - register: monasca_api_wsgi_confs when: - inventory_hostname in groups[service['group']] - service.enabled | bool @@ -174,7 +167,6 @@ dest: "{{ node_config_directory }}/monasca-log-api/{{ item }}" mode: "0660" become: true - register: monasca_log_api_confs with_items: - log-api.conf - log-api-paste.ini @@ -192,7 +184,6 @@ dest: "{{ node_config_directory }}/monasca-log-api/wsgi-log-api.conf" mode: "0660" become: true - register: monasca_log_api_wsgi_confs when: - inventory_hostname in groups[service['group']] - service.enabled | bool @@ -207,7 +198,6 @@ dest: "{{ node_config_directory }}/monasca-log-transformer/log-transformer.conf" mode: "0660" become: true - register: monasca_log_transformer_confs with_first_found: - "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/log-transformer.conf" - "{{ node_custom_config }}/monasca/log-transformer.conf" @@ -226,7 +216,6 @@ dest: "{{ node_config_directory }}/monasca-log-persister/log-persister.conf" mode: "0660" become: true - register: monasca_log_persister_confs with_first_found: - "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/log-persister.conf" - "{{ node_custom_config }}/monasca/log-persister.conf" @@ -245,7 +234,6 @@ dest: "{{ node_config_directory }}/monasca-log-persister/elasticsearch-template.json" mode: "0660" become: true - register: monasca_log_persister_elasticsearch_template with_first_found: - "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/elasticsearch-template.json" - "{{ node_custom_config }}/monasca/elasticsearch-template.json" @@ -264,7 +252,6 @@ dest: "{{ node_config_directory }}/monasca-log-metrics/log-metrics.conf" mode: "0660" become: true - register: monasca_log_metrics_confs with_first_found: - "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/log-metrics.conf" - "{{ node_custom_config }}/monasca/log-metrics.conf" @@ -286,7 +273,6 @@ dest: "{{ node_config_directory }}/monasca-thresh/thresh-config.yml" mode: "0660" become: true - register: monasca_thresh_confs with_first_found: - "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/thresh-config.yml" - "{{ node_custom_config }}/monasca/thresh-config.yml" @@ -305,7 +291,6 @@ dest: "{{ node_config_directory }}/monasca-thresh/storm.yml" mode: "0660" become: true - register: monasca_thresh_storm_conf with_first_found: - "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/storm.yml" - "{{ node_custom_config }}/monasca/storm.yml" @@ -327,7 +312,6 @@ dest: "{{ node_config_directory }}/monasca-notification/{{ item }}" mode: "0660" become: true - register: monasca_notification_confs with_items: - notification.conf when: @@ -349,7 +333,6 @@ dest: "{{ node_config_directory }}/monasca-notification/" mode: "0660" become: true - register: monasca_notification_plugin_templates when: - notification_templates.stat.exists and notification_templates.stat.isdir - inventory_hostname in groups[service['group']] @@ -368,7 +351,6 @@ dest: "{{ node_config_directory }}/monasca-persister/{{ item }}" mode: "0660" become: true - register: monasca_persister_confs with_items: - persister.conf when: @@ -388,7 +370,6 @@ dest: "{{ node_config_directory }}/monasca-grafana/{{ item }}" mode: "0660" become: true - register: monasca_grafana_confs with_items: - grafana.ini when: @@ -407,7 +388,6 @@ pid_mode: "{{ item.value.pid_mode|default('') }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_monasca_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/mongodb/handlers/main.yml b/ansible/roles/mongodb/handlers/main.yml index ee5f442231..66fbd48187 100644 --- a/ansible/roles/mongodb/handlers/main.yml +++ b/ansible/roles/mongodb/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "mongodb" service: "{{ mongodb_services[service_name] }}" - config_json: "{{ mongodb_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - mongodb_conf: "{{ mongodb_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - mongodb_container: "{{ check_mongodb_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,11 +14,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or mongodb_conf.changed | bool - or mongodb_container.changed | bool notify: - Waiting for the mongodb startup - Checking current replication status diff --git a/ansible/roles/mongodb/tasks/config.yml b/ansible/roles/mongodb/tasks/config.yml index 2c9b1d82f4..6506d954de 100644 --- a/ansible/roles/mongodb/tasks/config.yml +++ b/ansible/roles/mongodb/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: mongodb_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -36,7 +35,6 @@ dest: "{{ node_config_directory }}/mongodb/{{ item.key }}.conf" mode: "0660" become: true - register: mongodb_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -54,7 +52,6 @@ privileged: "{{ item.value.privileged|default(False) }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_mongodb_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/multipathd/handlers/main.yml b/ansible/roles/multipathd/handlers/main.yml index 2f71142d54..b3304fe843 100644 --- a/ansible/roles/multipathd/handlers/main.yml +++ b/ansible/roles/multipathd/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "multipathd" service: "{{ multipathd_services[service_name] }}" - config_json: "{{ multipathd_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - multipathd_conf: "{{ multipathd_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - multipathd_container: "{{ check_multipathd_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,8 +14,3 @@ volumes: "{{ service.volumes|reject('equalto', '')|list }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or multipathd_conf.changed | bool - or multipathd_container.changed | bool diff --git a/ansible/roles/multipathd/tasks/config.yml b/ansible/roles/multipathd/tasks/config.yml index 3e43c0514e..79aca0856e 100644 --- a/ansible/roles/multipathd/tasks/config.yml +++ b/ansible/roles/multipathd/tasks/config.yml @@ -25,7 +25,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: multipathd_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -39,7 +38,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/multipath.conf" mode: "0660" become: true - register: multipathd_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -57,7 +55,6 @@ ipc_mode: "{{ item.value.ipc_mode }}" privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes }}" - register: check_multipathd_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/murano/handlers/main.yml b/ansible/roles/murano/handlers/main.yml index 3520ce6bba..c9eb955f45 100644 --- a/ansible/roles/murano/handlers/main.yml +++ b/ansible/roles/murano/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "murano-api" service: "{{ murano_services[service_name] }}" - config_json: "{{ murano_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - murano_conf: "{{ murano_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ murano_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - murano_api_container: "{{ check_murano_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or murano_conf.changed | bool - or policy_overwriting.changed | bool - or murano_api_container.changed | bool - name: Restart murano-engine container vars: service_name: "murano-engine" service: "{{ murano_services[service_name] }}" - config_json: "{{ murano_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - murano_conf: "{{ murano_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ murano_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - murano_conductor_container: "{{ check_murano_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,9 +29,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or murano_conf.changed | bool - or policy_overwriting.changed | bool - or murano_conductor_container.changed | bool diff --git a/ansible/roles/murano/tasks/config.yml b/ansible/roles/murano/tasks/config.yml index ad6bf26231..5f94099279 100644 --- a/ansible/roles/murano/tasks/config.yml +++ b/ansible/roles/murano/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: murano_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -56,7 +55,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/murano.conf" mode: "0660" become: true - register: murano_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -69,7 +67,6 @@ src: "{{ murano_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ murano_policy_file }}" mode: "0660" - register: murano_policy_overwriting when: - murano_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -87,7 +84,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_murano_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/neutron/handlers/main.yml b/ansible/roles/neutron/handlers/main.yml index f46a24e08b..b3748279f3 100644 --- a/ansible/roles/neutron/handlers/main.yml +++ b/ansible/roles/neutron/handlers/main.yml @@ -3,12 +3,6 @@ vars: service_name: "neutron-server" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_vpnaas_conf: "{{ neutron_vpnaas_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_server_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -20,25 +14,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_vpnaas_conf is changed - or neutron_ml2_conf is changed - or nsx_ini is changed - or policy_json is changed - or neutron_server_container is changed - name: Restart neutron-openvswitch-agent container vars: service_name: "neutron-openvswitch-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_openvswitch_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -50,23 +30,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_ml2_conf is changed - or policy_json is changed - or neutron_openvswitch_agent_container is changed - name: Restart neutron-openvswitch-agent-xenapi container vars: service_name: "neutron-openvswitch-agent-xenapi" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_xenapi_conf: "{{ neutron_ml2_xenapi_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_openvswitch_agent_xenapi_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -78,23 +46,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_ml2_xenapi_conf is changed - or policy_json is changed - or neutron_openvswitch_agent_xenapi_container is changed - name: Restart fake neutron-openvswitch-agent container vars: service_name: "neutron-openvswitch-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_openvswitch_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -107,23 +63,11 @@ with_sequence: "start=1 end={{ num_nova_fake_per_node }}" when: - kolla_action != "config" - - enable_nova_fake | bool - - neutron_plugin_agent == "openvswitch" - - inventory_hostname in groups["compute"] - - fake_config_json is changed - or fake_neutron_conf is changed - or fake_neutron_ml2_conf_ini is changed - or check_fake_neutron_openvswitch_agent is changed - name: Restart neutron-linuxbridge-agent container vars: service_name: "neutron-linuxbridge-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_linuxbridge_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -136,22 +80,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_ml2_conf is changed - or policy_json is changed - or neutron_linuxbridge_agent_container is changed - name: Restart neutron-dhcp-agent container vars: service_name: "neutron-dhcp-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_dhcp_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -163,27 +96,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or dhcp_agent_ini is changed - or dnsmasq_conf is changed - or policy_json is changed - or neutron_dhcp_agent_container is changed - name: Restart neutron-l3-agent container vars: service_name: "neutron-l3-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_l3_agent_ini: "{{ neutron_l3_agent_inis.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_fwaas_driver_ini: "{{ neutron_fwaas_driver_inis.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_vpnaas_conf: "{{ neutron_vpnaas_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_l3_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -195,25 +112,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_l3_agent_ini is changed - or neutron_fwaas_driver_ini is changed - or neutron_vpnaas_conf is changed - or policy_json is changed - or neutron_l3_agent_wrapper is changed - or neutron_l3_agent_container is changed - name: Restart neutron-sriov-agent container vars: service_name: "neutron-sriov-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_sriov_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -225,22 +128,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_sriov_agent_ini is changed - or policy_json is changed - or neutron_sriov_agent_container is changed - name: Restart neutron-metadata-agent container vars: service_name: "neutron-metadata-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_metadata_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -252,22 +144,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_metadata_agent_ini is changed - or policy_json is changed - or neutron_metadata_agent_container is changed - name: Restart neutron-bgp-dragent container vars: service_name: "neutron-bgp-dragent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_bgp_dragent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -279,22 +160,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_bgp_dragent_ini is changed - or policy_json is changed - or neutron_bgp_dragent_container is changed - name: Restart neutron-infoblox-ipam-agent container vars: service_name: "neutron-infoblox-ipam-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_infoblox_ipam_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -306,20 +176,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_ml2_conf is changed - or neutron_infoblox_ipam_agent_container is changed - name: Restart neutron-metering-agent container vars: service_name: "neutron-metering-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_metering_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -331,21 +192,11 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or neutron_metering_agent_ini is changed - or neutron_metering_agent_container is changed - name: Restart ironic-neutron-agent container vars: service_name: "ironic-neutron-agent" service: "{{ neutron_services[service_name] }}" - config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ironic_neutron_agent_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -357,9 +208,3 @@ privileged: "{{ service.privileged | default(False) }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or neutron_conf is changed - or ironic_neutron_agent_ini is changed - or ironic_neutron_agent_container is changed diff --git a/ansible/roles/neutron/tasks/config-neutron-fake.yml b/ansible/roles/neutron/tasks/config-neutron-fake.yml index 322d6d13b4..08f82c705b 100644 --- a/ansible/roles/neutron/tasks/config-neutron-fake.yml +++ b/ansible/roles/neutron/tasks/config-neutron-fake.yml @@ -15,11 +15,12 @@ src: "neutron-openvswitch-agent.json.j2" dest: "{{ node_config_directory }}/neutron-openvswitch-agent-fake-{{ item }}/config.json" mode: "0660" - register: fake_config_json with_sequence: start=1 end={{ num_nova_fake_per_node }} when: - inventory_hostname in groups['compute'] - neutron_plugin_agent == "openvswitch" + notify: + - Restart fake neutron-openvswitch-agent container - name: Copying over neutron.conf become: true @@ -34,11 +35,12 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron.conf" dest: "{{ node_config_directory }}/neutron-openvswitch-agent-fake-{{ item }}/neutron.conf" mode: "0660" - register: fake_neutron_conf with_sequence: start=1 end={{ num_nova_fake_per_node }} when: - inventory_hostname in groups['compute'] - neutron_plugin_agent == "openvswitch" + notify: + - Restart fake neutron-openvswitch-agent container - name: Copying over ml2_conf.ini become: true @@ -51,11 +53,12 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron.conf" dest: "{{ node_config_directory }}/neutron-openvswitch-agent-fake-{{ item }}/ml2_conf.ini" mode: "0660" - register: fake_neutron_ml2_conf_ini with_sequence: start=1 end={{ num_nova_fake_per_node }} when: - inventory_hostname in groups['compute'] - neutron_plugin_agent == "openvswitch" + notify: + - Restart fake neutron-openvswitch-agent container - name: Checking neutron-openvswitch-agent container for nova fake node vars: @@ -68,7 +71,6 @@ image: "{{ neutron_openvswitch_agent.image }}" privileged: "{{ neutron_openvswitch_agent.privileged | default(False) }}" volumes: "{{ neutron_openvswitch_agent.volumes }}" - register: check_fake_neutron_openvswitch_agent when: - kolla_action != "config" - enable_nova_fake | bool diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml index 93469f968e..c001e3806c 100644 --- a/ansible/roles/neutron/tasks/config.yml +++ b/ansible/roles/neutron/tasks/config.yml @@ -37,7 +37,6 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: neutron_config_jsons when: - item.value.enabled | bool - item.value.host_in_groups | bool @@ -71,7 +70,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron.conf" dest: "{{ node_config_directory }}/{{ item.key }}/neutron.conf" mode: "0660" - register: neutron_confs when: - item.value.enabled | bool - item.value.host_in_groups | bool @@ -94,7 +92,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron_vpnaas.conf" dest: "{{ node_config_directory }}/{{ item.key }}/neutron_vpnaas.conf" mode: "0660" - register: neutron_vpnaas_confs when: - item.value.enabled | bool - item.value.host_in_groups | bool @@ -119,7 +116,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/ml2_conf.ini" dest: "{{ node_config_directory }}/{{ service_name }}/ml2_conf.ini" mode: "0660" - register: neutron_ml2_confs when: - item.key in services_need_ml2_conf_ini - item.value.enabled | bool @@ -144,7 +140,6 @@ - "{{ node_custom_config }}/neutron/{{ service_name }}/ml2_conf.ini" dest: "{{ node_config_directory }}/{{ service_name }}/ml2_conf.ini" mode: "0660" - register: neutron_ml2_xenapi_confs when: - item.key in services_need_ml2_conf_ini - item.value.enabled | bool @@ -164,7 +159,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/sriov_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/sriov_agent.ini" mode: "0660" - register: neutron_sriov_agent_ini when: - neutron_sriov_agent.enabled | bool - neutron_sriov_agent.host_in_groups | bool @@ -183,7 +177,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/dhcp_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/dhcp_agent.ini" mode: "0660" - register: dhcp_agent_ini when: - neutron_dhcp_agent.enabled | bool - neutron_dhcp_agent.host_in_groups | bool @@ -199,7 +192,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/{{ service_name }}/dnsmasq.conf" mode: "0660" - register: dnsmasq_conf with_first_found: - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/dnsmasq.conf" - "{{ node_custom_config }}/neutron/dnsmasq.conf" @@ -223,7 +215,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/l3_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/l3_agent.ini" mode: "0660" - register: neutron_l3_agent_inis when: - item.key in services_need_l3_agent_ini - item.value.enabled | bool @@ -245,7 +236,6 @@ - "{{ node_custom_config }}/neutron/fwaas_driver.ini" dest: "{{ node_config_directory }}/{{ service_name }}/fwaas_driver.ini" mode: "0660" - register: neutron_fwaas_driver_inis when: - item.key in services_need_fwaas_driver_ini - item.value.enabled | bool @@ -265,7 +255,6 @@ - "{{ node_custom_config }}/neutron/metadata_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/metadata_agent.ini" mode: "0660" - register: neutron_metadata_agent_ini when: - neutron_metadata_agent.enabled | bool - neutron_metadata_agent.host_in_groups | bool @@ -283,7 +272,6 @@ - "{{ node_custom_config }}/neutron/metering_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/metering_agent.ini" mode: "0660" - register: neutron_metering_agent_ini when: - neutron_metering_agent.enabled | bool - neutron_metering_agent.host_in_groups | bool @@ -301,7 +289,6 @@ - "{{ node_custom_config }}/neutron/ironic_neutron_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/ironic_neutron_agent.ini" mode: "0660" - register: ironic_neutron_agent_ini when: - ironic_neutron_agent.enabled | bool - ironic_neutron_agent.host_in_groups | bool @@ -319,7 +306,6 @@ - "{{ node_custom_config }}/neutron/bgp_dragent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/bgp_dragent.ini" mode: "0660" - register: neutron_bgp_dragent_ini when: - neutron_bgp_dragent.enabled | bool - neutron_bgp_dragent.host_in_groups | bool @@ -342,7 +328,6 @@ - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/nsx.ini" dest: "{{ node_config_directory }}/{{ service_name }}/nsx.ini" mode: "0660" - register: nsx_ini when: - neutron_server.enabled | bool - neutron_server.host_in_groups | bool @@ -369,7 +354,6 @@ src: "{{ node_custom_config }}/neutron/policy.json" dest: "{{ node_config_directory }}/{{ service_name }}/policy.json" mode: "0660" - register: policy_jsons when: - neutron_policy.stat.exists - item.value.enabled | bool @@ -387,7 +371,6 @@ src: neutron-l3-agent-wrapper.sh.j2 dest: "{{ node_config_directory }}/{{ service_name }}/neutron-l3-agent-wrapper.sh" mode: "0770" - register: neutron_l3_agent_wrapper when: - service.enabled | bool - service.host_in_groups | bool @@ -406,7 +389,6 @@ src: "{{ item.2.path }}" dest: "{{ node_config_directory }}/{{ service_name }}/{{ item.2.path | basename }}" mode: "0660" - register: extra_ml2_plugins when: - item.2 is defined - item.1.enabled | bool @@ -429,7 +411,6 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_neutron_containers when: - kolla_action != "config" - item.value.enabled | bool diff --git a/ansible/roles/nova/handlers/main.yml b/ansible/roles/nova/handlers/main.yml index 93ad91a15c..6715d4812d 100644 --- a/ansible/roles/nova/handlers/main.yml +++ b/ansible/roles/nova/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "nova-conductor" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conductor_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -18,19 +14,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_conductor_container.changed | bool - name: Restart nova-ssh container vars: service_name: "nova-ssh" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_ssh_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,19 +31,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_ssh_confs.changed | bool - or nova_ssh_container.changed | bool - name: Restart nova-libvirt container vars: service_name: "nova-libvirt" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceph_conf: "{{ ceph_confs.results|selectattr('item', 'equalto', service_name)|first if ceph_confs is defined else none }}" - nova_libvirt_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -73,24 +53,11 @@ until: restart_nova_libvirt is success when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_libvirt_confs.changed | bool - or nova_libvirt_container.changed | bool - or ( ceph_conf is not none and ceph_conf.changed | bool ) - or ( nova_ceph_keyring is defined and nova_ceph_keyring.changed | bool ) - or ( libvirt_secrets_xml is defined and libvirt_secrets_xml.changed | bool ) - or ( libvirt_secrets_key is defined and libvirt_secrets_key.changed | bool ) - name: Restart nova-scheduler container vars: service_name: "nova-scheduler" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_scheduler_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -102,21 +69,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_scheduler_container.changed | bool - name: Restart nova-novncproxy container vars: service_name: "nova-novncproxy" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_novncproxy_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -128,21 +85,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_novncproxy_container.changed | bool - name: Restart nova-spicehtml5proxy container vars: service_name: "nova-spicehtml5proxy" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_spicehtml5proxy_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -154,21 +101,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_spicehtml5proxy_container.changed | bool - name: Restart nova-serialproxy container vars: service_name: "nova-serialproxy" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_serialproxy_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -180,21 +117,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_serialproxy_container.changed | bool - name: Restart nova-api container vars: service_name: "nova-api" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_api_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -206,22 +133,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_api_container.changed | bool - name: Restart nova-compute container vars: service_name: "nova-compute" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - ceph_conf: "{{ ceph_confs.results|selectattr('item', 'equalto', service_name)|first if ceph_confs is defined else none }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_compute_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -235,25 +151,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or vcenter_ca_file | bool - or nova_compute_release_file | bool - or nova_compute_container.changed | bool - or ( ceph_conf is not none and ceph_conf.changed | bool ) - or ( nova_ceph_keyring is defined and nova_ceph_keyring.changed | bool ) - name: Restart nova-compute-ironic container vars: service_name: "nova-compute-ironic" service: "{{ nova_services[service_name] }}" - config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - nova_compute_ironic_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -265,12 +167,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or nova_conf.changed | bool - or policy_overwriting.changed | bool - or nova_compute_ironic_container.changed | bool # nova-compute-fake is special. It will start multi numbers of container # so put all variables here rather than defaults/main.yml file @@ -291,8 +187,6 @@ with_sequence: start=1 end={{ num_nova_fake_per_node }} when: - kolla_action != "config" - - inventory_hostname in groups['compute'] - - enable_nova_fake | bool # NOTE(mgoddard): After upgrading nova-compute, services will have an RPC # version cap in place. We need to restart all services that communicate with diff --git a/ansible/roles/nova/tasks/ceph.yml b/ansible/roles/nova/tasks/ceph.yml index e4ee741840..322a85b27d 100644 --- a/ansible/roles/nova/tasks/ceph.yml +++ b/ansible/roles/nova/tasks/ceph.yml @@ -20,7 +20,6 @@ dest: "{{ node_config_directory }}/{{ item }}/ceph.conf" mode: "0660" become: true - register: ceph_confs with_items: - "nova-compute" - "nova-libvirt" @@ -66,6 +65,8 @@ mode: "0600" become: true when: inventory_hostname in groups['compute'] + notify: + - Restart nova-compute container - name: Pushing secrets xml for libvirt template: @@ -83,6 +84,8 @@ - uuid: "{{ cinder_rbd_secret_uuid }}" name: client.cinder secret enabled: "{{ enable_cinder | bool and cinder_backend_ceph | bool}}" + notify: + - Restart nova-libvirt container - name: Pushing secrets key for libvirt copy: @@ -100,6 +103,8 @@ - uuid: "{{ cinder_rbd_secret_uuid }}" content: "{{ cinder_cephx_raw_key.stdout|default('') }}" enabled: "{{ enable_cinder | bool and cinder_backend_ceph | bool}}" + notify: + - Restart nova-libvirt container - name: Ensuring config directory has correct owner and permission become: true diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml index a6af574928..043bf4bc77 100644 --- a/ansible/roles/nova/tasks/config.yml +++ b/ansible/roles/nova/tasks/config.yml @@ -62,7 +62,6 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -90,7 +89,6 @@ - "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf" dest: "{{ node_config_directory }}/{{ item.key }}/nova.conf" mode: "0660" - register: nova_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -107,7 +105,6 @@ src: "{{ item.src }}" dest: "{{ node_config_directory }}/nova-libvirt/{{ item.dest }}" mode: "0660" - register: nova_libvirt_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -125,7 +122,6 @@ src: "{{ item.src }}" dest: "{{ node_config_directory }}/nova-ssh/{{ item.dest }}" mode: "0660" - register: nova_ssh_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -144,7 +140,6 @@ src: "{{ node_custom_config }}/vmware_ca" dest: "{{ node_config_directory }}/nova-compute/vmware_ca" mode: "0660" - register: vcenter_ca_file when: - nova_compute_virt_type == "vmware" - not vmware_vcenter_insecure | bool @@ -166,7 +161,6 @@ - "{{ node_custom_config }}/nova_compute/release" - "{{ node_custom_config }}/nova/release" skip: true - register: nova_compute_release_file when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -189,7 +183,6 @@ src: "{{ nova_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ nova_policy_file }}" mode: "0660" - register: nova_policy_overwriting when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -213,7 +206,6 @@ privileged: "{{ item.value.privileged|default(False) }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_nova_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/nova/tasks/external_ceph.yml b/ansible/roles/nova/tasks/external_ceph.yml index a5e5eb3af6..fa1e80600c 100644 --- a/ansible/roles/nova/tasks/external_ceph.yml +++ b/ansible/roles/nova/tasks/external_ceph.yml @@ -34,7 +34,6 @@ dest: "{{ node_config_directory }}/{{ item }}/" mode: "0660" become: true - register: nova_ceph_keyring with_items: - nova-compute - nova-libvirt @@ -43,8 +42,7 @@ - nova_backend == "rbd" - external_ceph_cephx_enabled | bool notify: - - Restart nova-compute container - - Restart nova-libvirt container + - Restart {{ item }} container - name: Copy over ceph.conf template: @@ -52,7 +50,6 @@ dest: "{{ node_config_directory }}/{{ item }}/" mode: "0660" become: true - register: ceph_confs with_items: - nova-compute - nova-libvirt @@ -68,7 +65,6 @@ dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ item.uuid }}.xml" mode: "0600" become: true - register: libvirt_secrets_xml when: - inventory_hostname in groups['compute'] - item.enabled | bool @@ -106,7 +102,6 @@ dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ item.uuid }}.base64" mode: "0600" become: true - register: libvirt_secrets_key when: - inventory_hostname in groups['compute'] - item.enabled | bool diff --git a/ansible/roles/octavia/handlers/main.yml b/ansible/roles/octavia/handlers/main.yml index 44372f3506..4cec448f74 100644 --- a/ansible/roles/octavia/handlers/main.yml +++ b/ansible/roles/octavia/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "octavia-api" service: "{{ octavia_services[service_name] }}" - config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_api_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or octavia_conf.changed | bool - or policy_overwriting.changed | bool - or octavia_api_container.changed | bool - name: Restart octavia-health-manager container vars: service_name: "octavia-health-manager" service: "{{ octavia_services[service_name] }}" - config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_health_manager_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,22 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or octavia_conf.changed | bool - or policy_overwriting.changed | bool - or octavia_health_manager_certificate.changed | bool - or octavia_health_manager_container.changed | bool - name: Restart octavia-housekeeping container vars: service_name: "octavia-housekeeping" service: "{{ octavia_services[service_name] }}" - config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_housekeeping_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -68,22 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or octavia_conf.changed | bool - or policy_overwriting.changed | bool - or octavia_housekeeping_certificate.changed | bool - or octavia_housekeeping_container.changed | bool - name: Restart octavia-worker container vars: service_name: "octavia-worker" service: "{{ octavia_services[service_name] }}" - config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - octavia_worker_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -94,10 +58,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or octavia_conf.changed | bool - or policy_overwriting.changed | bool - or octavia_worker_certificate.changed | bool - or octavia_worker_container.changed | bool diff --git a/ansible/roles/octavia/tasks/config.yml b/ansible/roles/octavia/tasks/config.yml index b2b42a26fc..d0feb29f01 100644 --- a/ansible/roles/octavia/tasks/config.yml +++ b/ansible/roles/octavia/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ octavia_policy_file }}" mode: "0660" become: true - register: octavia_policy_overwriting when: - octavia_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -50,7 +49,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: octavia_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -71,7 +69,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/octavia.conf" mode: "0660" become: true - register: octavia_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -87,7 +84,6 @@ dest: "{{ node_config_directory }}/octavia-worker/{{ item }}" mode: "0660" become: true - register: octavia_worker_certificate when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -106,7 +102,6 @@ dest: "{{ node_config_directory }}/octavia-housekeeping/{{ item }}" mode: "0660" become: true - register: octavia_housekeeping_certificate when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -125,7 +120,6 @@ dest: "{{ node_config_directory }}/octavia-health-manager/{{ item }}" mode: "0660" become: true - register: octavia_health_manager_certificate when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -145,7 +139,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_octavia_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/opendaylight/handlers/main.yml b/ansible/roles/opendaylight/handlers/main.yml index 9163d51b63..0f3afd253c 100644 --- a/ansible/roles/opendaylight/handlers/main.yml +++ b/ansible/roles/opendaylight/handlers/main.yml @@ -15,21 +15,3 @@ tty: "{{ service.tty }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - opendaylight_config_json is changed - or opendaylight_config_start_odl is changed - or opendaylight_config_custom_props is changed - or opendaylight_config_jetty is changed - or opendaylight_config_features is changed - or opendaylight_config_ovsdb is changed - or opendaylight_config_tomcat is changed - or opendaylight_config_logging is changed - or opendaylight_config_netvirt is changed - or opendaylight_config_netvirt_acl is changed - or opendaylight_config_env is changed - or opendaylight_config_akka is changed - or opendaylight_config_modules is changed - or opendaylight_config_module_shards is changed - or opendaylight_config_10_rest_connector is changed - or check_opendaylight_containers is changed diff --git a/ansible/roles/opendaylight/tasks/config.yml b/ansible/roles/opendaylight/tasks/config.yml index a5147c1e71..02c5dc2f59 100644 --- a/ansible/roles/opendaylight/tasks/config.yml +++ b/ansible/roles/opendaylight/tasks/config.yml @@ -23,7 +23,6 @@ - "opendaylight" - name: Copying over config.json files for services - register: opendaylight_config_json template: src: "{{ item }}.json.j2" dest: "{{ node_config_directory }}/{{ item }}/config.json" @@ -35,7 +34,6 @@ - Restart opendaylight container - name: Copying over custom.properties - register: opendaylight_config_custom_props template: src: "{{ role_path }}/templates/custom.properties.j2" dest: "{{ node_config_directory }}/opendaylight/custom.properties" @@ -45,7 +43,6 @@ - Restart opendaylight container - name: Copying over start-odl - register: opendaylight_config_start_odl template: src: "{{ role_path }}/templates/start-odl.j2" dest: "{{ node_config_directory }}/opendaylight/start-odl" @@ -55,7 +52,6 @@ - Restart opendaylight container - name: Copying over jetty.xml - register: opendaylight_config_jetty template: src: "{{ role_path }}/templates/jetty.xml.j2" dest: "{{ node_config_directory }}/{{ item }}/jetty.xml" @@ -67,7 +63,6 @@ - Restart opendaylight container - name: Copying over org.apache.karaf.features.cfg - register: opendaylight_config_features template: src: "{{ role_path }}/templates/org.apache.karaf.features.cfg.j2" dest: "{{ node_config_directory }}/{{ item }}/org.apache.karaf.features.cfg" @@ -79,7 +74,6 @@ - Restart opendaylight container - name: Copying over org.opendaylight.ovsdb.library.cfg - register: opendaylight_config_ovsdb template: src: "{{ role_path }}/templates/org.opendaylight.ovsdb.library.cfg.j2" dest: "{{ node_config_directory }}/{{ item }}/org.opendaylight.ovsdb.library.cfg" @@ -96,7 +90,6 @@ dest: "{{ node_config_directory }}/{{ item }}/tomcat-server.xml" mode: "0660" become: true - register: opendaylight_config_tomcat with_items: - "opendaylight" notify: @@ -108,7 +101,6 @@ dest: "{{ node_config_directory }}/{{ item }}/org.ops4j.pax.logging.cfg" mode: "0660" become: true - register: opendaylight_config_logging with_items: - "opendaylight" notify: @@ -120,7 +112,6 @@ dest: "{{ node_config_directory }}/{{ item }}/netvirt-impl-config_netvirt-impl-config.xml" mode: "0660" become: true - register: opendaylight_config_netvirt with_items: - "opendaylight" notify: @@ -132,7 +123,6 @@ dest: "{{ node_config_directory }}/{{ item }}/netvirt-aclservice-config.xml" mode: "0660" become: true - register: opendaylight_config_netvirt_acl with_items: - "opendaylight" notify: @@ -144,7 +134,6 @@ dest: "{{ node_config_directory }}/opendaylight/setenv" mode: "0660" become: true - register: opendaylight_config_env with_first_found: - "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/setenv" - "{{ node_custom_config }}/opendaylight/setenv" @@ -162,7 +151,6 @@ - "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/akka.conf" - "{{ node_custom_config }}/opendaylight/akka.conf" - "akka.conf.j2" - register: opendaylight_config_akka notify: - Restart opendaylight container @@ -176,7 +164,6 @@ - "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/modules.conf" - "{{ node_custom_config }}/opendaylight/modules.conf" - "modules.conf.j2" - register: opendaylight_config_modules notify: - Restart opendaylight container @@ -190,7 +177,6 @@ - "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/module-shards.conf" - "{{ node_custom_config }}/opendaylight/module-shards.conf" - "module-shards.conf.j2" - register: opendaylight_config_module_shards notify: - Restart opendaylight container @@ -204,7 +190,6 @@ - "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/10-rest-connector.xml" - "{{ node_custom_config }}/opendaylight/10-rest-connector.xml" - "10-rest-connector.xml.j2" - register: opendaylight_config_10_rest_connector notify: - Restart opendaylight container @@ -219,7 +204,6 @@ volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" tty: "{{ item.value.tty }}" - register: check_opendaylight_containers when: - kolla_action != "config" - item.value.enabled | bool diff --git a/ansible/roles/openvswitch/handlers/main.yml b/ansible/roles/openvswitch/handlers/main.yml index 7349a567f5..11d4b5e199 100644 --- a/ansible/roles/openvswitch/handlers/main.yml +++ b/ansible/roles/openvswitch/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "openvswitch-db-server" service: "{{ openvswitch_services[service_name] }}" - config_json: "{{ openvswitch_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - openvswitch_db_container: "{{ check_openvswitch_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,11 +13,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or openvswitch_db_container is changed - or openvswitch_start_ovsdb_server is changed notify: - Waiting for openvswitch_db service to be ready @@ -36,8 +29,6 @@ vars: service_name: "openvswitch-vswitchd" service: "{{ openvswitch_services[service_name] }}" - config_json: "{{ openvswitch_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - openvswitch_vswitchd_container: "{{ check_openvswitch_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -49,8 +40,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or openvswitch_vswitchd_container is changed - or openvswitch_start_ovs is changed diff --git a/ansible/roles/openvswitch/tasks/config.yml b/ansible/roles/openvswitch/tasks/config.yml index b1c9b705da..038e830027 100644 --- a/ansible/roles/openvswitch/tasks/config.yml +++ b/ansible/roles/openvswitch/tasks/config.yml @@ -25,7 +25,6 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: openvswitch_config_jsons when: - item.value.enabled | bool - item.value.host_in_groups | bool @@ -41,7 +40,6 @@ src: "{{ role_path }}/templates/start-ovs.j2" dest: "{{ node_config_directory }}/openvswitch-vswitchd/start-ovs" mode: "0770" - register: openvswitch_start_ovs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -56,7 +54,6 @@ src: "{{ role_path }}/templates/start-ovsdb-server.j2" dest: "{{ node_config_directory }}/openvswitch-db-server/start-ovsdb-server" mode: "0770" - register: openvswitch_start_ovsdb_server when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -73,7 +70,6 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_openvswitch_containers when: - kolla_action != "config" - item.value.enabled | bool diff --git a/ansible/roles/ovs-dpdk/handlers/main.yml b/ansible/roles/ovs-dpdk/handlers/main.yml index 2fe79959d3..fb78a0dccc 100644 --- a/ansible/roles/ovs-dpdk/handlers/main.yml +++ b/ansible/roles/ovs-dpdk/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "ovsdpdk-db" service: "{{ ovsdpdk_services[service_name] }}" - config_json: "{{ ovsdpdk_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ovsdpdk_db_container: "{{ check_ovsdpdk_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,10 +13,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or ovsdpdk_db_container is changed notify: - Waiting the ovs db service to be ready - Ensuring ovsdpdk bridges are properly setup indexed @@ -59,8 +53,6 @@ vars: service_name: "ovsdpdk-vswitchd" service: "{{ ovsdpdk_services[service_name] }}" - config_json: "{{ ovsdpdk_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - ovsdpdk_vswitchd_container: "{{ check_ovsdpdk_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -72,10 +64,6 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - service.enabled | bool - - service.host_in_groups | bool - - config_json is changed - or ovsdpdk_vswitchd_container is changed - name: Ensuring ovsdpdk bridges are properly setup named vars: diff --git a/ansible/roles/ovs-dpdk/tasks/config.yml b/ansible/roles/ovs-dpdk/tasks/config.yml index d113f0ee06..9519fe554b 100644 --- a/ansible/roles/ovs-dpdk/tasks/config.yml +++ b/ansible/roles/ovs-dpdk/tasks/config.yml @@ -16,7 +16,6 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: ovsdpdk_config_jsons when: - item.value.enabled | bool - item.value.host_in_groups | bool @@ -67,7 +66,6 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_ovsdpdk_containers when: - kolla_action != "config" - item.value.enabled | bool diff --git a/ansible/roles/panko/handlers/main.yml b/ansible/roles/panko/handlers/main.yml index fb473036e6..f40f3e92f3 100644 --- a/ansible/roles/panko/handlers/main.yml +++ b/ansible/roles/panko/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "panko-api" service: "{{ panko_services[service_name] }}" - config_json: "{{ panko_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - panko_conf: "{{ panko_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ panko_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - panko_api_container: "{{ check_panko_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,10 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or panko_conf.changed | bool - or panko_wsgi.changed | bool - or policy_overwriting.changed | bool - or panko_api_container.changed | bool diff --git a/ansible/roles/panko/tasks/config.yml b/ansible/roles/panko/tasks/config.yml index bbaf7c9531..cd92d75310 100644 --- a/ansible/roles/panko/tasks/config.yml +++ b/ansible/roles/panko/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: panko_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -54,7 +53,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/panko.conf" mode: "0660" become: true - register: panko_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -70,7 +68,6 @@ dest: "{{ node_config_directory }}/{{ item }}/wsgi-panko.conf" mode: "0660" become: true - register: panko_wsgi when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -85,7 +82,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ panko_policy_file }}" mode: "0660" become: true - register: panko_policy_overwriting when: - panko_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -103,7 +99,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_panko_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/prometheus/handlers/main.yml b/ansible/roles/prometheus/handlers/main.yml index 0ae42f1b9d..db155b4bb2 100644 --- a/ansible/roles/prometheus/handlers/main.yml +++ b/ansible/roles/prometheus/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "prometheus-server" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,18 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_confs.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-node-exporter container vars: service_name: "prometheus-node-exporter" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -38,17 +29,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-mysqld-exporter container vars: service_name: "prometheus-mysqld-exporter" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -59,18 +44,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_conf_mycnf.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-haproxy-exporter container vars: service_name: "prometheus-haproxy-exporter" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -81,17 +59,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-memcached-exporter container vars: service_name: "prometheus-memcached-exporter" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -102,17 +74,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-cadvisor container vars: service_name: "prometheus-cadvisor" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -123,17 +89,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-alertmanager container vars: service_name: "prometheus-alertmanager" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -144,18 +104,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_alertmanager_confs.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-openstack-exporter container vars: service_name: "prometheus-openstack-exporter" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -166,18 +119,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_openstack_exporter_confs.changed | bool - or prometheus_container.changed | bool - name: Restart prometheus-elasticsearch-exporter container vars: service_name: "prometheus-elasticsearch-exporter" service: "{{ prometheus_services[service_name] }}" - config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -188,7 +134,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or prometheus_container.changed | bool diff --git a/ansible/roles/prometheus/tasks/config.yml b/ansible/roles/prometheus/tasks/config.yml index 2c4741b16d..3e297418a1 100644 --- a/ansible/roles/prometheus/tasks/config.yml +++ b/ansible/roles/prometheus/tasks/config.yml @@ -18,7 +18,6 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: prometheus_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -45,7 +44,6 @@ src: "{{ item.path }}" dest: "{{ node_config_directory }}/prometheus-server/{{ item.path | basename }}" mode: "0660" - register: prometheus_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool and enable_prometheus_alertmanager | bool @@ -62,7 +60,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/prometheus-server/prometheus.yml" mode: "0660" - register: prometheus_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -81,7 +78,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/prometheus-alertmanager/prometheus-alertmanager.yml" mode: "0660" - register: prometheus_alertmanager_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -103,7 +99,6 @@ - "{{ role_path }}/templates/my.cnf.j2" dest: "{{ node_config_directory }}/prometheus-mysqld-exporter/my.cnf" mode: "0660" - register: prometheus_conf_mycnf when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -118,7 +113,6 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/prometheus-openstack-exporter/clouds.yml" mode: "0660" - register: prometheus_openstack_exporter_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -139,7 +133,6 @@ pid_mode: "{{ item.value.pid_mode|default('') }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_prometheus_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/qdrouterd/handlers/main.yml b/ansible/roles/qdrouterd/handlers/main.yml index 7dd59039e3..17c6b84e47 100644 --- a/ansible/roles/qdrouterd/handlers/main.yml +++ b/ansible/roles/qdrouterd/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "qdrouterd" service: "{{ qdrouterd_services[service_name] }}" - config_json: "{{ qdrouterd_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - qdrouterd_container: "{{ check_qdrouterd_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -15,9 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or qdrouterd_confs.changed | bool - or qdrouterd_sasl_confs.changed | bool - or qdrouterd_container.changed | bool diff --git a/ansible/roles/qdrouterd/tasks/config.yml b/ansible/roles/qdrouterd/tasks/config.yml index 82f46f336f..f18ff9f7cf 100644 --- a/ansible/roles/qdrouterd/tasks/config.yml +++ b/ansible/roles/qdrouterd/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: qdrouterd_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -34,7 +33,6 @@ dest: "{{ node_config_directory }}/qdrouterd/qdrouterd.conf" mode: "0660" become: true - register: qdrouterd_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -53,7 +51,6 @@ dest: "{{ node_config_directory }}/qdrouterd/qdrouterd-sasl.conf" mode: "0660" become: true - register: qdrouterd_sasl_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -73,7 +70,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_qdrouterd_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/qinling/handlers/main.yml b/ansible/roles/qinling/handlers/main.yml index 01620ead60..9b5e5263dd 100644 --- a/ansible/roles/qinling/handlers/main.yml +++ b/ansible/roles/qinling/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "qinling-api" service: "{{ qinling_services[service_name] }}" - config_json: "{{ qinling_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - qinling_conf: "{{ qinling_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ qinling_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - qinling_api_container: "{{ check_qinling_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,22 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or qinling_conf.changed | bool - or qinling_conf_wsgi.changed | bool - or policy_overwriting.changed | bool - or qinling_api_container.changed | bool - name: Restart qinling-engine container vars: service_name: "qinling-engine" service: "{{ qinling_services[service_name] }}" - config_json: "{{ qinling_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - qinling_conf: "{{ qinling_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ qinling_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - qinling_engine_container: "{{ check_qinling_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or qinling_conf.changed | bool - or policy_overwriting.changed | bool - or qinling_engine_container.changed | bool diff --git a/ansible/roles/qinling/tasks/config.yml b/ansible/roles/qinling/tasks/config.yml index 0207ad0369..e892fc024f 100644 --- a/ansible/roles/qinling/tasks/config.yml +++ b/ansible/roles/qinling/tasks/config.yml @@ -40,7 +40,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: qinling_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -61,7 +60,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/qinling.conf" mode: "0660" become: true - register: qinling_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -77,7 +75,6 @@ dest: "{{ node_config_directory }}/qinling-api/wsgi-qinling.conf" mode: "0660" become: true - register: qinling_conf_wsgi when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -90,7 +87,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ qinling_policy_file }}" mode: "0660" become: true - register: qinling_policy_overwriting when: - qinling_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -108,7 +104,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_qinling_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/rally/handlers/main.yml b/ansible/roles/rally/handlers/main.yml index 29c20f725f..fa7bd4438e 100644 --- a/ansible/roles/rally/handlers/main.yml +++ b/ansible/roles/rally/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "rally" service: "{{ rally_services[service_name] }}" - config_json: "{{ rally_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - rally_conf: "{{ rally_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ rally_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - rally_container: "{{ check_rally_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,9 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or rally_conf.changed | bool - or policy_overwriting.changed | bool - or rally_container.changed | bool diff --git a/ansible/roles/rally/tasks/config.yml b/ansible/roles/rally/tasks/config.yml index 7309818ec5..1d6e8dbf5e 100644 --- a/ansible/roles/rally/tasks/config.yml +++ b/ansible/roles/rally/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: rally_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -53,7 +52,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.conf" mode: "0660" become: true - register: rally_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] @@ -67,7 +65,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ rally_policy_file }}" mode: "0660" become: true - register: rally_policy_overwriting when: - rally_policy_file is defined - inventory_hostname in groups[item.value.group] @@ -85,7 +82,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_rally_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/redis/handlers/main.yml b/ansible/roles/redis/handlers/main.yml index 2822d510bf..2b900c37db 100644 --- a/ansible/roles/redis/handlers/main.yml +++ b/ansible/roles/redis/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "redis" service: "{{ redis_services[service_name] }}" - config_json: "{{ redis_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - redis_conf: "{{ redis_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - redis_container: "{{ check_redis_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,19 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or redis_confs.changed |bool - or redis_container.changed | bool - name: Restart redis-sentinel container vars: service_name: "redis-sentinel" service: "{{ redis_services[service_name] }}" - config_json: "{{ redis_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - redis_conf: "{{ redis_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - redis_container: "{{ check_redis_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -39,8 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or redis_confs.changed |bool - or redis_container.changed | bool diff --git a/ansible/roles/redis/tasks/config.yml b/ansible/roles/redis/tasks/config.yml index 89eb645dd9..a0ba500788 100644 --- a/ansible/roles/redis/tasks/config.yml +++ b/ansible/roles/redis/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: redis_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -32,7 +31,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/redis.conf" mode: "0660" become: true - register: redis_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -49,7 +47,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_redis_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/sahara/handlers/main.yml b/ansible/roles/sahara/handlers/main.yml index e47045caec..c13304e7ee 100644 --- a/ansible/roles/sahara/handlers/main.yml +++ b/ansible/roles/sahara/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "sahara-api" service: "{{ sahara_services[service_name] }}" - config_json: "{{ sahara_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - sahara_conf: "{{ sahara_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ sahara_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - sahara_api_container: "{{ check_sahara_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or sahara_conf.changed | bool - or policy_overwriting.changed | bool - or sahara_api_container.changed | bool - name: Restart sahara-engine container vars: service_name: "sahara-engine" service: "{{ sahara_services[service_name] }}" - config_json: "{{ sahara_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - sahara_conf: "{{ sahara_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ sahara_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - sahara_engine_container: "{{ check_sahara_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -43,9 +29,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or sahara_conf.changed | bool - or policy_overwriting.changed | bool - or sahara_engine_container.changed | bool diff --git a/ansible/roles/sahara/tasks/config.yml b/ansible/roles/sahara/tasks/config.yml index 43c771ecff..445e5ad769 100644 --- a/ansible/roles/sahara/tasks/config.yml +++ b/ansible/roles/sahara/tasks/config.yml @@ -35,14 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: sahara_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ sahara_services }}" notify: - - Restart sahara-api container - - Restart sahara-engine container + - Restart {{ item.key }} container - name: Copying over sahara.conf vars: @@ -57,14 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/sahara.conf" mode: "0660" become: true - register: sahara_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ sahara_services }}" notify: - - Restart sahara-api container - - Restart sahara-engine container + - Restart {{ item.key }} container - name: Copying over existing policy file template: @@ -72,15 +68,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ sahara_policy_file }}" mode: "0660" become: true - register: sahara_policy_overwriting when: - sahara_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ sahara_services }}" notify: - - Restart sahara-api container - - Restart sahara-engine container + - Restart {{ item.key }} container - name: Check sahara containers become: true @@ -92,12 +86,10 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_sahara_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ sahara_services }}" notify: - - Restart sahara-api container - - Restart sahara-engine container + - Restart {{ item.key }} container diff --git a/ansible/roles/searchlight/handlers/main.yml b/ansible/roles/searchlight/handlers/main.yml index 984f2725c2..dc94797b67 100644 --- a/ansible/roles/searchlight/handlers/main.yml +++ b/ansible/roles/searchlight/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "searchlight-api" service: "{{ searchlight_services[service_name] }}" - config_json: "{{ searchlight_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - searchlight_conf: "{{ searchlight_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ searchlight_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - searchlight_api_container: "{{ check_searchlight_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or searchlight_conf.changed | bool - or policy_overwriting.changed | bool - or searchlight_api_container.changed | bool - name: Restart searchlight-listener container vars: service_name: "searchlight-listener" service: "{{ searchlight_services[service_name] }}" - config_json: "{{ searchlight_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - searchlight_conf: "{{ searchlight_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ searchlight_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - searchlight_listener_container: "{{ check_searchlight_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or searchlight_conf.changed | bool - or policy_overwriting.changed | bool - or searchlight_listener_container.changed | bool diff --git a/ansible/roles/searchlight/tasks/config.yml b/ansible/roles/searchlight/tasks/config.yml index 19269fbad7..8db1b915cc 100644 --- a/ansible/roles/searchlight/tasks/config.yml +++ b/ansible/roles/searchlight/tasks/config.yml @@ -35,11 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: searchlight_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ searchlight_services }}" + notify: + - Restart {{ item.key }} container - name: Copying over searchlight.conf vars: @@ -53,14 +54,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/searchlight.conf" mode: "0660" become: true - register: searchlight_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ searchlight_services }}" notify: - - Restart searchlight-api container - - Restart searchlight-listener container + - Restart {{ item.key }} container - name: Copying over existing policy file template: @@ -68,15 +67,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ searchlight_policy_file }}" mode: "0660" become: true - register: searchlight_policy_overwriting when: - searchlight_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ searchlight_services }}" notify: - - Restart searchlight-api container - - Restart searchlight-listener container + - Restart {{ item.key }} container - name: Check searchlight containers become: true @@ -87,12 +84,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_searchlight_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ searchlight_services }}" notify: - - Restart searchlight-api container - - Restart searchlight-listener container + - Restart {{ item.key }} container diff --git a/ansible/roles/senlin/handlers/main.yml b/ansible/roles/senlin/handlers/main.yml index b2f7846f63..d792e47ddc 100644 --- a/ansible/roles/senlin/handlers/main.yml +++ b/ansible/roles/senlin/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "senlin-api" service: "{{ senlin_services[service_name] }}" - config_json: "{{ senlin_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - senlin_conf: "{{ senlin_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ senlin_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - senlin_api_container: "{{ check_senlin_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or senlin_conf.changed | bool - or policy_overwriting.changed | bool - or senlin_api_container.changed | bool - name: Restart senlin-engine container vars: service_name: "senlin-engine" service: "{{ senlin_services[service_name] }}" - config_json: "{{ senlin_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - senlin_conf: "{{ senlin_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ senlin_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - senlin_engine_container: "{{ check_senlin_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or senlin_conf.changed | bool - or policy_overwriting.changed | bool - or senlin_engine_container.changed | bool diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml index dd688f95f8..3330205a97 100644 --- a/ansible/roles/senlin/tasks/config.yml +++ b/ansible/roles/senlin/tasks/config.yml @@ -35,14 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: senlin_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ senlin_services }}" notify: - - Restart senlin-api container - - Restart senlin-engine container + - Restart {{ item.key }} container - name: Copying over senlin.conf vars: @@ -57,14 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/senlin.conf" mode: "0660" become: true - register: senlin_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ senlin_services }}" notify: - - Restart senlin-api container - - Restart senlin-engine container + - Restart {{ item.key }} container - name: Copying over existing policy file template: @@ -72,15 +68,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ senlin_policy_file }}" mode: "0660" become: true - register: senlin_policy_overwriting when: - senlin_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ senlin_services }}" notify: - - Restart senlin-api container - - Restart senlin-engine container + - Restart {{ item.key }} container - name: Check senlin containers become: true @@ -91,12 +85,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_senlin_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ senlin_services }}" notify: - - Restart senlin-api container - - Restart senlin-engine container + - Restart {{ item.key }} container diff --git a/ansible/roles/skydive/handlers/main.yml b/ansible/roles/skydive/handlers/main.yml index 7700e96ecd..1568590e23 100644 --- a/ansible/roles/skydive/handlers/main.yml +++ b/ansible/roles/skydive/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "skydive-analyzer" service: "{{ skydive_services[service_name] }}" - config_json: "{{ skydive_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - skydive_conf: "{{ skydive_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - skydive_analyzer_container: "{{ check_skydive_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,19 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or skydive_conf.changed |bool - or skydive_analyzer_container.changed | bool - name: Restart skydive-agent container vars: service_name: "skydive-agent" service: "{{ skydive_services[service_name] }}" - config_json: "{{ skydive_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - skydive_conf: "{{ skydive_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - skydive_agent_container: "{{ check_skydive_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -40,8 +29,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or skydive_conf.changed |bool - or skydive_agent_container.changed | bool diff --git a/ansible/roles/skydive/tasks/config.yml b/ansible/roles/skydive/tasks/config.yml index aa83bbb3fe..638c8c2379 100644 --- a/ansible/roles/skydive/tasks/config.yml +++ b/ansible/roles/skydive/tasks/config.yml @@ -18,14 +18,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: skydive_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ skydive_services }}" notify: - - Restart skydive-analyzer container - - Restart skydive-agent container + - Restart {{ item.key }} container - name: Copying over skydive config file template: @@ -33,14 +31,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/skydive.conf" mode: "0660" become: true - register: skydive_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ skydive_services }}" notify: - - Restart skydive-analyzer container - - Restart skydive-agent container + - Restart {{ item.key }} container - name: Check skydive containers become: true @@ -52,12 +48,10 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_skydive_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ skydive_services }}" notify: - - Restart skydive-analyzer container - - Restart skydive-agent container + - Restart {{ item.key }} container diff --git a/ansible/roles/solum/handlers/main.yml b/ansible/roles/solum/handlers/main.yml index 34c564e0b9..13b01b8f90 100644 --- a/ansible/roles/solum/handlers/main.yml +++ b/ansible/roles/solum/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "solum-api" service: "{{ solum_services[service_name] }}" - config_json: "{{ solum_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_conf: "{{ solum_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_api_container: "{{ check_solum_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,19 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or solum_conf.changed | bool - or solum_api_container.changed | bool - name: Restart solum-worker container vars: service_name: "solum-worker" service: "{{ solum_services[service_name] }}" - config_json: "{{ solum_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_conf: "{{ solum_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_worker_container: "{{ check_solum_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -39,19 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or solum_conf.changed | bool - or solum_worker_container.changed | bool - name: Restart solum-deployer container vars: service_name: "solum-deployer" service: "{{ solum_services[service_name] }}" - config_json: "{{ solum_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_conf: "{{ solum_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_deployer_container: "{{ check_solum_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -62,19 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or solum_conf.changed | bool - or solum_deployer_container.changed | bool - name: Restart solum-conductor container vars: service_name: "solum-conductor" service: "{{ solum_services[service_name] }}" - config_json: "{{ solum_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_conf: "{{ solum_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - solum_conductor_container: "{{ check_solum_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -85,8 +58,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or solum_conf.changed | bool - or solum_conductor_container.changed | bool diff --git a/ansible/roles/solum/tasks/config.yml b/ansible/roles/solum/tasks/config.yml index f2b8b6f8aa..fc4db83797 100644 --- a/ansible/roles/solum/tasks/config.yml +++ b/ansible/roles/solum/tasks/config.yml @@ -18,16 +18,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: solum_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ solum_services }}" notify: - - Restart solum-api container - - Restart solum-conductor container - - Restart solum-deployer container - - Restart solum-worker container + - Restart {{ item.key }} container - name: Copying over solum.conf vars: @@ -42,16 +38,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/solum.conf" mode: "0660" become: true - register: solum_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ solum_services }}" notify: - - Restart solum-api container - - Restart solum-conductor container - - Restart solum-deployer container - - Restart solum-worker container + - Restart {{ item.key }} container - name: Check solum containers become: true @@ -62,14 +54,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_solum_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ solum_services }}" notify: - - Restart solum-api container - - Restart solum-conductor container - - Restart solum-deployer container - - Restart solum-worker container + - Restart {{ item.key }} container diff --git a/ansible/roles/storm/handlers/main.yml b/ansible/roles/storm/handlers/main.yml index 6fe4e0c5eb..3818b5c993 100644 --- a/ansible/roles/storm/handlers/main.yml +++ b/ansible/roles/storm/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "storm-worker" service: "{{ storm_services[service_name] }}" - config_json: "{{ storm_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - worker_container: "{{ check_storm_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,18 +14,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or storm_worker_conf.changed | bool - or worker_container.changed | bool - name: Restart storm-nimbus container vars: service_name: "storm-nimbus" service: "{{ storm_services[service_name] }}" - config_json: "{{ storm_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - nimbus_container: "{{ check_storm_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -39,8 +30,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or storm_nimbus_conf.changed | bool - or nimbus_container.changed | bool diff --git a/ansible/roles/storm/tasks/config.yml b/ansible/roles/storm/tasks/config.yml index d6c3b7a123..03c8614235 100644 --- a/ansible/roles/storm/tasks/config.yml +++ b/ansible/roles/storm/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: storm_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -34,7 +33,6 @@ dest: "{{ node_config_directory }}/storm-worker/storm.yml" mode: "0660" become: true - register: storm_worker_conf with_first_found: - "{{ node_custom_config }}/storm/{{ inventory_hostname }}/storm.yml" - "{{ node_custom_config }}/storm.yml" @@ -53,7 +51,6 @@ dest: "{{ node_config_directory }}/storm-nimbus/storm.yml" mode: "0660" become: true - register: storm_nimbus_conf with_first_found: - "{{ node_custom_config }}/storm/{{ inventory_hostname }}/storm.yml" - "{{ node_custom_config }}/storm.yml" @@ -74,7 +71,6 @@ volumes: "{{ item.value.volumes }}" environment: "{{ item.value.environment }}" dimensions: "{{ item.value.dimensions }}" - register: check_storm_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/tacker/handlers/main.yml b/ansible/roles/tacker/handlers/main.yml index 9905c486f2..9808902c84 100644 --- a/ansible/roles/tacker/handlers/main.yml +++ b/ansible/roles/tacker/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "tacker-conductor" service: "{{ tacker_services[service_name] }}" - config_json: "{{ tacker_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - tacker_conf: "{{ tacker_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ tacker_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - tacker_conductor_container: "{{ check_tacker_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or tacker_conf.changed | bool - or policy_overwriting.changed | bool - or tacker_conductor_container.changed | bool - name: Restart tacker-server container vars: service_name: "tacker-server" service: "{{ tacker_services[service_name] }}" - config_json: "{{ tacker_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - tacker_conf: "{{ tacker_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ tacker_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - tacker_server_container: "{{ check_tacker_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,9 +28,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or tacker_conf.changed | bool - or policy_overwriting.changed | bool - or tacker_server_container.changed | bool diff --git a/ansible/roles/tacker/tasks/config.yml b/ansible/roles/tacker/tasks/config.yml index e50bb44dae..723f3de587 100644 --- a/ansible/roles/tacker/tasks/config.yml +++ b/ansible/roles/tacker/tasks/config.yml @@ -35,14 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: tacker_config_jsons with_dict: "{{ tacker_services }}" when: - inventory_hostname in groups[item.value.group] - item.value.enabled notify: - - Restart tacker-server container - - Restart tacker-conductor container + - Restart {{ item.key }} container - name: Copying over tacker.conf vars: @@ -57,14 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/tacker.conf" mode: "0660" become: true - register: tacker_confs with_dict: "{{ tacker_services }}" when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool notify: - - Restart tacker-server container - - Restart tacker-conductor container + - Restart {{ item.key }} container - name: Copying over existing policy file template: @@ -72,15 +68,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ tacker_policy_file }}" mode: "0660" become: true - register: tacker_policy_overwriting when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool - tacker_policy_file is defined with_dict: "{{ tacker_services }}" notify: - - Restart tacker-server containers - - Restart tacker-conductor container + - Restart {{ item.key }} container - name: Check tacker container become: true @@ -94,8 +88,6 @@ - kolla_action != 'config' - inventory_hostname in groups[item.value.group] - item.value.enabled | bool - register: check_tacker_containers with_dict: "{{ tacker_services }}" notify: - - Restart tacker-server container - - Restart tacker-conductor container + - Restart {{ item.key }} container diff --git a/ansible/roles/telegraf/handlers/main.yml b/ansible/roles/telegraf/handlers/main.yml index dbfd7098da..c80d011d33 100644 --- a/ansible/roles/telegraf/handlers/main.yml +++ b/ansible/roles/telegraf/handlers/main.yml @@ -3,8 +3,6 @@ vars: service_name: "telegraf" service: "{{ telegraf_services[service_name] }}" - config_json: "{{ telegraf_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - telegraf_container: "{{ check_telegraf_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -19,9 +17,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or telegraf_confs.changed | bool - or telegraf_plugin.changed | bool - or telegraf_container.changed | bool diff --git a/ansible/roles/telegraf/tasks/config.yml b/ansible/roles/telegraf/tasks/config.yml index 5c1ca1e78a..2d2cbe811d 100644 --- a/ansible/roles/telegraf/tasks/config.yml +++ b/ansible/roles/telegraf/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/telegraf/config.json" mode: "0660" become: true - register: telegraf_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -34,7 +33,6 @@ dest: "{{ node_config_directory }}/telegraf/telegraf.conf" mode: "0660" become: true - register: telegraf_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -53,7 +51,6 @@ dest: "{{ node_config_directory }}/telegraf/config" mode: "0660" become: true - register: telegraf_plugin when: - inventory_hostname in groups[service.group] - item.value.enabled | bool @@ -72,7 +69,6 @@ volumes: "{{ item.value.volumes }}" pid_mode: "{{ item.value.pid_mode }}" dimensions: "{{ item.value.dimensions }}" - register: check_telegraf_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/tempest/handlers/main.yml b/ansible/roles/tempest/handlers/main.yml index 2ee88c0de0..4078b42dfb 100644 --- a/ansible/roles/tempest/handlers/main.yml +++ b/ansible/roles/tempest/handlers/main.yml @@ -3,9 +3,6 @@ vars: service_name: "tempest" service: "{{ tempest_services[service_name] }}" - config_json: "{{ tempest_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - tempest_conf: "{{ tempest_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - tempest_container: "{{ check_tempest_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -16,8 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or tempest_conf.changed | bool - or tempest_container.changed | bool diff --git a/ansible/roles/tempest/tasks/config.yml b/ansible/roles/tempest/tasks/config.yml index ee7a68db63..cf608db046 100644 --- a/ansible/roles/tempest/tasks/config.yml +++ b/ansible/roles/tempest/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: tempest_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -36,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/tempest.conf" mode: "0660" become: true - register: tempest_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -53,7 +51,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_tempest_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/trove/handlers/main.yml b/ansible/roles/trove/handlers/main.yml index b7d927e12e..865ab5bf32 100644 --- a/ansible/roles/trove/handlers/main.yml +++ b/ansible/roles/trove/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "trove-api" service: "{{ trove_services[service_name] }}" - config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - trove_conf: "{{ trove_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ trove_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - trove_api_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or trove_conf.changed | bool - or policy_overwriting.changed | bool - or trove_api_container.changed | bool - name: Restart trove-conductor container vars: service_name: "trove-conductor" service: "{{ trove_services[service_name] }}" - config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - trove_conf: "{{ trove_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ trove_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - trove_conductor_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or trove_conf.changed | bool - or policy_overwriting.changed | bool - or trove_conductor_container.changed | bool - name: Restart trove-taskmanager container vars: service_name: "trove-taskmanager" service: "{{ trove_services[service_name] }}" - config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - trove_conf: "{{ trove_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ trove_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - trove_taskmanager_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -67,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or trove_conf.changed | bool - or policy_overwriting.changed | bool - or trove_taskmanager_container.changed | bool diff --git a/ansible/roles/trove/tasks/config.yml b/ansible/roles/trove/tasks/config.yml index 34f4944807..bd9167ff51 100644 --- a/ansible/roles/trove/tasks/config.yml +++ b/ansible/roles/trove/tasks/config.yml @@ -35,7 +35,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: trove_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -58,7 +57,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.conf" mode: "0660" become: true - register: trove_confs when: - item.key in services_need_confs - inventory_hostname in groups[item.value.group] @@ -80,7 +78,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/trove.conf" mode: "0660" become: true - register: trove_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -93,15 +90,12 @@ src: "{{ trove_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ trove_policy_file }}" mode: "0660" - register: trove_policy_overwriting when: - trove_policy_file is defined - inventory_hostname in groups[item.value.group] with_dict: "{{ trove_services }}" notify: - - Restart trove-api container - - Restart trove-conductor container - - Restart trove-taskmanager container + - Restart {{ item.key }} container - name: Check trove containers become: true @@ -112,7 +106,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_trove_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/vitrage/handlers/main.yml b/ansible/roles/vitrage/handlers/main.yml index 5cbb6d0562..212872a836 100644 --- a/ansible/roles/vitrage/handlers/main.yml +++ b/ansible/roles/vitrage/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "vitrage-api" service: "{{ vitrage_services[service_name] }}" - config_json: "{{ vitrage_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_conf: "{{ vitrage_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ vitrage_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_api_container: "{{ check_vitrage_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or vitrage_conf.changed | bool - or policy_overwriting.changed | bool - or vitrage_api_container.changed | bool - name: Restart vitrage-notifier container vars: service_name: "vitrage-notifier" service: "{{ vitrage_services[service_name] }}" - config_json: "{{ vitrage_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_conf: "{{ vitrage_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ vitrage_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_notifier_container: "{{ check_vitrage_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,22 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or vitrage_conf.changed | bool - or policy_overwriting.changed | bool - or vitrage_notifier_container.changed | bool - name: Restart vitrage-graph container vars: service_name: "vitrage-graph" service: "{{ vitrage_services[service_name] }}" - config_json: "{{ vitrage_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_conf: "{{ vitrage_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ vitrage_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_graph_container: "{{ check_vitrage_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_prometheus_conf: "{{ vitrage_prometheus_conf.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -68,22 +43,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or vitrage_conf.changed | bool - or policy_overwriting.changed | bool - or vitrage_graph_container.changed | bool - or vitrage_prometheus_conf.changed | bool - name: Restart vitrage-ml container vars: service_name: "vitrage-ml" service: "{{ vitrage_services[service_name] }}" - config_json: "{{ vitrage_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_conf: "{{ vitrage_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ vitrage_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - vitrage_ml_container: "{{ check_vitrage_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -94,9 +58,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or vitrage_conf.changed | bool - or policy_overwriting.changed | bool - or vitrage_ml_container.changed | bool diff --git a/ansible/roles/vitrage/tasks/config.yml b/ansible/roles/vitrage/tasks/config.yml index 07ff0de082..3ab50eafcf 100644 --- a/ansible/roles/vitrage/tasks/config.yml +++ b/ansible/roles/vitrage/tasks/config.yml @@ -35,16 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: vitrage_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ vitrage_services }}" notify: - - Restart vitrage-api container - - Restart vitrage-notifier container - - Restart vitrage-graph container - - Restart vitrage-ml container + - Restart {{ item.key }} container - name: Copying over vitrage.conf vars: @@ -60,16 +56,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/vitrage.conf" mode: "0660" become: true - register: vitrage_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ vitrage_services }}" notify: - - Restart vitrage-api container - - Restart vitrage-notifier container - - Restart vitrage-graph container - - Restart vitrage-ml container + - Restart {{ item.key }} container - name: Copying over wsgi-vitrage files for services template: @@ -90,7 +82,6 @@ dest: "{{ node_config_directory }}/vitrage-graph/prometheus_conf.yaml" mode: "0660" become: true - register: vitrage_prometheus_conf when: - enable_vitrage_prometheus_datasource | bool - inventory_hostname in groups[service.group] @@ -104,17 +95,13 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ vitrage_policy_file }}" mode: "0660" become: true - register: vitrage_policy_overwriting when: - vitrage_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ vitrage_services }}" notify: - - Restart vitrage-api container - - Restart vitrage-graph container - - Restart vitrage-notifier container - - Restart vitrage-ml container + - Restart {{ item.key }} container - name: Check vitrage containers become: true @@ -125,14 +112,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" dimensions: "{{ item.value.dimensions }}" - register: check_vitrage_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ vitrage_services }}" notify: - - Restart vitrage-api container - - Restart vitrage-graph container - - Restart vitrage-notifier container - - Restart vitrage-ml container + - Restart {{ item.key }} container diff --git a/ansible/roles/vmtp/handlers/main.yml b/ansible/roles/vmtp/handlers/main.yml index 3e74f948e7..e0e3f4f2db 100644 --- a/ansible/roles/vmtp/handlers/main.yml +++ b/ansible/roles/vmtp/handlers/main.yml @@ -3,7 +3,6 @@ vars: service_name: "vmtp" service: "{{ vmtp_services[service_name] }}" - vmtp_container: "{{ check_vmtp_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -14,7 +13,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - vmtp_confs.changed | bool - or vmtp_container.changed | bool diff --git a/ansible/roles/vmtp/tasks/config.yml b/ansible/roles/vmtp/tasks/config.yml index b72fb2a78e..69326092f8 100644 --- a/ansible/roles/vmtp/tasks/config.yml +++ b/ansible/roles/vmtp/tasks/config.yml @@ -33,7 +33,6 @@ dest: "{{ node_config_directory }}/vmtp/{{ item }}" mode: "0660" become: true - register: vmtp_confs when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -51,7 +50,6 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" - register: check_vmtp_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/watcher/handlers/main.yml b/ansible/roles/watcher/handlers/main.yml index 7bf116dbf7..2ab6ca6662 100644 --- a/ansible/roles/watcher/handlers/main.yml +++ b/ansible/roles/watcher/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "watcher-applier" service: "{{ watcher_services[service_name] }}" - config_json: "{{ watcher_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - watcher_conf: "{{ watcher_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ watcher_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - watcher_applier_container: "{{ check_watcher_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -17,21 +13,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or watcher_conf.changed | bool - or policy_overwriting.changed | bool - or watcher_applier_container.changed | bool - name: Restart watcher-engine container vars: service_name: "watcher-engine" service: "{{ watcher_services[service_name] }}" - config_json: "{{ watcher_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - watcher_conf: "{{ watcher_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ watcher_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - watcher_engine_container: "{{ check_watcher_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -42,21 +28,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or watcher_conf.changed | bool - or policy_overwriting.changed | bool - or watcher_engine_container.changed | bool - name: Restart watcher-api container vars: service_name: "watcher-api" service: "{{ watcher_services[service_name] }}" - config_json: "{{ watcher_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - watcher_conf: "{{ watcher_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ watcher_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - watcher_api_container: "{{ check_watcher_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -67,9 +43,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or watcher_conf.changed | bool - or policy_overwriting.changed | bool - or watcher_api_container.changed | bool diff --git a/ansible/roles/watcher/tasks/config.yml b/ansible/roles/watcher/tasks/config.yml index 41bfd7169d..b9ca1d5e54 100644 --- a/ansible/roles/watcher/tasks/config.yml +++ b/ansible/roles/watcher/tasks/config.yml @@ -34,15 +34,12 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - register: watcher_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ watcher_services }}" notify: - - Restart watcher-api container - - Restart watcher-engine container - - Restart watcher-applier container + - Restart {{ item.key }} container - name: Copying over watcher.conf vars: @@ -56,31 +53,25 @@ - "{{ node_custom_config }}/watcher/{{ inventory_hostname }}/watcher.conf" dest: "{{ node_config_directory }}/{{ item.key }}/watcher.conf" mode: "0660" - register: watcher_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ watcher_services }}" notify: - - Restart watcher-api container - - Restart watcher-engine container - - Restart watcher-applier container + - Restart {{ item.key }} container - name: Copying over existing policy file template: src: "{{ watcher_policy_file_path }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ watcher_policy_file }}" mode: "0660" - register: watcher_policy_overwriting when: - watcher_policy_file is defined - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ watcher_services }}" notify: - - Restart watcher-api container - - Restart watcher-applier container - - Restart watcher-engine container + - Restart {{ item.key }} container - name: Check watcher containers become: true @@ -91,13 +82,10 @@ image: "{{ item.value.image }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_watcher_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ watcher_services }}" notify: - - Restart watcher-api container - - Restart watcher-applier container - - Restart watcher-engine container + - Restart {{ item.key }} container diff --git a/ansible/roles/zookeeper/handlers/main.yml b/ansible/roles/zookeeper/handlers/main.yml index 583fbaa99a..75e0ec3244 100644 --- a/ansible/roles/zookeeper/handlers/main.yml +++ b/ansible/roles/zookeeper/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "zookeeper" service: "{{ zookeeper_services[service_name] }}" - config_json: "{{ zookeeper_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - zookeeper_conf: "{{ zookeeper_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - zookeeper_instance_id: "{{ zookeeper_instance_id.results|selectattr('item.key', 'equalto', service_name)|first }}" - zookeeper_container: "{{ check_zookeeper_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -18,9 +14,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or zookeeper_conf.changed | bool - or zookeeper_instance_id.changed | bool - or zookeeper_container.changed | bool diff --git a/ansible/roles/zookeeper/tasks/config.yml b/ansible/roles/zookeeper/tasks/config.yml index 41ca32ac2d..b5a085d7fb 100644 --- a/ansible/roles/zookeeper/tasks/config.yml +++ b/ansible/roles/zookeeper/tasks/config.yml @@ -18,7 +18,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: zookeeper_config_jsons when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -35,7 +34,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.cfg" mode: "0660" become: true - register: zookeeper_confs when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -49,7 +47,6 @@ dest: "{{ node_config_directory }}/{{ item.key }}/myid" mode: "0660" become: true - register: zookeeper_instance_id when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool @@ -67,7 +64,6 @@ volumes: "{{ item.value.volumes }}" environment: "{{ item.value.environment }}" dimensions: "{{ item.value.dimensions }}" - register: check_zookeeper_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] diff --git a/ansible/roles/zun/handlers/main.yml b/ansible/roles/zun/handlers/main.yml index 7cf52d5b22..cbf03b5cfc 100644 --- a/ansible/roles/zun/handlers/main.yml +++ b/ansible/roles/zun/handlers/main.yml @@ -3,10 +3,6 @@ vars: service_name: "zun-api" service: "{{ zun_services[service_name] }}" - config_json: "{{ zun_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - zun_conf: "{{ zun_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ zun_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - zun_api_container: "{{ check_zun_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -18,22 +14,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or zun_conf.changed | bool - or zun_conf_wsgi.changed | bool - or policy_overwriting.changed | bool - or zun_api_container.changed | bool - name: Restart zun-wsproxy container vars: service_name: "zun-wsproxy" service: "{{ zun_services[service_name] }}" - config_json: "{{ zun_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - zun_conf: "{{ zun_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ zun_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - zun_wsproxy_container: "{{ check_zun_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -45,21 +30,11 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or zun_conf.changed | bool - or policy_overwriting.changed | bool - or zun_wsproxy_container.changed | bool - name: Restart zun-compute container vars: service_name: "zun-compute" service: "{{ zun_services[service_name] }}" - config_json: "{{ zun_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - zun_conf: "{{ zun_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - policy_overwriting: "{{ zun_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" - zun_compute_container: "{{ check_zun_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true kolla_docker: action: "recreate_or_restart_container" @@ -71,9 +46,3 @@ dimensions: "{{ service.dimensions }}" when: - kolla_action != "config" - - inventory_hostname in groups[service.group] - - service.enabled | bool - - config_json.changed | bool - or zun_conf.changed | bool - or policy_overwriting.changed | bool - or zun_compute_container.changed | bool diff --git a/ansible/roles/zun/tasks/config.yml b/ansible/roles/zun/tasks/config.yml index d451c05df3..83130e196a 100644 --- a/ansible/roles/zun/tasks/config.yml +++ b/ansible/roles/zun/tasks/config.yml @@ -35,15 +35,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" become: true - register: zun_config_jsons when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ zun_services }}" notify: - - Restart zun-api container - - Restart zun-compute container - - Restart zun-wsproxy container + - Restart {{ item.key }} container - name: Copying over zun.conf vars: @@ -58,15 +55,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/zun.conf" mode: "0660" become: true - register: zun_confs when: - item.value.enabled | bool - inventory_hostname in groups[item.value.group] with_dict: "{{ zun_services }}" notify: - - Restart zun-api container - - Restart zun-compute container - - Restart zun-wsproxy container + - Restart {{ item.key }} container - name: Copying over wsgi-zun files for services vars: @@ -76,7 +70,6 @@ dest: "{{ node_config_directory }}/zun-api/wsgi-zun.conf" mode: "0660" become: true - register: zun_conf_wsgi when: - inventory_hostname in groups[service.group] - service.enabled | bool @@ -89,15 +82,12 @@ dest: "{{ node_config_directory }}/{{ item.key }}/{{ zun_policy_file }}" mode: "0660" become: true - register: zun_policy_overwriting when: - zun_policy_file is defined - inventory_hostname in groups[item.value.group] with_dict: "{{ zun_services }}" notify: - - Restart zun-api container - - Restart zun-compute container - - Restart zun-wsproxy container + - Restart {{ item.key }} container - name: Check zun containers become: true @@ -109,13 +99,10 @@ privileged: "{{ item.value.privileged | default(False) }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" dimensions: "{{ item.value.dimensions }}" - register: check_zun_containers when: - kolla_action != "config" - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ zun_services }}" notify: - - Restart zun-api container - - Restart zun-compute container - - Restart zun-wsproxy container + - Restart {{ item.key }} container