Ansible, by default, filters output that contains the login_password key, the password key, and the user:pass format. For example, if you are passing a password in your module using login_password or the password key, then Ansible will replace your password with VALUE_HIDDEN. Let's now see how you can hide a password using the password key:
- name: Running a script shell: script.sh password: my_password
In the preceding shell task, we use the password key to pass passwords. This will allow Ansible to hide it from stdout and its log file.
Now, when you run the preceding task in the verbose mode, you should not see your mypass password; instead Ansible, with VALUE_HIDDEN, will replace it as follows:
REMOTE_MODULE command script.sh password=VALUE_HIDDEN #USE_SHELL