adding playbooks

This commit is contained in:
Ryan Toler
2026-03-02 07:38:20 +00:00
parent 83414466c8
commit 7198ec66be
9 changed files with 359 additions and 77 deletions

View File

@@ -55,23 +55,14 @@ log "=== Starting firstrun on ${HOSTNAME} ==="
# ---------- 3. Clone the repo ----------
if [[ ! -d "${APP_DIR}" ]]; then
log "Cloning repository to ${APP_DIR}"
git clone --depth 1 "${REPO_URL}" "${APP_DIR}" 2>&1 | tee -a "${LOG_FILE}"
else
log "App directory already exists – pulling latest changes"
cd "${APP_DIR}" && git pull origin main 2>&1 | tee -a "${LOG_FILE}"
fi
# ---------- 4. Run Ansible playbook (Docker setup) ----------
ANSIBLE_PLAYBOOK="${APP_DIR}/ansible/playbooks/setup-docker.yml"
# ---------- 4. Run Ansible playbook (lxc setup) ----------
ANSIBLE_PLAYBOOK="${APP_DIR}/ansible/playbooks/setup-lxc.yml"
if [[ ! -f "${ANSIBLE_PLAYBOOK}" ]]; then
error_exit "Ansible playbook not found: ${ANSIBLE_PLAYBOOK}"
fi
log "Running Ansible Docker‑setup playbook"
log "Running Ansible lxc‑setup playbook"
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook \
-i localhost, \
--connection=local \