refactor: migrate to role-based variable management and blockinfile config
This commit is contained in:
11
bootstrap.sh
11
bootstrap.sh
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ARCHSETUP_REPO="${ARCHSETUP_REPO:-https://github.com/YOUR_USERNAME/archsetup}"
|
||||
ARCHSETUP_DIR="${ARCHSETUP_DIR:-$HOME/archsetup}"
|
||||
|
||||
echo "=== Arch Linux Hyprland Setup Bootstrap ==="
|
||||
echo ""
|
||||
|
||||
@@ -25,18 +28,18 @@ sudo pacman -Sy --noconfirm git ansible
|
||||
|
||||
# Step 3: Clone or update the repo
|
||||
echo "[3/4] Setting up archsetup..."
|
||||
if [ -d "$HOME/archsetup/.git" ]; then
|
||||
if [ -d "$ARCHSETUP_DIR/.git" ]; then
|
||||
echo "Updating archsetup..."
|
||||
cd "$HOME/archsetup"
|
||||
cd "$ARCHSETUP_DIR"
|
||||
git pull
|
||||
else
|
||||
echo "Cloning archsetup..."
|
||||
git clone https://github.com/YOUR_USERNAME/archsetup.git "$HOME/archsetup"
|
||||
git clone "$ARCHSETUP_REPO" "$ARCHSETUP_DIR"
|
||||
fi
|
||||
|
||||
# Step 4: Run the playbook
|
||||
echo "[4/4] Running Ansible playbook..."
|
||||
cd "$HOME/archsetup"
|
||||
cd "$ARCHSETUP_DIR"
|
||||
ansible-playbook site.yml
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user