@@ -37,20 +37,21 @@ Role Variables
37
37
- ` postgresql_flavor ` : On Debian-based platforms, this specifies whether you want to use PostgreSQL packages from pgdg
38
38
or the distribution's apt repositories. Possible values: ` apt ` , ` pgdg ` (default: ` apt ` ).
39
39
40
- - ` postgresql_conf ` : A hash (dictionary) of ` postgresql.conf ` options and values. These options are not added to
41
- ` postgresql.conf ` directly - the role adds a ` conf.d ` subdirectory in the configuration directory and an include
42
- statement for that directory to ` postgresql.conf ` . Options set in ` postgresql_conf ` are then set in
43
- ` conf.d/25ansible_postgresql.conf ` .
40
+ - ` postgresql_conf ` : A list of hashes (dictionaries) of ` postgresql.conf ` options (keys) and values. These options are
41
+ not added to ` postgresql.conf ` directly - the role adds a ` conf.d ` subdirectory in the configuration directory and an
42
+ include statement for that directory to ` postgresql.conf ` . Options set in ` postgresql_conf ` are then set in
43
+ ` conf.d/25ansible_postgresql.conf ` . For legacy reasons, this can also be a single hash, but the list syntax is
44
+ preferred because it preserves order.
44
45
45
46
Due to YAML parsing, you must take care when defining values in
46
47
` postgresql_conf ` to ensure they are properly written to the config file. For
47
48
example:
48
49
49
50
``` yaml
50
51
postgresql_conf :
51
- max_connections : 250
52
- archive_mode : " off"
53
- work_mem : " '8MB'"
52
+ - max_connections : 250
53
+ - archive_mode : " off"
54
+ - work_mem : " '8MB'"
54
55
` ` `
55
56
56
57
Becomes the following in ` 25ansible_postgresql.conf`:
@@ -149,8 +150,8 @@ Use the PostgreSQL 9.5 packages and set some `postgresql.conf` options and `pg_h
149
150
vars:
150
151
postgresql_version: 9.5
151
152
postgresql_conf:
152
- listen_addresses: "''" # disable network listening (listen on unix socket only)
153
- max_connections: 50 # decrease connection limit
153
+ - listen_addresses: "''" # disable network listening (listen on unix socket only)
154
+ - max_connections: 50 # decrease connection limit
154
155
postgresql_pg_hba_conf:
155
156
- host all all 10.0.0.0/8 md5
156
157
roles:
0 commit comments