Hey there,

while working on [ansible-rails][1] I came across a problem I have not yet 
been able to solve by just reading and interpreting the ansible source code:

how can I share common dependencies between multiple, custom commands? E.g. 
given the following role directory structure:

/example
/example/library
/example/library/command_a
/example/library/command_b
/example/library/shared_utility.py
/example/library/__init__.py

shared_utility.py contains classes used in both command_a AND command_b. 

The way I understand ansible right now is that when command_a is used 
inside a playbook/ role it's source is expanded and copied to the server 
(sie ModuleReplacer inside the ansible source).
However, due to this processing, I can't just import shared_utility, 
because it's not copied to the remote server.

My question now is this: how do I import shared code into ansible commands? 
And equally important: how do I properly test these custom commands without 
much hackery (I'm talking about good old unit tests in this case!)

Please advice - is this left out on purpose or just very badly documented & 
hidden away?

Thanks,
Raphael

[1]:https://github.com/nicolai86/ansible-rails

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/93c6462b-75d2-4b16-8ae0-e02cc580f540%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to