ansible api syntax

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[‘’] ,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,

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.