From d3a91554f97bffbbc4783bac09f6d5a5a4f30e94 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Tue, 24 Jul 2018 18:58:59 +0800 Subject: [PATCH] Switch include to include_tasks or import_playbook include is marked as deprecated since ansible 2.4[0] Switch to include_tasks or import_playbook as necessary [0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated Change-Id: Id654f07d18269f621df203b0808b69a75b13bc12 Closes-Bug: #1792761 --- tasks/cinder_backends.yml | 3 +-- tasks/main.yml | 19 ++++++++----------- tests/test.yml | 12 ++++++------ 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/tasks/cinder_backends.yml b/tasks/cinder_backends.yml index 284a4703..d3c1d101 100644 --- a/tasks/cinder_backends.yml +++ b/tasks/cinder_backends.yml @@ -62,8 +62,7 @@ with_dict: "{{ _cinder_backends|default({}) }}" when: item.value.extra_volume_types is defined -- include: cinder_qos.yml - static: no +- include_tasks: cinder_qos.yml when: cinder_qos_specs is defined tags: - cinder-qos diff --git a/tasks/main.yml b/tasks/main.yml index 87e4ef75..0ceceef3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,11 +47,11 @@ tags: - cinder-config -- include: cinder_pre_install.yml +- include_tasks: cinder_pre_install.yml tags: - cinder-install -- include: cinder_install.yml +- include_tasks: cinder_install.yml tags: - cinder-install @@ -62,13 +62,13 @@ tags: - cinder-config -- include: cinder_cleanup_old_facts.yml +- include_tasks: cinder_cleanup_old_facts.yml when: - "'need_db_sync' in ansible_local['openstack_ansible']['cinder']" tags: - cinder-config -- include: cinder_post_install.yml +- include_tasks: cinder_post_install.yml tags: - cinder-config @@ -91,8 +91,7 @@ - common-mq - cinder-config -- include: cinder_db_setup.yml - static: no +- include_tasks: cinder_db_setup.yml when: - "groups['cinder_api'] | length > 0" - "cinder_services['cinder-api']['group'] in group_names" @@ -100,12 +99,11 @@ tags: - cinder-config -- include: cinder_uwsgi.yml +- include_tasks: cinder_uwsgi.yml tags: - cinder-config -- include: cinder_service_setup.yml - static: no +- include_tasks: cinder_service_setup.yml when: - "groups['cinder_api'] | length > 0" - "cinder_services['cinder-api']['group'] in group_names" @@ -128,8 +126,7 @@ - name: Flush handlers meta: flush_handlers -- include: cinder_backends.yml - static: no +- include_tasks: cinder_backends.yml when: - "groups[cinder_services['cinder-volume']['group']] | length > 0" - "cinder_services['cinder-api']['group'] in group_names" diff --git a/tests/test.yml b/tests/test.yml index 0282f17a..ef4bebc5 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -14,19 +14,19 @@ # limitations under the License. # Setup the host -- include: common/test-setup-host.yml +- import_playbook: common/test-setup-host.yml # Prepare the cinder-volumes VG -- include: common/test-setup-cinder-localhost.yml +- import_playbook: common/test-setup-cinder-localhost.yml # Install RabbitMQ/MariaDB -- include: common/test-install-infra.yml +- import_playbook: common/test-install-infra.yml # Install Keystone -- include: common/test-install-keystone.yml +- import_playbook: common/test-install-keystone.yml # Install Cinder -- include: common/test-install-cinder.yml +- import_playbook: common/test-install-cinder.yml # Install and execute Tempest -- include: common/test-install-tempest.yml +- import_playbook: common/test-install-tempest.yml