adding playbooks
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user