Ansible "copy" module not working through Playbook

649 views
Skip to first unread message

Gijs Roeffen

unread,
Aug 8, 2013, 5:12:59 PM8/8/13
to ansible...@googlegroups.com
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;

"
---

- hosts: test.domain.local
  user: root
  tasks:

  - name: exim
    copy:  src=/mgmt/cmdb/shared/etc/exim.conf dest=/etc/exim.conf owner=root group=root mode=0644
"

The playbook-run comes back "ok"
PLAY RECAP ********************************************************************
test.domain.local    : ok=2    changed=0    unreachable=0    failed=0

But the file isnt being update, whenether i remove it or.. well.. do anything with it. It just ALWAYS comes back with "ok".

What am i missing or not seeing here?

Thanks alot in advance for your support and understanding,

Kind regards,

Gijs


Michael DeHaan

unread,
Aug 8, 2013, 9:16:33 PM8/8/13
to ansible...@googlegroups.com

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.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vincent Van der Kussen

unread,
Aug 9, 2013, 4:41:26 AM8/9/13
to ansible...@googlegroups.com

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?

Gijs Roeffen

unread,
Aug 10, 2013, 6:55:55 AM8/10/13
to ansible...@googlegroups.com
Hi Michael,

That was it! I figured it out now :-) Thanks for your time and help!

Kind regards,

Gijs


Op vrijdag 9 augustus 2013 03:16:33 UTC+2 schreef Michael DeHaan:
Reply all
Reply to author
Forward
0 new messages