Hide file contents when using the copy module.

54 views
Skip to first unread message

Julius Sediolano

unread,
Apr 3, 2017, 10:27:21 AM4/3/17
to Ansible Project
Hi All,

As the subject line says, is there a way to hide/disable the diff on the copy module so it doesn't expose the contents?


[vagrant@localhost test]$ ansible-playbook -D file_copy_test.yml
 [WARNING]: Host file not found: /etc/ansible/hosts

 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [localhost] ***************************************************************

TASK [copy] ********************************************************************
changed: [localhost]
--- before
+++ after: /var/tmp/ansible/test/dummy.txt
@@ -0,0 +1 @@
+How to hide this content.


PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0 

Arbab Nazar

unread,
Apr 3, 2017, 1:13:27 PM4/3/17
to Ansible Project
did you try no_log: yes option

Kai Stian Olstad

unread,
Apr 3, 2017, 1:51:58 PM4/3/17
to ansible...@googlegroups.com
On 03. april 2017 03:23, Julius Sediolano wrote:
> As the subject line says, is there a way to hide/disable the diff on the
> copy module so it doesn't expose the contents?
>
>
> [vagrant@localhost test]$ ansible-playbook -D file_copy_test.yml
> [WARNING]: Host file not found: /etc/ansible/hosts

If you don't want the diff, leave out the -D option.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages