fix hba generation
This commit is contained in:
parent
213fe496cc
commit
69fbca96ab
2 changed files with 16 additions and 8 deletions
|
|
@ -8,3 +8,10 @@ postgresql:
|
|||
allowed_hosts: {}
|
||||
dbs: {}
|
||||
users: {}
|
||||
|
||||
default_allowed_hosts:
|
||||
type: 'host'
|
||||
database: 'all'
|
||||
user: 'all'
|
||||
source_net: 'all'
|
||||
auth: 'md5'
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
{% for group in postgresql.allowed_hosts %}
|
||||
# {{ group }}
|
||||
{% for item in postgresql.allowed_hosts[group] %}
|
||||
{{ item.type | default('host') }} {{ item.database | default('all') }} {{ item.user | default('all') }} {{ item.source_net | default('all') }} {{ item.auth | default('md5') }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% endfor %}
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# admin and local access
|
||||
local all postgres peer
|
||||
local all all peer
|
||||
host all all 127.0.0.1/32 md5
|
||||
host all all ::1/128 md5
|
||||
|
||||
{% for rulename in postgresql.allowed_hosts %}
|
||||
{% set item = default_allowed_hosts|combine(postgresql.allowed_hosts[rulename]) %}
|
||||
# Rule "{{ rulename }}"
|
||||
{{ item.type }} {{ item.database }} {{ item.user }} {{ item.source_net }} {{ item.auth }}
|
||||
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue