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 cfc6dac882)
This commit is contained in:
Emilien Macchi 2020-06-05 11:28:24 -04:00
parent 54361fe1d7
commit cac2eff0c2
1 changed files with 6 additions and 0 deletions

View File

@ -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