Skip to content

Commit

Permalink
#13 wip add bootstap-server.sh helper script
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsimpson committed Nov 23, 2024
1 parent 8f98dbb commit d1b29e2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/bootstap-server.sh
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

0 comments on commit d1b29e2

Please sign in to comment.