Run os-net-config on step 3

In some cases such as RHEL7>RHEL8 upgrade leapp or NetworkManager may
change resolv.conf. This patch invokes os-net-config on step3 to ensure
that network parts are configured properly (interfaces, resolv.conf).
Since os-net-config is idempotant it causes no harm or packet loss to
undercloud.

Change-Id: I0b2f28cd3d92795802e51c69d975826af0ee86ee
Resolves: rhbz#1870617
This commit is contained in:
Sergii Golovatiuk 2020-11-24 22:22:59 +01:00
parent a9310c29a1
commit b861dd8fb9
1 changed files with 16 additions and 0 deletions

View File

@ -81,6 +81,22 @@ outputs:
name: '*'
state: latest
exclude: ansible
- name: Check that os-net-config has configuration
when: step|int == 3
stat:
path: /etc/os-net-config/config.json
get_attributes: false
get_checksum: false
get_mime: false
register: stat_config_json
- name: take new os-net-config parameters into account now
when:
- step|int == 3
- stat_config_json.stat.exists
command: os-net-config --no-activate -c /etc/os-net-config/config.json -v --detailed-exit-codes
register: os_net_config_upgrade
failed_when: os_net_config_upgrade.rc not in [0,2]
changed_when: os_net_config_upgrade.rc == 2
# Keepalived was deprecated and the VIPs are now deployed by
# os-net-config.
# When Keepalived is stopped, it brings down the VIPs which is