ansible api syntax

45 views
Skip to first unread message

kevin hansen

unread,
Aug 22, 2014, 10:52:45 AM8/22/14
to ansible...@googlegroups.com
Trying to use the api to copy a file and I'd like a diff of the changes.

I'm trying :
results = ansible.runner.Runner(pattern=argument['<hostname>'] ,check=True,diff=True,module_name='copy', module_args='src=/tmp/x.txt dest=/tmp/',).run()


results are:
{'contacted': {'rexpap2': {'changed': True,
                           'invocation': {'module_args': 'src=/tmp/x.txt dest=/tmp/',
                                          'module_name': 'copy'}}},

running on centos 7 / python 2.7 ansible version 1.7.1

Am passing the right stuff to Runner to get the diff?   I went fishing through the source to come up with the syntax I'm using but not really sure it is correct or if I can even get diffs back from the api.  

Thanks,

Michael DeHaan

unread,
Aug 22, 2014, 11:58:38 AM8/22/14
to ansible...@googlegroups.com
Normally this would be a question posted to ansible-devel, so please use this list int he future for development topics.

Basically this data comes back via callbacks and not the API return, so it's going to be difficult to extract.








--
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.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9fd4ad0d-ef15-4cc0-b35f-31a787fb49f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages