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 <noreply@anthropic.com>
This commit is contained in:
commit
c781ec25a2
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
# Variables applied to all hosts
|
||||
# ansible_user: your_ssh_user
|
||||
# ansible_become: true
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue