# multiple instances, multiple paths, one server

**URL:** <https://forum.ansible.com/t/multiple-instances-multiple-paths-one-server/12532>\
**Category:** Ansible Project\
**Created:** [March 19, 2013, 5:33pm UTC](https://forum.ansible.com/t/multiple-instances-multiple-paths-one-server/12532 "2013-03-19T17:33:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothy\_Appnel](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@Timothy\_Appnel](https://forum.ansible.com/u/Timothy_Appnel)\
**Post date:** [March 19, 2013, 5:33pm UTC](https://forum.ansible.com/t/multiple-instances-multiple-paths-one-server/12532/1 "2013-03-19T17:33:54Z")

</div>

I haven’t had the time to pay as close attention to discussions on the list here as I should. Hoping these haven’t been discussed and my search over the archives missed them.

Is anyone dealing with managing multiple instances on a server with Ansible? I think this came up some months ago and the answer was that Ansible’s inventory system doesn’t handle same server, different ports. Glancing at the code that still seems to be the case today. Back then I came up with a bit of a hack where I have the instances as groups with the host they sit on as their only member. Once a playbook runs and Ansible has folded the host list down in to a list of server address, I loop through each instance group for that hostname and conditionally run the rest of the play if the group match the filter. That could be more straight forward and it seems like a reasonable thing to consider for being worked in to the core.

Next question: Is there some way to have modules and plugins in multiple different paths? I’m thinking it isn’t currently, but thought there might be some magic I’m overlooking. Here at the job we have this release management system that all software gets placed for use. Those paths are read only and can’t be changed with creating a new release/version. So I deploy Ansible there and run it. All is well. Now I need to add a new module of my own making – I have to create a new release with the extra module that I’ll need to remember to add everytime I release a new Ansible to our system. Another is to create a local file system path and create symlinks to all the core modules in the readonly drive along with the other non-core modules I have. Not ideal, but more workable than making psuedo releases everytime a non-core module is needed. It begs the question though – should Ansible have the (optional) ability to search multiple paths for modules and plugins?

Any thoughts and feedback are appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![Romeo\_Theriault](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@Romeo\_Theriault](https://forum.ansible.com/u/Romeo_Theriault)\
**Post date:** [March 19, 2013, 9:14pm UTC](https://forum.ansible.com/t/multiple-instances-multiple-paths-one-server/12532/2 "2013-03-19T21:14:44Z")

</div>

> Is anyone dealing with managing multiple instances on a server with  
> Ansible? I think this came up some months ago and the answer was that  
> Ansible's inventory system doesn't handle same server, different ports.  
> Glancing at the code that still seems to be the case today.

Not exactly sure what you're trying to do but check out this page:

[http://ansible.cc/docs/patterns.html](http://ansible.cc/docs/patterns.html)

specifically:

jumper ansible\_ssh\_port=5555 ansible\_ssh\_host=192.168.1.50

> Next question: Is there some way to have modules and plugins in multiple  
> different paths?

I append to the ANSIBLE\_LIBRARY env variable to point to a directory with  
my custom modules.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 19, 2013, 9:18pm UTC](https://forum.ansible.com/t/multiple-instances-multiple-paths-one-server/12532/3 "2013-03-19T21:18:25Z")

</div>

Romeo's suggestion is correct.

(If using -c ssh, configured SSH jumphosts are also operational.  
Though that's not the same thing)

the library path is also configurable in the configuration file:

~/.ansible.cfg (or /etc/ansible/ansible.cfg) or ./ansible.cfg  
directory (relative to your playbook).

modules can also be kept alongside your playbooks in a "modules/" directory.

Multiple paths can of course be done, seperate them with ":"
