config/controllerconfig/controllerconfig/scripts
Jagatguru Prasad Mishra 4f4cc4c847 Avoid copying symlink content to fix sanity issue
During ansible bootstrap, encryption-provider.yaml was copied to
'/opt/platform/config/<version>/kubernetes' directory from
'/etc/kubernetes'. After supporting luks volume, this file is moved
to the luks volume and symlink is created at '/etc/kubernetes'
and '/opt/platform/config/<version>/kubernetes' pointing to
encryption-provider.yaml file in the luks volume.

After ansible bootstrap completes, controllerconfig service tries to
copy the files from '/opt/platform/config/<version>/kubernetes' to
'/etc/kubernetes'. So it tries to copy encryption-provider.yaml as
well which is a symlink of a file in luks volume.

This change adds an argument '-P' to to the 'cp'
command which avoid copying the source content from the symlink
pointing to the luks volume. This change is required as the
luks volume may not be accessible while it is getting copied.
The directory for which this '-P' option is applied contains
only one symlink which is 'encryption-provider.yaml', so there
is no negative impact.

Test Plan:
PASS: build-pkgs -c -p controllerconfig
PASS: AIO-SX bootstrap should pass and host should come to
      unlocked/enabled/available state
PASS: Verify if a symlink encryption-provider.yaml is copied at
      '/etc/kubernetes/' location after host-unlock.
PASS: Verify if the below file is accessible
      /var/luks/stx/luks_fs/controller/etc/kubernetes/
      encryption-provider.yaml from symlink in
      /etc/kubernetes/
PASS: Standard setup- Verify if a symlink encryption-provider.yaml
      is copied at '/etc/kubernetes/' on both controllers.
PASS: Standard setup- Verify if a symlink encryption-provider.yaml
      is present at '/opt/platform/config/<version>/kubernetes/'
      on conroller-1 after 'system host-swact 1'
PASS: Standard setup- lock/unlock controller-1. Check if puppet
      mainfest is executed succesfully on controller-1 after reboot.
      Controller should come to unlocked/enabled/available state.
PASS: Standard setup- lock/unlock controller-0. Check if puppet
      mainfest is executed succesfully on controller-0 after reboot.
      Controller should come to unlocked/enabled/available state.

Depends-on: https://review.opendev.org/c/starlingx/ansible-playbooks/+/904342

Story: 2010873
Task: 49323

Change-Id: I8e064fc0e7a6fc8a0b571673fe8f6e66e4e43aee
Signed-off-by: Jagatguru Prasad Mishra <jagatguruprasad.mishra@windriver.com>
2023-12-28 13:18:49 +00:00
..
00-sample-migration.py controllerconfig: remove /usr/bin/env 2019-10-16 14:55:27 -07:00
00-sample-migration.sh Fixing linters errors E010, E011, E020, E041,E043, E003, E001,E042 2018-09-11 21:47:40 +08:00
config_goenabled_check.sh Fixing linters errors E010, E011, E020, E041,E043, E003, E001,E042 2018-09-11 21:47:40 +08:00
controller_config Avoid copying symlink content to fix sanity issue 2023-12-28 13:18:49 +00:00
controllerconfig.service Avoid copying symlink content to fix sanity issue 2023-12-28 13:18:49 +00:00
image-backup.sh B&R: Fix openstack helper scripts for B&R 2020-11-04 14:53:03 +02:00
openstack_update_admin_password StarlingX open source release updates 2018-05-31 07:35:52 -07:00
sysinv-service-restart.sh Add ZeroMQ RPC backend 2022-11-24 13:28:01 -03:00
upgrade_swact_migration.py Limit etcd migration to swact actions 2021-05-06 10:09:22 -05:00