[ansible-project] Custom module - finding files?

2015-05-21 Thread John McNulty
I've written a module that has requires a src and dest file. I'm puzzled as to how core modules like copy find their source files in the role/name/files directory. I've looked at the sources for copy.py and it just gets the source file from module.params['src']. Then tests with: if not

Re: [ansible-project] Custom module - finding files?

2015-05-21 Thread Brian Coca
Those modules are split, the part that runs the 'src' stuff is an action_plugin of the same name. The code that runs is split across the action plugin (local) and the actual module (remote). -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible

Re: [ansible-project] Custom module - finding files?

2015-05-21 Thread John McNulty
Hi Brian, So really the way forward is for me to split this over two tasks. One task to copy the file from the role files directory on the Ansible server to a temporary directory on the remote host, and then use that known location in my custom module to find, process and clean the target

Re: [ansible-project] Custom module - finding files?

2015-05-21 Thread Brian Coca
you can create your own action plugin to wrap the copy part. On Thu, May 21, 2015 at 12:50 PM, John McNulty johnm...@gmail.com wrote: Hi Brian, So really the way forward is for me to split this over two tasks. One task to copy the file from the role files directory on the Ansible server to

Re: [ansible-project] Custom module - finding files?

2015-05-21 Thread Brian Coca
this is how template works On Thu, May 21, 2015 at 12:51 PM, Brian Coca bc...@ansible.com wrote: you can create your own action plugin to wrap the copy part. On Thu, May 21, 2015 at 12:50 PM, John McNulty johnm...@gmail.com wrote: Hi Brian, So really the way forward is for me to split this