Messing around with Ansible.
Run the playbook with the --check
flag to see if any changes would be required, e.g.:
ansible-playbook playbooks/setup-app.yaml --check
ansible-playbook playbooks/setup-app.yaml --tags upload
ansible-playbook playbooks/setup-app.yaml --tags create,upload
ansible-playbook playbooks/setup-app.yaml --skip-tags upload
Ansible Vault gives us a secure method of storing secrets; they will be encrypted with a password, and can then be checked in to source control.
ansible-vault create vars/secret-variables.yaml
ansible-vault view vars/secret-variables.yaml
This command by itself will no longer work, now that it is making use of the secret variables file which Ansible Vault has encrypted with a password:
ansible-playbook playbooks/setup-app.yaml
We must supply the --ask-vault-pass
flag and go through the subsequent password prompt in order to access the secret
variables encrypted into this file:
ansible-playbook playbooks/setup-app.yaml --ask-vault-pass