Avoid rsync failure in standby controller during patching

When patching the stdby controller the puppet manifest fails to
execute as rsync (luksdata module) is not available on primary
controller. So rsync get failed.

As part of the fix, we have added check on the return code from rsync
execution and puppet will continue its execution if return code is
0(sucess) or 5(unknown module).
rsync returns error-code - 5 for unknown module.

In this scenario, consistency of the luksdata between
active and standby will be assured by the push mechanism
on the active controller. And this pull mechanism is
useful in scenarios where new standby nodes are getting deployed.

Test Plan:
PASSED: AIO-DX: Patch back on 22.12 prestage iso.
PASSED: AIO-DX: System is stable after patching
PASSED: AIO-DX: After patching, rebooted standby controller, rsync
        Rebooted standby controller, rsync
PASSED: AIO-DX: After patching, system host lock controller-1,
        system host unlock controller-1, rsync is executed
        successfully from standby controller.

Story: 2010873
Task: 49557

Change-Id: Icd4b07e444191f5218a9e24e202fb068271d692e
Signed-off-by: Rahul Roshan Kachchap <rahulroshan.kachchap@windriver.com>
This commit is contained in:
Rahul Roshan Kachchap
2024-02-09 08:08:00 -05:00
parent 21ef780ecc
commit 8bcd6a5582

View File

@@ -627,6 +627,8 @@ class platform::filesystem::luks {
exec { 'rsync_luks_folder':
command => '/usr/bin/rsync -v -acv --delete rsync://controller/luksdata/ /var/luks/stx/luks_fs/controller/',
logoutput => true,
# Allow exit code 0 (success) and 5 (Unknown module)
returns => [0, 5],
onlyif => [ "test ${::controller_sw_versions_match} = true", '/usr/local/bin/connectivity_test -t 10 controller', ],
}
}