Hello everyone,

as a part of my Bachelor thesis I'm trying to make few modules for ansible, 
which would be used to configure MikroTik devices using API. I'm currently 
having troubles finding a way to "tell" the module things like hostname, 
username and password. I have these stored in hosts file, so I can use 
these as variables in playbook (since the connection type is local). 
Unfortunately, that makes the playbook look way too complicated, since 
every task has the exact same parts: hostname, username and password (and 
after that module-specific options). From what I've read, Ansible doesn't 
allow modules to see these variables directly because of some security 
concerns, or, whatever. 

That's why I decided to make a piece of code that would go trough the hosts 
file and read usernames etc. for each host. But at this point I've realized 
that I don't know how to tell that module the name of the host to look for. 
When the task will run for the host named "Router2", is there a way to tell 
that module: Hey, you're now working for Router2, try to find it's username 
etc... Or is there an entire different approach? Thank you for any 
suggestions.

One last thing I'd like to know... Is there a way to use multi-file 
modules, but store the shared files in different location than 
module_utils? 

I want to say that I'm new to Ansible so please bear with me. I appreciate 
any suggestions. Thank you.

-- 
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/08886f97-31ee-47eb-8797-ee094645e4f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to