vm-ansible/roles/postgresql/tasks/main.yaml

38 lines
774 B
YAML
Raw Normal View History

2022-01-08 21:53:39 +01:00
---
- name: "Install PostgreSQL via apt"
apt:
update_cache: yes
state: present
name:
- postgresql
2022-04-14 15:52:51 +02:00
- name: Add access to every host on local network
postgresql_pg_hba:
dest: /var/lib/postgres/data/pg_hba.conf
contype: host
users: all
databases: all
address: samenet
state: present
- name: Add access to every host via tls on local network
postgresql_pg_hba:
dest: /var/lib/postgres/data/pg_hba.conf
contype: hostssl
users: all
databases: all
address: samenet
state: present
2022-01-08 21:53:39 +01:00
- name: Enable and restart PostgreSQL daemon
service:
name: postgresql
state: restarted
enabled: yes
2022-02-05 20:00:55 +01:00
- name: Allow postgresql port via ufw
community.general.ufw:
rule: allow
2022-02-05 21:49:58 +01:00
port: "5432"
2022-02-05 20:00:55 +01:00
proto: tcp