Set subnet with postgresql_set

This commit is contained in:
Alex 2020-05-31 11:58:33 +02:00
parent 1671185876
commit afbfd5d645
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 9 additions and 5 deletions

View File

@ -1,8 +1,12 @@
- name: PostgreSQL listen on private subnet
replace:
path: /etc/postgresql/12/main/postgresql.conf
regexp: "(#?)listen_addresses = '.*'"
replace: "listen_addresses = '{{ ansible_ens10.ipv4.address }},localhost'"
- name: PostgreSQL set defaults
become_user: postgres
loop:
- { name: "listen_addresses", value: "{{ ansible_ens10.ipv4.address }},localhost" }
postgresql_set:
port: '{{ postgres.port }}'
db: postgres
name: "{{ item.name }}"
value: "{{ item.value }}"
notify: Run service actions
tags:
- postgres