commit c781ec25a26683f5d4ef00394e1ca528fdf4f5ca Author: directlx Date: Wed Feb 4 06:37:33 2026 -0500 Initial Ansible project structure Set up standard directory layout with: - ansible.cfg with sensible defaults - YAML inventory with example groups - Main site playbook template - Directories for roles, group_vars, host_vars, files, templates - .gitignore for secrets, vault files, and SSH keys Co-Authored-By: Claude Opus 4.5 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e5f0b9d --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Ansible +*.retry +*.pyc +__pycache__/ + +# Sensitive files +*.vault +*vault*.yml +!*vault*.yml.example +secrets/ +.vault_pass +.vault_password + +# SSH keys +*.pem +*.key +id_rsa* +id_ed25519* + +# Environment +.env +*.env.local +venv/ +.venv/ + +# IDE +.idea/ +.vscode/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +logs/ + +# Temporary files +tmp/ +.tmp/ +*.tmp +*.bak diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..c6423da --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,17 @@ +[defaults] +inventory = inventory/hosts.yml +roles_path = roles +host_key_checking = False +retry_files_enabled = False +stdout_callback = yaml +callbacks_enabled = profile_tasks + +[privilege_escalation] +become = True +become_method = sudo +become_user = root +become_ask_pass = False + +[ssh_connection] +pipelining = True +ssh_args = -o ControlMaster=auto -o ControlPersist=60s diff --git a/files/.gitkeep b/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/group_vars/all.yml b/group_vars/all.yml new file mode 100644 index 0000000..b42e21b --- /dev/null +++ b/group_vars/all.yml @@ -0,0 +1,4 @@ +--- +# Variables applied to all hosts +# ansible_user: your_ssh_user +# ansible_become: true diff --git a/host_vars/.gitkeep b/host_vars/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/inventory/hosts.yml b/inventory/hosts.yml new file mode 100644 index 0000000..5ab2eba --- /dev/null +++ b/inventory/hosts.yml @@ -0,0 +1,18 @@ +--- +all: + children: + # Example group structure - customize as needed + webservers: + hosts: + # web1: + # ansible_host: 192.168.1.10 + + dbservers: + hosts: + # db1: + # ansible_host: 192.168.1.20 + + local: + hosts: + localhost: + ansible_connection: local diff --git a/playbooks/site.yml b/playbooks/site.yml new file mode 100644 index 0000000..08f918c --- /dev/null +++ b/playbooks/site.yml @@ -0,0 +1,16 @@ +--- +# Main site playbook - orchestrates all plays +- name: Apply common configuration + hosts: all + roles: [] + # - common + +# - name: Configure web servers +# hosts: webservers +# roles: +# - webserver + +# - name: Configure database servers +# hosts: dbservers +# roles: +# - database diff --git a/roles/.gitkeep b/roles/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/templates/.gitkeep b/templates/.gitkeep new file mode 100644 index 0000000..e69de29