paulbsd-salt/states/postgresql/templates/pg_hba.conf.j2

37 lines
1.8 KiB
Django/Jinja

## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "postgresql/map.jinja" import net with context %}
### Replication via repmgr
local replication repmgr trust
{%- for key, value in net.ipv4_networks.items() %}
host replication repmgr {{ value.ip }}/{{ value.mask }} trust # {{ key }}
{%- endfor %}
{%- for key, value in net.ipv6_networks.items() %}
host replication repmgr {{ value.ip }}/{{ value.mask }} trust # {{ key }}
{%- endfor %}
local repmgr repmgr trust
{%- for key, value in net.ipv4_networks.items() %}
host repmgr repmgr {{ value.ip }}/{{ value.mask }} trust # {{ key }}
{%- endfor %}
{%- for key, value in net.ipv6_networks.items() %}
host repmgr repmgr {{ value.ip }}/{{ value.mask }} trust # {{ key }}
{%- endfor %}
### Basic auth for users
{%- for key, value in net.ipv4_networks.items() %}
host all all {{ value.ip }}/{{ value.mask }} md5 # {{ key }}
{%- endfor %}
{%- for key, value in net.ipv6_networks.items() %}
host all all {{ value.ip }}/{{ value.mask }} md5 # {{ key }}
{%- endfor %}
local all postgres peer
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5