Ansible will hide your passwords only if you are using a specific set of keys. However, this might not be the case every time; moreover, you might also want to hide some other confidential data. The no_log feature of Ansible will hide your entire task from logging it to the syslog file. It will still print your task on stdout and log it to other Ansible log files.
At the time of writing this book, Ansible did not support hiding tasks from stdout using no_log.
Let's now see how you can hide an entire task with no_log:
- name: Running a script shell: script.sh
password: my_password no_log: True
By passing no_log: True to your task, Ansible will prevent the entire task from hitting syslog.