I am writing automation with this type of Ansible inventory:
[nodes]
<publicIp1> privateIp=<privateIp1>
<publicIp2> privateIp=<privateIp2>
I do this because sometimes hosts have a different public IP vs. private IP (e.g., AWS).
Now while configuring any host, I need get a csv like "privateIp1,privateIp2" inside template module's jinja2 file.
Preferrably, I do not even want to refer to the group name "node", but rather just ask for "give me list of all 'privateIp' inventory variables for all members of group of current host." << Assuming my host was a member of just one group.
If not possible, is there a way to refer to the group name and do this?