Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove scape bash var kickstart #122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

silvinux
Copy link

The script 01-check-packages.sh referenced in the roles/setup_gitea/templates/rhde_gitops/production-kickstart.ks.j2 file should have the backslash removed before ${required_packages[@]} and $package variables. With the backslash, the array is treated as a string, adding the backslash to each package name. This prevents proper variable expansion, resulting in the literal string '$package' being passed to the rpm -q command instead of the actual package name. Consequently, the script fails to find the package and incorrectly reports that it is not installed. This cause that the non-k8s deployment greenboot health check fails always.

[pgoku@edge-manager-local ~]$ ssh [email protected]
[email protected]'s password: 
Script '01-check-packages.sh' FAILURE (exit code '1'). Continuing...
Boot Status is RED - Health Check FAILURE!
SYSTEM is UNHEALTHY, but boot_counter is unset in grubenv. Manual intervention necessary.
Last login: Sun Apr 14 11:17:03 2024 from 192.168.40.1

[root@edge-525400d153f9 required.d]# bash -x 01-check-packages.sh 
+ required_packages=("python3-pip" "python3-inotify" "git")
+ for package in "${required_packages[@]}"
+ rpm -q python3-pip
+ for package in "${required_packages[@]}"
+ rpm -q python3-inotify
+ for package in "${required_packages[@]}"
+ rpm -q git
+ echo 'All required packages are installed.'
All required packages are installed.

[root@edge-525400d153f9 required.d]# reboot
Connection to 192.168.40.30 closed by remote host.
Connection to 192.168.40.30 closed.

[pgoku@edge-manager-local ~]$ ssh [email protected]
[email protected]'s password: 
Boot Status is GREEN - Health Check SUCCESS
Last login: Sun Apr 14 11:25:29 2024 from 192.168.40.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant