-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13 wip add bootstap-server.sh helper script
- Loading branch information
1 parent
8f98dbb
commit d1b29e2
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
. ../venv/bin/activate | ||
|
||
set -x | ||
|
||
# Required environment settings | ||
# - IDRAC_HOST | ||
# - IDRAC_USERNAME | ||
# - IDRAC_PASSWORD | ||
|
||
|
||
# Check for required environment variables | ||
REQUIRED_VARS=("IDRAC_HOST" "IDRAC_USERNAME" "IDRAC_PASSWORD" "HOST_HEALTHCHECK_POLL_IP") | ||
for var in "${REQUIRED_VARS[@]}"; do | ||
if [ -z "${!var:-}" ]; then | ||
echo "Error: Required environment variable $var is not set." | ||
exit 1 | ||
fi | ||
done | ||
|
||
cd web-ui | ||
|
||
# Get server to a netbooted state (alpine) | ||
python3 -c "from app import execute_redfish_command; execute_redfish_command('Bootstrap')" | ||
|
||
# Run playbook to install fedora | ||
ansible-playbook -i src/inventory.yaml src/playbooks/servers.yaml | ||
|