refactor: migrate to role-based variable management and blockinfile config

This commit is contained in:
Tuan-Dat Tran
2026-03-22 23:46:42 +01:00
parent 222062c1a4
commit 4a1da18801
13 changed files with 146 additions and 93 deletions

View File

@@ -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 ""