From d1a2e1e7af9a980e1cdcbf0e1e3fc2e260ac5cef Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 16 Nov 2024 10:07:48 -0500 Subject: [PATCH] Add strap.sh --- strap.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 strap.sh diff --git a/strap.sh b/strap.sh new file mode 100644 index 0000000..3c56a55 --- /dev/null +++ b/strap.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Define the Salt Master address +SALT_MASTER="ingress.nixc.us" + +# Step 1: Download the Salt Bootstrap Script +echo "Downloading Salt Bootstrap Script..." +curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh -o /tmp/install_salt.sh + +# Step 2: Make the script executable +chmod +x /tmp/install_salt.sh + +# Step 3: Run the Bootstrap Script with specified options +echo "Installing Salt Minion and configuring master..." +sh /tmp/install_salt.sh -A "$SALT_MASTER" -P -x python3 stable + +# Step 4: Verify the Salt Minion Configuration +if grep -q "master: $SALT_MASTER" /etc/salt/minion; then + echo "Salt Minion successfully configured to connect to master: $SALT_MASTER" +else + echo "Error: Salt Minion configuration failed. Please check manually." + exit 1 +fi + +# Step 5: Restart the Salt Minion service +echo "Restarting Salt Minion service..." +systemctl restart salt-minion + +# Step 6: Check Salt Minion service status +echo "Checking Salt Minion service status..." +systemctl status salt-minion --no-pager + +# Script completed +echo "Salt Minion setup completed."