From 7341ced88f284e8a1790e6f6efec7ec01c374fc3 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 24 May 2018 17:30:39 +0100 Subject: [PATCH] Fix Ansible warnings for use of until with {{ }} As for 'when' clauses, 'until' should no longer use brackets, lest you receive a written warning from Ansible. TrivialFix Change-Id: I1f10092ce283d288ae75600c4d0a450697b37c9f --- ansible/overcloud-deprovision.yml | 4 ++-- ansible/overcloud-hardware-inspect.yml | 6 +++--- ansible/overcloud-provision.yml | 6 +++--- ansible/roles/drac-boot-mode/tasks/main.yml | 6 +++--- ansible/roles/drac-pxe/tasks/main.yml | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ansible/overcloud-deprovision.yml b/ansible/overcloud-deprovision.yml index 956e1a5cb..79f38463e 100644 --- a/ansible/overcloud-deprovision.yml +++ b/ansible/overcloud-deprovision.yml @@ -81,7 +81,7 @@ -m command -a "ironic node-set-provision-state {% raw %}{{ inventory_hostname }}{% endraw %} deleted"' register: delete_result - until: "{{ delete_result | success or 'is locked by host' in delete_result.stdout }}" + until: delete_result | success or 'is locked by host' in delete_result.stdout retries: "{{ ironic_retries }}" delay: "{{ ironic_retry_interval }}" when: initial_provision_state != 'available' @@ -109,7 +109,7 @@ -a "openstack baremetal node show {% raw %}{{ inventory_hostname }}{% endraw %} -f value -c provision_state"' register: show_result # Wait until the node is no longer in one of the deleting states. - until: "{{ not show_result.stdout_lines[1:] | intersect(deleting_states) }}" + until: not show_result.stdout_lines[1:] | intersect(deleting_states) retries: "{{ wait_available_timeout // wait_available_interval }}" delay: "{{ wait_available_interval }}" when: diff --git a/ansible/overcloud-hardware-inspect.yml b/ansible/overcloud-hardware-inspect.yml index 56ff28099..3af3e14ee 100644 --- a/ansible/overcloud-hardware-inspect.yml +++ b/ansible/overcloud-hardware-inspect.yml @@ -74,7 +74,7 @@ -m command -a "ironic node-set-provision-state {% raw %}{{ inventory_hostname }}{% endraw %} manage"' register: manage_result - until: "{{ manage_result | success or 'is locked by host' in manage_result.stdout }}" + until: manage_result | success or 'is locked by host' in manage_result.stdout retries: "{{ ironic_retries }}" delay: "{{ ironic_retry_interval }}" when: initial_provision_state != 'manageable' @@ -98,7 +98,7 @@ -m command -a "ironic node-set-provision-state {% raw %}{{ inventory_hostname }}{% endraw %} inspect"' register: provide_result - until: "{{ provide_result | success or 'is locked by host' in provide_result.stdout }}" + until: provide_result | success or 'is locked by host' in provide_result.stdout retries: "{{ ironic_retries }}" delay: "{{ ironic_retry_interval }}" delegate_to: "{{ seed_host }}" @@ -124,7 +124,7 @@ -a "openstack baremetal node show {% raw %}{{ inventory_hostname }}{% endraw %} -f value -c provision_state"' register: show_result # Wait until the node is no longer in one of the inspecting states. - until: "{{ not show_result.stdout_lines[1:] | intersect(inspecting_states) }}" + until: not show_result.stdout_lines[1:] | intersect(inspecting_states) retries: "{{ wait_inspected_timeout // wait_inspected_interval }}" delay: "{{ wait_inspected_interval }}" when: wait_inspected | bool diff --git a/ansible/overcloud-provision.yml b/ansible/overcloud-provision.yml index 940e2cb73..9098affc7 100644 --- a/ansible/overcloud-provision.yml +++ b/ansible/overcloud-provision.yml @@ -84,7 +84,7 @@ -m command -a "ironic node-set-provision-state {% raw %}{{ inventory_hostname }}{% endraw %} manage"' register: manage_result - until: "{{ manage_result | success or 'is locked by host' in manage_result.stdout }}" + until: manage_result | success or 'is locked by host' in manage_result.stdout retries: "{{ ironic_retries }}" delay: "{{ ironic_retry_interval }}" when: initial_provision_state == 'enroll' @@ -108,7 +108,7 @@ -m command -a "ironic node-set-provision-state {% raw %}{{ inventory_hostname }}{% endraw %} provide"' register: provide_result - until: "{{ provide_result | success or 'is locked by host' in provide_result.stdout }}" + until: provide_result | success or 'is locked by host' in provide_result.stdout retries: "{{ ironic_retries }}" delay: "{{ ironic_retry_interval }}" when: initial_provision_state in ['enroll', 'manageable'] @@ -165,7 +165,7 @@ -a "openstack baremetal node show {% raw %}{{ inventory_hostname }}{% endraw %} -f value -c provision_state"' register: show_result # Wait until the node is no longer in one of the deploying states. - until: "{{ not show_result.stdout_lines[1:] | intersect(deploying_states) }}" + until: not show_result.stdout_lines[1:] | intersect(deploying_states) retries: "{{ wait_active_timeout // wait_active_interval }}" delay: "{{ wait_active_interval }}" when: diff --git a/ansible/roles/drac-boot-mode/tasks/main.yml b/ansible/roles/drac-boot-mode/tasks/main.yml index 86c34876d..c94d3e166 100644 --- a/ansible/roles/drac-boot-mode/tasks/main.yml +++ b/ansible/roles/drac-boot-mode/tasks/main.yml @@ -30,7 +30,7 @@ raw: "racadm set BIOS.BiosBootSettings.BootMode {{ drac_boot_mode | lower | capitalize }}" register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_boot_mode_busy_message not in result.stdout }}" + until: drac_boot_mode_busy_message not in result.stdout retries: "{{ drac_boot_mode_retries }}" delay: "{{ drac_boot_mode_interval }}" @@ -38,7 +38,7 @@ raw: "racadm jobqueue create BIOS.Setup.1-1 -s TIME_NOW" register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_boot_mode_busy_message not in result.stdout }}" + until: drac_boot_mode_busy_message not in result.stdout retries: "{{ drac_boot_mode_retries }}" delay: "{{ drac_boot_mode_interval }}" @@ -57,7 +57,7 @@ raw: "racadm jobqueue view -i {{ drac_boot_mode_bios_job_id }}" register: result failed_when: "'ERROR' in result.stdout" - until: "{{ 'Status=Completed' in result.stdout }}" + until: "'Status=Completed' in result.stdout" retries: "{{ drac_boot_mode_timeout // drac_boot_mode_interval }}" delay: "{{ drac_boot_mode_interval }}" diff --git a/ansible/roles/drac-pxe/tasks/main.yml b/ansible/roles/drac-pxe/tasks/main.yml index 8b41c68f3..cf8d51382 100644 --- a/ansible/roles/drac-pxe/tasks/main.yml +++ b/ansible/roles/drac-pxe/tasks/main.yml @@ -83,7 +83,7 @@ when: item.current != item.required register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_pxe_busy_message not in result.stdout }}" + until: drac_pxe_busy_message not in result.stdout retries: "{{ drac_pxe_retries }}" delay: "{{ drac_pxe_interval }}" @@ -93,7 +93,7 @@ when: item.current != item.required register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_pxe_busy_message not in result.stdout }}" + until: drac_pxe_busy_message not in result.stdout retries: "{{ drac_pxe_retries }}" delay: "{{ drac_pxe_interval }}" @@ -128,7 +128,7 @@ raw: "racadm set BIOS.PxeDev1Settings.PxeDev1Interface NIC.Integrated.1-{{ drac_pxe_interface }}-1" register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_pxe_busy_message not in result.stdout }}" + until: drac_pxe_busy_message not in result.stdout retries: "{{ drac_pxe_retries }}" delay: "{{ drac_pxe_interval }}" when: current_pxe_interface != required_pxe_interface @@ -144,7 +144,7 @@ raw: "racadm set BIOS.BiosBootSettings.BootSeq {{ drac_pxe_bios_boot_sequence }}" register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_pxe_busy_message not in result.stdout }}" + until: drac_pxe_busy_message not in result.stdout retries: "{{ drac_pxe_retries }}" delay: "{{ drac_pxe_interval }}" when: current_boot_sequence != required_boot_sequence @@ -158,7 +158,7 @@ raw: "racadm jobqueue create BIOS.Setup.1-1 -s TIME_NOW" register: result failed_when: "'ERROR' in result.stdout" - until: "{{ drac_pxe_busy_message not in result.stdout }}" + until: drac_pxe_busy_message not in result.stdout retries: "{{ drac_pxe_retries }}" delay: "{{ drac_pxe_interval }}" when: bios_job_required @@ -181,6 +181,6 @@ when: job_ids | length > 0 register: result failed_when: "'ERROR' in result.stdout" - until: "{{ 'Status=Completed' in result.stdout }}" + until: "'Status=Completed' in result.stdout" retries: "{{ drac_pxe_timeout // drac_pxe_interval }}" delay: "{{ drac_pxe_interval }}"