Interview Prep/Ansible/Vault, Privilege Escalation and Error Handling

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.

All Ansible questions Roadmap: Ansible

More on Vault, Privilege Escalation and Error Handling