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

Change-Id: I3acc79b933b7068a13f8c09daff16f0b6920e834
This commit is contained in:
Dmitriy Rabotyagov 2019-07-16 16:33:51 +03:00
parent 146af4abe9
commit 47bcaff4b3

View File

@ -58,7 +58,7 @@
- common-mq
- ironic-config
- include_tasks: ironic_pre_install.yml
- import_tasks: ironic_pre_install.yml
tags:
- ironic-install
@ -79,20 +79,20 @@
tags:
- ironic-install
- include_tasks: ironic_post_install.yml
- import_tasks: ironic_post_install.yml
tags:
- ironic-config
- include_tasks: ironic_uwsgi.yml
- import_tasks: ironic_uwsgi.yml
tags:
- ironic-config
- include_tasks: ironic_conductor_post_install.yml
- import_tasks: ironic_conductor_post_install.yml
when: "ironic_services['ironic-conductor']['group'] in group_names"
tags:
- ironic-config
- include_tasks: ironic_db_setup.yml
- import_tasks: ironic_db_setup.yml
when: inventory_hostname == groups['ironic_conductor'][0]
tags:
- ironic-config
@ -115,7 +115,7 @@
- ironic-config
- systemd-service
- include_tasks: ironic_service_setup.yml
- import_tasks: ironic_service_setup.yml
when: inventory_hostname == groups['ironic_api'][0]
tags:
- ironic-config