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: I7e529e9b4d23ffe8658c4dcdf4e98989d0f84f3f
This commit is contained in:
Dmitriy Rabotyagov 2019-07-17 18:50:05 +03:00
parent 1516054746
commit 29c540fac3
1 changed files with 5 additions and 5 deletions

View File

@ -74,15 +74,15 @@
- common-mq
- mistral-config
- include_tasks: mistral_install.yml
- import_tasks: mistral_install.yml
tags:
- mistral-install
- include_tasks: mistral_post_install.yml
- import_tasks: mistral_post_install.yml
tags:
- mistral-config
- include_tasks: mistral_db_sync.yml
- import_tasks: mistral_db_sync.yml
when:
- "mistral_services['mistral-api']['group'] in group_names"
- "inventory_hostname == ((groups[mistral_services['mistral-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
@ -90,7 +90,7 @@
- mistral-config
- name: Run the systemd service role
include_role:
import_role:
name: systemd_service
vars:
systemd_user_name: "{{ mistral_system_user_name }}"
@ -122,7 +122,7 @@
- mistral-config
- systemd-service
- include_tasks: mistral_service_setup.yml
- import_tasks: mistral_service_setup.yml
when:
- "mistral_services['mistral-api']['group'] in group_names"
- "inventory_hostname == ((groups[mistral_services['mistral-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"