From 577917e7c81d7d1706b98b10d90370999bcf4083 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 19 Feb 2019 11:27:37 +0100 Subject: [PATCH] Clearly a better way to do Ansible --- README.md | 9 +++------ ansible.cfg | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 ansible.cfg diff --git a/README.md b/README.md index 2962238..ef8e065 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,12 @@ ## Exécution d'un playbook -Pour tester : +Pour appliquer le playbook `base.yml` : ```bash -ansible-playbook --ask-vault-pass -bK -i hosts base.yml --check --diff +ansible-playbook --ask-vault-pass base.yml ``` -Pour appliquer : -```bash -ansible-playbook --ask-vault-pass -bK -i hosts base.yml -``` +Il est souhaitable de faire un test avant avec `--check` si on a des doutes ! ## FAQ diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..f73c0f5 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,26 @@ +# Aurore Ansible configuration + +[defaults] + +# Use Aurore inventory +inventory = ./hosts + +# Custom header in templates +ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host} + +# Do not use cows (with cowsay) +nocows = 1 + +[privilege_escalation] + +# Use sudo to get priviledge access +become = True + +# Ask for password +become_ask_pass = True + +[diff] + +# TO know what changed +always = yes +