Structuring multiple similar services on single host

Hi,

I’m seeking advice for how to best structure the inventory for our situation. We have multiple hosts, and each host is running multiple instances of the same software that we’d like to update using Ansible. Each instance has properties like port number etc. We would like to run updates on the same host in parallel.
I am currently thinking of creating a list of instances per host. But that would not give us parallel updates, unless we use ‘fire and forget’ for the update task. But then we would need to add some way to detect whether all instances are updated correctly.

Do you have any suggestions for how we can / should tackle this?

Thanks!
Daan

Hi,

if you trick ansible to think every instance is on it`s own server, it will go thru all of them in parallel (to the forks count of course). For static inventory it would be like:

[servers]
app1 ansible_ssh_host=192.168.1.2
app2 ansible_ssh_host=192.168.1.2

Ansible than access to the app1 and app2 like on the separate servers.