xxxxxxxxxx
Suppose you have a task that you don’t want to show the output or command
given to it when using -v (verbose) mode, the following task can be used to do it:
1
1
1 1- name: secret task
2shell: /usr/bin/do_something --value={{ secret_value }}
3no_log: True
1
This can be used to keep verbose output but hide sensitive information from others
who would otherwise like to be able to see the output.
The no_log attribute can also apply to an entire play:
1
1 1- hosts: all
2no_log: True
1
xxxxxxxxxx
If you want to keep secret data but still be able to share it publicly,
then use Vault in playbooks. But if you’re using –v (verbose) mode
and don’t want anyone to see the results, then use:
name: secret task
shell: /usr/bin/do_something --value={{ secret_value }}
no_log: True