Special treatment for os-net-config upgrade.
authorSofer Athlan-Guyot <sathlang@redhat.com>
Tue, 3 Oct 2017 15:59:19 +0000 (17:59 +0200)
committerAthlan-Guyot sofer <sathlang@redhat.com>
Mon, 9 Oct 2017 13:56:37 +0000 (13:56 +0000)
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
(cherry picked from commit 5aab25bb68f62b0d7e4ffdc20d4f4da1d82a76db)

puppet/services/tripleo-packages.yaml

index 2a8620c..0dbdbf8 100644 (file)
@@ -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