What does `no_log: true` do and why is it important?
BeginnerConceptVault, Privilege Escalation and Error Handling
Answer
It hides a task's arguments and results from console output, callbacks and logs, replacing them with a censored message. Use it for any task handling passwords, tokens or private keys.
- ansible.builtin.user:
name: deploy
password: "{{ vault_deploy_password | password_hash('sha512', 'salt') }}"
no_log: true
The trade-off is that failures become hard to debug. Temporarily disable it in a safe environment, or set ANSIBLE_DISPLAY_ARGS_TO_STDOUT=false and be careful that -vvv can still reveal data in some cases.
More on Vault, Privilege Escalation and Error Handling
What is Ansible Vault?BeginnerWhich `ansible-vault` commands do you use day to day?BeginnerHow do you supply the vault password when running a playbook?BeginnerWhat is `encrypt_string` and when is it better than encrypting a whole file?IntermediateWhat are vault IDs and why use them?AdvancedHow is Vault data encrypted and what does the file look like?Advanced