Interview Prep/Ansible/Playbook Design, Handlers and Idempotency

A task prints a password in the logs. How do you stop that?

BeginnerScenarioPlaybook Design, Handlers and Idempotency
Answer

Situation read → Secret exposure in output.

What I'd do →

- ansible.builtin.user:
    name: svc
    password: "{{ svc_pw | password_hash('sha512') }}"
  no_log: true

Why → no_log: true hides the task's arguments and results, including from -v output.

Interview tip → It also hides errors; toggle it off briefly in a safe environment to debug.

All Ansible questions Roadmap: Ansible

More on Playbook Design, Handlers and Idempotency