Files
ansible_samba_tasks/tasks/update_roles.sh
Jose b7f89f6312 refactor ♻️: Refactoring the tasks directory to include new roles and tasks.
The commit updates the `tasks` directory by adding new roles (`rapbian_desktop_prov.yml`, `test_remote.yml`, `update_roles.sh`) and tasks within these roles. This refactoring enhances the organization and maintainability of the Ansible playbook.
2025-10-09 18:30:11 +02:00

23 lines
732 B
Bash

#!/bin/bash
# Exit on any error
set -euo pipefail
# Define project root (one level up from tasks/)
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REQUIREMENTS_FILE="$PROJECT_ROOT/requirements.yml"
ROLES_DIR="$PROJECT_ROOT/roles"
# ANSIBLE_CFG="$PROJECT_ROOT/ansible.cfg"
echo "🔧 [INFO] Running deployment from: $PROJECT_ROOT"
echo "📦 [INFO] Installing roles from: $REQUIREMENTS_FILE"
# Step 1: Install roles
ansible-galaxy install -r "$REQUIREMENTS_FILE" -p "$ROLES_DIR"
# # Step 2: Run playbook
# echo "🚀 [INFO] Running playbook: $PLAYBOOK_FILE"
# ANSIBLE_CONFIG="$ANSIBLE_CFG" ansible-playbook "$PLAYBOOK_FILE" -i "$INVENTORY_DIR"
echo "✅ [SUCCESS] Roles updated successfully from requirements."