Ansible Quick-Start Checklist

This page provides a concise onboarding guide. It complements the Ansible Overview & Usage and Directory Structure & Conventions by serving as a one‑page reference for essential commands.


Checking Out the Code from GitHub

Before working with Ansible, clone the repository and keep it up to date:

# Clone the repository (first time)
git clone https://github.com/t3knoid/ansible.git
cd ansible

# Update to the latest version (subsequent use)
git pull

Notes:


Environment Setup

  1. Connect to a control node (e.g., via SSH).
  2. Activate Python environment:
    source /opt/python_3.12/bin/activate
    
  3. Navigate to the Ansible repository:
    cd ~/ansible
    
  4. Update to the latest codebase:
    git pull
    
  5. Create vault password file (.vault_pass.txt)

    Create the file ~/.vault_pass.txt. Paste the vault password in this file and save it.

    vi ~/.vault_pass.txt
    

Deploy or Update Ansible

Run the following command to deploy or update Ansible:

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

Test Ansible

 ansible -k all -i 127.0.0.1, -m ping

This should get the following response when successful.

127.0.0.1 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

Common Playbooks

| Playbook | Purpose | |β€”β€”β€”-|β€”β€”β€”| | provision_vm.yml | Provision a new virtual machine | | deploy_code_server.yml | Deploy Code Server IDE |


Privileged Execution


Alternative Execution via Semaphore UI

πŸ’‘ As an alternative to running playbooks from the console, you can use Semaphore UI for a simplified web interface. It provides a dashboard for managing inventories, credentials, and playbook runs.


Quick Reference Diagram

Workflow:
Clone Repo β†’ SSH β†’ Activate Python β†’ Pull Repo β†’ Run Playbook β†’ (Optional) Manage via Semaphore UI