# Ansible "copy" module not working through Playbook

**URL:** <https://forum.ansible.com/t/ansible-copy-module-not-working-through-playbook/13274>\
**Category:** Ansible Project\
**Created:** [August 8, 2013, 9:12pm UTC](https://forum.ansible.com/t/ansible-copy-module-not-working-through-playbook/13274 "2013-08-08T21:12:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gijs\_Roeffen](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@Gijs\_Roeffen](https://forum.ansible.com/u/Gijs_Roeffen)\
**Post date:** [August 8, 2013, 9:12pm UTC](https://forum.ansible.com/t/ansible-copy-module-not-working-through-playbook/13274/1 "2013-08-08T21:12:59Z")

</div>

Hi,

I dont know whenether im going nuts or just havent RTFM enough, but the following is my issue;

When using ansibile from command-line to copy an file it works perfect;

# ansible test.domain.local -m copy -a “src=/mgmt/cmdb/shared/etc/exim.conf dest=/etc/exim.conf owner=root group=root mode=0644”

test.domain.locall | success \>\> {  
“changed”: true,  
“gid”: 0,  
“group”: “root”,  
“mode”: “0644”,  
“owner”: “root”,  
“path”: “/etc/exim.conf”,  
“size”: 2660,  
“state”: “file”,  
“uid”: 0  
}

Every change i write to the file is being updated to the remote host and its being updated vice versa, etc.

However; when i use it in an playbook;

"

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 9, 2013, 1:16am UTC](https://forum.ansible.com/t/ansible-copy-module-not-working-through-playbook/13274/2 "2013-08-09T01:16:33Z")

</div>

My first thought is your first /usr/bin/ansible command placed it correctly so the second /usr/bin/ansible-playbook command didn’t have to.

---

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [August 9, 2013, 8:41am UTC](https://forum.ansible.com/t/ansible-copy-module-not-working-through-playbook/13274/3 "2013-08-09T08:41:26Z")

</div>

I see “test.domain.locall” returned by Ansible. Is it possible you have a typo somwhere and are looking on the wrong host or something?

---

<div class="post-metadata">

**Author:** ![Gijs\_Roeffen](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@Gijs\_Roeffen](https://forum.ansible.com/u/Gijs_Roeffen)\
**Post date:** [August 10, 2013, 10:55am UTC](https://forum.ansible.com/t/ansible-copy-module-not-working-through-playbook/13274/4 "2013-08-10T10:55:55Z")

</div>

Hi Michael,

That was it! I figured it out now 🙂 Thanks for your time and help!

Kind regards,

Gijs
