multiple instances, multiple paths, one server

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.

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

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.

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 ":"