# Hide file contents when using the copy module.

**URL:** <https://forum.ansible.com/t/hide-file-contents-when-using-the-copy-module/24124>\
**Category:** Ansible Project\
**Created:** [April 3, 2017, 1:23am UTC](https://forum.ansible.com/t/hide-file-contents-when-using-the-copy-module/24124 "2017-04-03T01:23:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julius\_Sediolano](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Julius\_Sediolano](https://forum.ansible.com/u/Julius_Sediolano)\
**Post date:** [April 3, 2017, 1:23am UTC](https://forum.ansible.com/t/hide-file-contents-when-using-the-copy-module/24124/1 "2017-04-03T01:23:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 3, 2017, 5:13pm UTC](https://forum.ansible.com/t/hide-file-contents-when-using-the-copy-module/24124/2 "2017-04-03T17:13:26Z")

</div>

did you try no\_log: yes option

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 3, 2017, 5:51pm UTC](https://forum.ansible.com/t/hide-file-contents-when-using-the-copy-module/24124/3 "2017-04-03T17:51:29Z")

</div>

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