46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
|
|
---
|
||
|
|
- name: Configure PostgreSQL
|
||
|
|
ansible.builtin.template:
|
||
|
|
src: item.src
|
||
|
|
dest: item.dst
|
||
|
|
owner: item.owner | default("root")
|
||
|
|
group: item.group | default("root")
|
||
|
|
mode: item.mode | default("0644")
|
||
|
|
loop:
|
||
|
|
- src: postgresql.conf.j2
|
||
|
|
dst: /etc/postgresql/postgresql.conf
|
||
|
|
- src: pg_hba.conf.j2
|
||
|
|
dst: /etc/postgresql/pg_hba.conf
|
||
|
|
- src: postgresql.service.j2
|
||
|
|
dst: /systemd/system/postgresql.service.d/risotto.conf
|
||
|
|
- src: postgresql.sql.j2
|
||
|
|
dst: /etc/postgresql/postgresql.sql
|
||
|
|
mode: '0600'
|
||
|
|
owner: postgres
|
||
|
|
|
||
|
|
- name: Copy static files for PostgreSQL
|
||
|
|
ansible.builtin.copy:
|
||
|
|
dest: item.dst
|
||
|
|
owner: item.owner | default("root")
|
||
|
|
group: item.group | default("root")
|
||
|
|
mode: item.mode | default("0644")
|
||
|
|
loop:
|
||
|
|
- src: pg_ident.conf
|
||
|
|
dst: /etc/postgresql/pg_ident.conf
|
||
|
|
- src: postgresql_init
|
||
|
|
dst: /sbin/postgresql_init
|
||
|
|
mode: '0755'
|
||
|
|
- src: sysuser-postgresql.conf
|
||
|
|
dst: /sysusers.d/0postgresql.conf
|
||
|
|
- src: tmpfiles.postgresql.conf
|
||
|
|
dst: /tmpfiles.d/0postgresql.conf
|
||
|
|
|
||
|
|
- name: Gen backup file
|
||
|
|
ansible.builtin.template:
|
||
|
|
src: risotto_backup.j2
|
||
|
|
dest: /sbin/risotto_backup
|
||
|
|
owner: root
|
||
|
|
group: root
|
||
|
|
mode: "0700"
|
||
|
|
when: do_backup | default(false)
|