From 273895816b5e4846343be0e534af9501e2dfe000 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 17 Jul 2019 19:25:40 +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 swift-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 Change-Id: I7553c3ef4d7620844f614da79b2cb1086eda23cb --- tasks/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6e693b77..08f2c7d3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -40,60 +40,60 @@ - always # Check the swift_hash_path_* variables haven't changed -- include_tasks: swift_check_hashes.yml +- import_tasks: swift_check_hashes.yml when: - "not swift_force_change_hashes | bool" tags: - swift-config -- include_tasks: swift_pre_install.yml +- import_tasks: swift_pre_install.yml when: - "swift_do_setup | bool" - "'swift_all' in group_names" tags: - swift-install -- include_tasks: swift_install.yml +- import_tasks: swift_install.yml when: - "swift_do_setup | bool" - "'swift_all' in group_names" tags: - swift-install -- include_tasks: swift_post_install.yml +- import_tasks: swift_post_install.yml when: - "swift_do_setup | bool" - "'swift_all' in group_names" tags: - swift-config -- include_tasks: swift_calculate_addresses.yml +- import_tasks: swift_calculate_addresses.yml when: - "'swift_hosts' in group_names" tags: - always -- include_tasks: swift_storage_hosts.yml +- import_tasks: swift_storage_hosts.yml when: - "swift_do_setup | bool" - "'swift_hosts' in group_names" tags: - swift-config -- include_tasks: swift_proxy_hosts.yml +- import_tasks: swift_proxy_hosts.yml when: - "swift_do_setup | bool" - "'swift_proxy' in group_names" tags: - swift-config -- include_tasks: swift_key_setup.yml +- import_tasks: swift_key_setup.yml when: - "swift_do_sync | bool" tags: - swift-config -- include_tasks: swift_rings.yml +- import_tasks: swift_rings.yml when: - "swift_do_sync | bool" tags: @@ -101,7 +101,7 @@ - swift-rings - name: Run the systemd service role - include_role: + import_role: name: systemd_service vars: systemd_user_name: "{{ swift_system_user_name }}" @@ -148,7 +148,7 @@ - common-mq - swift-config -- include_tasks: swift_service_setup.yml +- import_tasks: swift_service_setup.yml when: - "swift_do_setup | bool" - '"keystoneauth" in swift_middleware_list'