Skip to content

Commit d20c2d9

Browse files
committed
Feat: Add configration for postgres user/group
Signed-off-by: Mahdi Fooladgar (professormahi) <professormahi_f@yahoo.com>
1 parent 0652236 commit d20c2d9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

roles/postgres_hardening/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ postgres_hardening_enabled: true
55
postgres_daemon_enabled: true
66

77
postgres_hardening_restart_postgres: true
8+
9+
# Postgres user/group
10+
postgres_user: postgres
11+
postgres_group: postgres

roles/postgres_hardening/tasks/hardening.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@
7676
ansible.builtin.file:
7777
path: /etc/postgresql/14/main
7878
state: directory
79-
owner: postgres
80-
group: postgres
79+
owner: "{{ postgres_user }}"
80+
group: "{{ postgres_group }}"
8181
mode: u=rwx,g=,o=
8282

8383
- name: Manage permissions on /etc/postgresql/14/main/postgresql.conf
8484
ansible.builtin.file:
8585
path: /etc/postgresql/14/main/postgresql.conf
8686
state: file
87-
owner: postgres
88-
group: postgres
87+
owner: "{{ postgres_user }}"
88+
group: "{{ postgres_group }}"
8989
mode: u=rw,g=r,o=
9090

9191
- name: Manage permissions on /etc/postgresql/14/main/pg_hba.conf
9292
ansible.builtin.file:
9393
path: /etc/postgresql/14/main/pg_hba.conf
9494
state: file
95-
owner: postgres
96-
group: postgres
95+
owner: "{{ postgres_user }}"
96+
group: "{{ postgres_group }}"
9797
mode: u=rw,g=,o=

roles/postgres_hardening/vars/main.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)