From cac2eff0c2ea76d36efc79575e0090519b7e8cb9 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 5 Jun 2020 11:28:24 -0400 Subject: [PATCH] Fix dry-run for NetworkConfig tasks Do not run the NetworkConfig script in check mode, and the next tasks will be skipped as well. Change-Id: Ie5dc774509c31effe9f90f7f22c0394eee0b7746 (cherry picked from commit cfc6dac882153992ba069f304b044f3d5c823cde) --- common/deploy-steps.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 2df79fef5c..4824cff680 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -574,17 +574,23 @@ outputs: bridge_name: "{{ neutron_physical_bridge_name }}" interface_name: "{{ neutron_public_interface_name }}" register: NetworkConfig_result + when: + - not ansible_check_mode failed_when: NetworkConfig_result.rc is not defined - name: Write rc of NetworkConfig script copy: content: "{{ NetworkConfig_result.rc }}" dest: /var/lib/tripleo-config/os-net-config.returncode + when: + - NetworkConfig_result.rc is defined - name: NetworkConfig stdout debug: var: NetworkConfig_result.stderr_lines failed_when: NetworkConfig_result.rc != 0 + when: + - NetworkConfig_result.rc is defined # os-net-config currently relies on the legacy network # so we need to ensure it's enabled on boot. This should