refactor: split ansible book into roles

This commit is contained in:
Alexander Navarro 2024-12-10 11:31:46 -03:00
parent 89a7bfa789
commit 22d7e4a318
14 changed files with 983 additions and 215 deletions

View file

@ -1,18 +1,19 @@
export ANSIBLE_VAULT_PASSWORD_FILE := "./.decrypt-pass.txt"
inventory := "./hosts/inventory.ini"
export ANSIBLE_VAULT_PASSWORD_FILE := ".decrypt-pass.txt"
play +ARGS:
ansible-playbook -i {{ inventory }} {{ ARGS }}
ansible-playbook {{ ARGS }}
ansible +ARGS:
ansible -i {{ inventory }} {{ ARGS }}
ansible {{ ARGS }}
list-host:
ansible-inventory -i {{ inventory }} --list
ansible-inventory --list
encrypt +ARGS:
ansible-valut encrypt {{ ARGS }}
ansible-vault encrypt {{ ARGS }}
encrypt-var NAME +CONTENT='':
ansible-vault encrypt_string {{ if CONTENT != "" {"--name"} else {"--stdin-name"} }} {{ NAME }} {{ CONTENT }}
decrypt +ARGS:
ansible-vault edit {{ ARGS }}