Hi all,

I am currently developing an Action-module which should do the following:

I have a playbook like this:
- hosts: target-host
  tasks:
     - my_module:
          src_host: source-host
          regex: some_regex

It should be checked if a file which meets the regex can be found on the 
source-host. If so, it should be copied to the target-host via the 
controller-node. I can't copy the file directly because of 
security-restrictions.

Currently I solved this by just using paramiko which works fine but isn't a 
clean solution.


Questions/What I want to do instead: 
1) I would like to access the inventory inside of my Action-Module to get 
ansible_user, ansible_password and ansible_port of the source-host and 
target-host. How can I achieve this? I tried to use the InventoryManager 
without success. Currently i provide all these values as parameters.

2) A far better solution would be, to use _execute_module and execute the 
find-module on the source-host and then copy the file via the copy-module 
to the controller-node and the target-host. But it seems there is no 
delegate-option for execute_module so (by looking at the play from above) 
it will always be executed on the target-host


Any help or pointing me into the right direction would be very much 
apricated. Couldn't find any suitable solution so far even after hours.

Thanks and best regads,
Felix

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3219e06d-e6c7-4cc4-9b15-7676ca4606ban%40googlegroups.com.

Reply via email to