File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ Role Variables
33
33
34
34
### All variables are optional ###
35
35
36
+ - ` postgresql_user_name ` : System username to be used for PostgreSQL (default:
37
+ ` postgres ` ).
38
+
36
39
- ` postgresql_version ` : PostgreSQL version to install. On Debian-based
37
40
platforms, the default is whatever version is pointed to by the ` postgresql `
38
41
metapackage). On RedHat-based platforms, the default is ` 9.4 ` .
Original file line number Diff line number Diff line change @@ -5,5 +5,6 @@ postgresql_backup_local_dir: ~postgres/backup
5
5
postgresql_backup_active_dir : " {{ postgresql_backup_local_dir }}/active"
6
6
postgresql_backup_mail_recipient : postgres
7
7
postgresql_backup_rotate : true
8
+ postgresql_user_name : postgres
8
9
9
10
postgresql_archive_wal_rsync_args : ' --ignore-existing -ptg --info=skip1'
Original file line number Diff line number Diff line change 26
26
when : ansible_os_family == "RedHat"
27
27
28
28
- name : Create conf.d
29
- file : path={{ postgresql_conf_dir }}/conf.d state=directory owner=postgres group=postgres
29
+ file : path={{ postgresql_conf_dir }}/conf.d state=directory owner={{ postgresql_user_name }} group={{ postgresql_user_name }}
30
30
31
31
- name : Set conf.d include in postgresql.conf
32
32
lineinfile : line="include_dir 'conf.d'" dest={{ postgresql_conf_dir }}/postgresql.conf backup=yes
40
40
when : " postgresql_version is version_compare('9.3', '<')"
41
41
42
42
- name : Set config options
43
- template : src=25ansible_postgresql.conf.j2 dest={{ postgresql_conf_dir }}/conf.d/25ansible_postgresql.conf owner=postgres group=postgres backup=yes
43
+ template : src=25ansible_postgresql.conf.j2 dest={{ postgresql_conf_dir }}/conf.d/25ansible_postgresql.conf owner={{ postgresql_user_name }} group={{ postgresql_user_name }} backup=yes
44
44
notify : Reload PostgreSQL
45
45
46
46
- name : Install pg_hba.conf
47
- template : src=pg_hba.conf.{{ ansible_os_family | lower }}.j2 dest={{ postgresql_conf_dir }}/pg_hba.conf owner=postgres group=postgres mode=0400 backup=yes
47
+ template : src=pg_hba.conf.{{ ansible_os_family | lower }}.j2 dest={{ postgresql_conf_dir }}/pg_hba.conf owner={{ postgresql_user_name }} group={{ postgresql_user_name }} mode=0400 backup=yes
48
48
notify : Reload PostgreSQL
49
49
50
50
- include : backup.yml
You can’t perform that action at this time.
0 commit comments