
These changes ensure that a standalone node is in the correct state for reconfiguration (for DC enrollment) after a successful factory-install. This is achieved by ensuring: - Factory install services are cleaned up. - Cloud-init services remain enabled and active. To facilitate enrollment initialization, two new scripts are being introduced in the platform-util package: 1. enroll-init-cleanup: Removes the cloud-init preset set by factory-install and sets service disabled flag. 2. enroll-init-reconfigure: A newly introduced script that allows OAM and password reconfiguration, ensuring: - The password change is done after system services are active. - OAM reconfiguration is done via system commands. This is required as outlined in https://review.opendev.org/c/starlingx/distcloud/+/921719 These scripts must be independent of the factory-install services and available on the platform for DCManager operations. Hence, they are not part of factory-install services but are included in the platform-util package. Additionally, a minor restructuring of factory-install services is done as part of these changes: - Moved the host config folder to the parent folder. This is more appropriate as the top-level folder already holds the cloud-init configurable files. The factory-install folder is meant for the static service files. - Introduced a utils folder/scripts for the factory-install services. Test plan: - PASS: Validate factory-install services: - config files copied correctly to home dir - factory install utils copied to /var/lib/factory-install dir - cloud-init preset after successful install - factory install services cleaned up - PASS: Validate full factory install - PASS: Build iso and install load to ensure platform-util package is installed with enroll-init-cleanup and enroll-init-reconfigure scripts in /usr/local/bin - PASS: Validate enroll-init-cleanup and enroll-init-reconfigure scripts: - Password persisted and OAM reconfiguration verified with system oam-show + endpoints updated - cloud-init services disabled (not restarted on reboot) Story: 2011100 Task: 50164 Change-Id: I9a99c53c6fe6590716ad3d5d59663c8e6c475db5 Signed-off-by: Salman Rana <salman.rana@windriver.com>
32 lines
755 B
Bash
Executable File
32 lines
755 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2024 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Factory install system health checks triggered during the tests stage
|
|
#
|
|
# SAMPLE ONLY - REPLACE WITH REAL SYSTEM HEALTH CHECKS
|
|
#
|
|
|
|
|
|
echo "System Health Checks - Start"
|
|
|
|
log_failure () {
|
|
echo "FAIL: $1"
|
|
exit ${2}
|
|
}
|
|
|
|
# check for service impacting alarms
|
|
source /etc/platform/openrc
|
|
fm --timeout 10 alarm-list --nowrap|grep -e "major\|minor\|warning\|critical"
|
|
if [ $? == 0 ]; then
|
|
# Log the health check failure and exit 0 to allow factory-install to finish up.
|
|
# Modify to exit 1 if factory-install should retry check until success.
|
|
log_failure "service impacting alarms present" 0
|
|
fi
|
|
|
|
echo "System Health Checks - Complete"
|
|
|
|
exit 0
|