wait for server to connect, then provision

This commit is contained in:
2025-03-30 12:30:34 +00:00
parent 20e0a3995f
commit 435a7ac1e3
6 changed files with 107 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/bash
# [!server!]
# [!sudo_password!]
# [!hostname!] - server hostname
# [!sudo_password!] - the sudo password to set
# [!server_id!] - the servers id
apt_wait() {
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
@@ -52,8 +53,8 @@ if [ ! -d /root/.ssh ]; then
fi
# Set The Hostname If Necessary
echo "[!server!]" > /etc/hostname sed -i 's/127\.0\.0\.1.*localhost/127.0.0.1 [!server!].localdomain [!server!] localhost/' /etc/hosts
hostname [!server!]
echo "[!hostname!]" > /etc/hostname sed -i 's/127\.0\.0\.1.*localhost/127.0.0.1 [!hostname!].localdomain [!hostname!] localhost/' /etc/hosts
hostname [!hostname!]
# Setup Keystone User
useradd keystone
@@ -124,4 +125,4 @@ EOF
# Callback that the server is installed
curl --insecure --data "event_id=878&server_id=390&sudo_password=[!sudo_password!]&recipe_id=" https://keystone.test/provisioning/callback/app
curl --insecure --data "server_id=[!server_id!]&sudo_password=[!sudo_password!] https://keystone.test/provisioning/callback/app