From d0b0668657da2caa7ec0605f5807ae7328ed548f Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 26 Jun 2018 13:41:13 +0100 Subject: [PATCH] MNAIO: Resolve all Ansible 2.5-related deprecation warnings To resolve the warnings, we: 1. Use import_playbook instead of include for the conditional playbook inclusions in site.yml. TIL that using include_playbook does not work with conditionals. 2. Use include_tasks instead of include for the openstack-image-setup task set inclusion. 3. Switch to using 'is' instead of '|' for tests. Change-Id: I6d68bd4fecda122a77f7934842c3479a4c0792fd --- multi-node-aio/playbooks/deploy-acng.yml | 2 +- multi-node-aio/playbooks/deploy-dhcp.yml | 2 +- multi-node-aio/playbooks/deploy-pxe.yml | 2 +- .../playbooks/openstack-service-setup.yml | 2 +- multi-node-aio/playbooks/setup-host.yml | 10 +++++----- multi-node-aio/playbooks/site.yml | 14 +++++++------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/multi-node-aio/playbooks/deploy-acng.yml b/multi-node-aio/playbooks/deploy-acng.yml index 1cec7d60..07483ca3 100644 --- a/multi-node-aio/playbooks/deploy-acng.yml +++ b/multi-node-aio/playbooks/deploy-acng.yml @@ -37,7 +37,7 @@ update_cache: yes cache_valid_time: 600 register: _install_host_packages - until: _install_host_packages | success + until: _install_host_packages is success retries: 3 delay: 15 diff --git a/multi-node-aio/playbooks/deploy-dhcp.yml b/multi-node-aio/playbooks/deploy-dhcp.yml index a77b6ec5..85c9e058 100644 --- a/multi-node-aio/playbooks/deploy-dhcp.yml +++ b/multi-node-aio/playbooks/deploy-dhcp.yml @@ -36,7 +36,7 @@ update_cache: yes cache_valid_time: 600 register: _install_host_packages - until: _install_host_packages | success + until: _install_host_packages is success retries: 3 delay: 15 diff --git a/multi-node-aio/playbooks/deploy-pxe.yml b/multi-node-aio/playbooks/deploy-pxe.yml index 3f1f44bd..0b2bb4b9 100644 --- a/multi-node-aio/playbooks/deploy-pxe.yml +++ b/multi-node-aio/playbooks/deploy-pxe.yml @@ -38,7 +38,7 @@ update_cache: yes cache_valid_time: 600 register: _install_host_packages - until: _install_host_packages | success + until: _install_host_packages is success retries: 3 delay: 15 diff --git a/multi-node-aio/playbooks/openstack-service-setup.yml b/multi-node-aio/playbooks/openstack-service-setup.yml index 2dd3091f..a816eccf 100644 --- a/multi-node-aio/playbooks/openstack-service-setup.yml +++ b/multi-node-aio/playbooks/openstack-service-setup.yml @@ -110,7 +110,7 @@ - create_networks # Install some Linux system images - - include: ./openstack-image-setup.yml + - include_tasks: "{{ playbook_dir }}/openstack-image-setup.yml" with_items: "{{ images }}" tags: - create_images diff --git a/multi-node-aio/playbooks/setup-host.yml b/multi-node-aio/playbooks/setup-host.yml index 23a9368e..e79be44c 100644 --- a/multi-node-aio/playbooks/setup-host.yml +++ b/multi-node-aio/playbooks/setup-host.yml @@ -38,7 +38,7 @@ update_cache: yes cache_valid_time: 600 register: _install_required_host_packages - until: _install_required_host_packages | success + until: _install_required_host_packages is success retries: 3 delay: 15 when: @@ -63,12 +63,12 @@ apt: update_cache: yes register: _update_apt_cache - until: _update_apt_cache | success + until: _update_apt_cache is success retries: 3 delay: 15 when: - "ansible_os_family == 'Debian'" - - "_add_apt_repo | changed" + - "_add_apt_repo is changed" - name: Install host distro packages package: @@ -77,7 +77,7 @@ update_cache: yes cache_valid_time: 600 register: _install_host_packages - until: _install_host_packages | success + until: _install_host_packages is success retries: 3 delay: 15 @@ -213,7 +213,7 @@ - name: Set the host intefaces up command: "/sbin/ifup {{ item.value.iface }}" with_dict: "{{ mnaio_host_networks }}" - when: mnaio_bridges | changed + when: mnaio_bridges is changed - name: Disable virsh default network shell: | diff --git a/multi-node-aio/playbooks/site.yml b/multi-node-aio/playbooks/site.yml index dffc83dd..64bcd612 100644 --- a/multi-node-aio/playbooks/site.yml +++ b/multi-node-aio/playbooks/site.yml @@ -13,30 +13,30 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include: setup-host.yml +- import_playbook: setup-host.yml when: - setup_host | default(true) | bool -- include: deploy-acng.yml +- import_playbook: deploy-acng.yml when: - setup_pxeboot | default(true) | bool -- include: deploy-pxe.yml +- import_playbook: deploy-pxe.yml when: - setup_pxeboot | default(true) | bool -- include: deploy-dhcp.yml +- import_playbook: deploy-dhcp.yml when: - setup_dhcpd | default(true) | bool -- include: deploy-vms.yml +- import_playbook: deploy-vms.yml when: - deploy_vms | default(true) | bool -- include: deploy-osa.yml +- import_playbook: deploy-osa.yml when: - deploy_osa | default(true) | bool -- include: openstack-service-setup.yml +- import_playbook: openstack-service-setup.yml when: - configure_openstack | default(true) | bool