From b9dcee028795bb1132176df7ef3f435039cc20cb Mon Sep 17 00:00:00 2001 From: Sofer Athlan-Guyot Date: Tue, 8 Nov 2016 16:44:26 +0100 Subject: Ensure keepalived is restarted when necessary. If os-collect-config/config.json is updated before an upgrade/update, then the os-net-config run will automatically erase the keepalived managed ips. This is a hackish way to ensure that keepalived is restarted during the next phase in order to have the ip recreated. It basically adds a comment line to the keepalived.conf file (making it different than the puppet one) if it's there. This will force a puppet restart of the keepalive service puting the ips back on the undercloud. Change-Id: I56b706ff44ba31aa87a63f870940831ce02a6e77 Closes-Bug: #1640213 Related-Bug: #1638029 --- manifests/network/os_net_config.pp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/manifests/network/os_net_config.pp b/manifests/network/os_net_config.pp index 7e07f6c..3283b5f 100644 --- a/manifests/network/os_net_config.pp +++ b/manifests/network/os_net_config.pp @@ -30,6 +30,17 @@ class tripleo::network::os_net_config { Package['openvswitch'], Service['openvswitch'], ], + notify => Exec['trigger-keepalived-restart'], } + # By modifying the keepalived.conf file we ensure that puppet will + # trigger a restart of keepalived during the main stage. Adding back + # any lost conf during the os-net-config step. + exec { 'trigger-keepalived-restart': + command => '/usr/bin/echo "# Restart keepalived" >> /etc/keepalived/keepalived.conf', + path => '/usr/bin:/bin', + refreshonly => true, + # Only if keepalived is installed + onlyif => 'test -e /etc/keepalived/keepalived.conf', + } } -- cgit 1.2.3-korg