βš™οΈ Ansible

Ansible is the automation framework used to manage virtual machine operations across the homelab environment. It enables:

By leveraging Ansible, infrastructure tasks become streamlined, repeatable, and maintainable.


πŸ—‚ Core Concepts

Playbooks

Each playbook defines a set of automation tasks and includes its own README.md. A consolidated Playbook Index is available in the playbooks/ folder.

Roles

Roles modularize playbooks into reusable components and include their own README.md. A consolidated Role Index is available in the roles/ folder.

Inventories

Inventories define the hosts and groups targeted by playbooks and include their own README.md. A consolidated Inventory Index is available in the inventory/ folder.

πŸ’‘ For all documentation workflows, see Documenting Ansible.


πŸ”‘ Privileged Execution (Become User)

Ansible uses a controlled privilege model:

This ensures controlled access while maintaining operational flexibility.


πŸ–₯ Control Nodes

Two Ansible control nodes orchestrate automation tasks.

For a complete guide on configuring an Ansible node, πŸ‘‰ see Configuring an Ansible Control Node

Working on a Control Node

After connecting (e.g., via SSH), initialize your environment:

source /opt/python_3.12/bin/activate
cd ~/ansible
git pull

This ensures you are working with the latest codebase and dependencies. For repository organization,

πŸ‘‰ see Ansible Directory Structure & Conventions.

πŸ’‘ Tip: Playbooks can also be executed through Semaphore UI, a web interface for managing inventories, credentials, and runs.

Deploying or Updating Ansible

To install or update Ansible on a control node:

INV=inventory/ansible/inventory.ini
ansible-playbook -k -i $INV playbooks/ansible/deploy_ansible.yml

This keeps control nodes consistent and up to date.


πŸ—‚ Documentation Map