Special treatment for os-net-config upgrade.

We make sure to run upgrade and run os-net-config on its own.  Running
os-net-config with the no-activate option will
 - prevent the restart of the interface
 - adjust the network files to the expected configuration so that next
 run won't restart the network.

Eventually at next reboot the change will be taken into account.
Currently we have no change that are required to be taken live during
the upgrade so it safe to ignore the new parameters.

Closes-Bug: #1721073
Change-Id: I51464274d5dff8a267992ae303ac3517b78d08fb
This commit is contained in:
Sofer Athlan-Guyot 2017-10-03 17:59:19 +02:00
parent e1a9638732
commit 5aab25bb68

@ -53,6 +53,15 @@ outputs:
fail: msg="rpm-python package was not present before this run! Check environment before re-running"
when: rpm_python_check.changed != false
tags: step0
- block:
- name: Upgrade os-net-config
yum: name=os-net-config state=latest
- name: take new os-net-config parameters into account now
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
tags: step3
- name: Update all packages
tags: step3
yum: name=* state=latest