I have problem and i don't did i even start correctly.
i have hosts file that looks like
all:
children:
application1:
children:
application1-webserver:
hosts:
host1.domain.net:
host2.domain.net:
application1-database:
hosts:
dbhost1.domain.net:
application2:
children:
application2-webserver:
hosts:
host3.domain.net:
host4.domain.net:
application1-database:
hosts:
dbhost2.domain.net:
app-servers:
hosts:
host1.domain.net:
host2.domain.net:
host3.domain.net:
host4.domain.net:
I have created template file. I know it is not pg_hba.conf, but it is no mater now, if i get IPs out it will be easy
{% for i in groups['app-servers'] %}
{{ hostvars[i]['ansible_default_ipv4_address'] }}
{% endfor %}
So maybe for time to time i have to run this script to create "new" enviroment, and i don't want to change IPs from app-servers manually. What i want is to get IP from FQDN.
Need this so i can limit access to db from network, just to those servers.
Thanks for help.