I have the following static inventory file:
[nodes:children]
masters
workers
[masters]
node1 ansible_host=1.2.3.4 ansible_port=2220 ansible_user=vagrant ansible_private_key_file=keys/id_rsa
[workers]
node2 ansible_host=1.2.3.4 ansible_port=2221 ansible_user=vagrant ansible_private_key_file=keys/id_rsa
Because my hosts use the same IP, but different ssh ports I need to alias them to so that ansible can see them as two hosts.
I'm trying to use a dynamic inventory script to generate this, but I'm struggling to find any information on the format of the json the I need to return, more specifically - how to alias the hosts.
So my question - does anyone know the json equivalent of the above static inventory file or somewhere where I can find information on the json format?