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.
This commit is contained in:
22
tasks/update_roles.sh
Normal file
22
tasks/update_roles.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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."
|
||||
Reference in New Issue
Block a user