From a2783e4e3f84c2681093c90d5fd2daa0f91dac77 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotjagov Date: Thu, 13 Jun 2019 16:46:46 +0300 Subject: [PATCH] Convert dynamic includes to static imports When task/role files are included using include_tasks, tags are not passed to the included tasks. As a result, tags like neutron-config do not have the intended effect. This patch changes include_tasks to import_tasks for all cases where dynamic vars or loops are not used so that tags are properly handled. Reference - https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html https://bugs.launchpad.net/openstack-ansible/+bug/1815043 Depends-On: https://review.opendev.org/665244/ Change-Id: I99cf83ef6bf99f23cdbe9d141c6bcf921e81265f --- tasks/keystone_uwsgi.yml | 2 +- tasks/main.yml | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tasks/keystone_uwsgi.yml b/tasks/keystone_uwsgi.yml index 02480dbb..f4026fc4 100644 --- a/tasks/keystone_uwsgi.yml +++ b/tasks/keystone_uwsgi.yml @@ -32,7 +32,7 @@ - Restart uWSGI - name: Run the systemd service role - include_role: + import_role: name: systemd_service vars: systemd_user_name: "{{ keystone_system_user_name }}" diff --git a/tasks/main.yml b/tasks/main.yml index a3cce0d1..77a03663 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -82,11 +82,11 @@ - common-mq - keystone-config -- include_tasks: keystone_pre_install.yml +- import_tasks: keystone_pre_install.yml tags: - keystone-install -- include_tasks: keystone_install.yml +- import_tasks: keystone_install.yml tags: - keystone-install @@ -97,74 +97,74 @@ tags: - keystone-config -- include_tasks: keystone_post_install.yml +- import_tasks: keystone_post_install.yml tags: - keystone-config -- include_tasks: keystone_key_setup.yml +- import_tasks: keystone_key_setup.yml tags: - keystone-config -- include_tasks: keystone_fernet.yml +- import_tasks: keystone_fernet.yml when: - "'fernet' in keystone_token_provider" - keystone_service_setup | bool tags: - keystone-config -- include_tasks: keystone_db_sync.yml +- import_tasks: keystone_db_sync.yml when: - "keystone_database_enabled | bool" tags: - keystone-config -- include_tasks: keystone_credential.yml +- import_tasks: keystone_credential.yml when: keystone_service_setup | bool tags: - keystone-config -- include_tasks: keystone_federation_sp_setup.yml +- import_tasks: keystone_federation_sp_setup.yml when: keystone_sp != {} tags: - keystone-config -- include_tasks: keystone_ssl.yml +- import_tasks: keystone_ssl.yml tags: - keystone-config -- include_tasks: "keystone_{{ keystone_web_server }}.yml" +- import_tasks: "keystone_{{ keystone_web_server }}.yml" tags: - keystone-config -- include_tasks: keystone_uwsgi.yml +- import_tasks: keystone_uwsgi.yml tags: - keystone-config - name: Flush handlers meta: flush_handlers -- include_tasks: keystone_service_bootstrap.yml +- import_tasks: keystone_service_bootstrap.yml when: - "inventory_hostname == ((groups['keystone_all'] | intersect(ansible_play_hosts)) | list)[0]" - "keystone_service_setup | bool" tags: - keystone-config -- include_tasks: keystone_service_update.yml +- import_tasks: keystone_service_update.yml when: - "inventory_hostname == ((groups['keystone_all'] | intersect(ansible_play_hosts)) | list)[-1]" - "keystone_service_setup | bool" tags: - keystone-config -- include_tasks: keystone_ldap_setup.yml +- import_tasks: keystone_ldap_setup.yml when: - keystone_service_setup | bool - keystone_ldap != {} tags: - keystone-config -- include_tasks: keystone_federation_sp_idp_setup.yml +- import_tasks: keystone_federation_sp_idp_setup.yml when: - keystone_service_setup | bool - keystone_sp != {} @@ -175,7 +175,7 @@ - name: Flush handlers meta: flush_handlers -- include_tasks: keystone_idp_setup.yml +- import_tasks: keystone_idp_setup.yml when: keystone_idp != {} tags: - keystone-config