From 595c007ac24c646547ff389c4f102b4647f05820 Mon Sep 17 00:00:00 2001 From: Yuxing Jiang Date: Tue, 25 May 2021 15:10:52 -0500 Subject: [PATCH] Restart patching services after keystone_authtoken changes The patch services(sw-patch-agent and sw-patch-controller-daemon if the node is a controller) are expected to reload if the patching config changes. However, the subscription on File[$::patching::params::patching_conf] starts after the configuration of keystone_authtoken, which results the services still using the old configure. This commit applies the sw-patch-agent.service and sw-patch-controller-daemon.service to the Patching_config collector, so the services will be reloaded after any value in patching_config changes. Tests: 1 Installed and bootstrapped an AIO standalone system and a standard duplex subcloud. 2 Manually modify the keystone password configuration, lock/unlock the nodes, the start time of sw-patch-agent and sw-patch-controller-daemon are later than the timestamp of the configuration file. 3 Issue a "dcmanager subcloud add --migrate" command to migrate the subcloud to another central cloud, during the migration, the hieradata is aligned with the new central cloud, but the configuration on controller-1 remains. After lock/unlock the controller-1 in the subcloud, the subcloud can get managed and the patching_sync_status and load_sync_status can get in-sync Closes-Bug: 1929595 Signed-off-by: Yuxing Jiang Change-Id: I923c9e88c9b53d2ba4bf8fb43aa9dabf1bbb728e --- .../puppet-patching/src/patching/manifests/init.pp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/puppet-patching/src/patching/manifests/init.pp b/modules/puppet-patching/src/patching/manifests/init.pp index b41616c97..80998c44a 100644 --- a/modules/puppet-patching/src/patching/manifests/init.pp +++ b/modules/puppet-patching/src/patching/manifests/init.pp @@ -28,17 +28,15 @@ class patching ( 'runtime/agent_port': value => $agent_port; } - ~> service { 'sw-patch-agent.service': - ensure => 'running', - enable => true, - subscribe => File[$::patching::params::patching_conf], + Patching_config<||> ~> service { 'sw-patch-agent.service': + ensure => 'running', + enable => true, } if $::personality == 'controller' { - service { 'sw-patch-controller-daemon.service': - ensure => 'running', - enable => true, - subscribe => Service['sw-patch-agent.service'], + Patching_config<||> ~> service { 'sw-patch-controller-daemon.service': + ensure => 'running', + enable => true, } } }