You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PostgreSQL system installs, configures, and starts the PostgreSQL server.
4
+
The PostgreSQL system role installs, configures, and starts the PostgreSQL
5
+
server.
5
6
6
7
The role also optimizes the database server settings to improve performance.
7
8
8
-
The role currently works with PostgreSQL server 10 12 and 13.
9
+
The role currently works with the PostgreSQL server 10, 12, and 13.
9
10
## Role Variables
10
11
### postgresql_verison
11
-
You can set the version of PostgreSQL server to 10, 12, or 13.
12
+
You can set the version of the PostgreSQL server to 10, 12, or 13.
12
13
```yaml
13
14
postgresql_version: "13"
14
15
```
15
16
### postgresql_password
16
17
Optionally, you can set a password for the `postgres` database superuser.
17
-
By default, no password is set, and a datababase is accessible from
18
-
the `postgres` system account through a UNIX socket.
19
-
It is recommended to encrypt the password using Ansible Vault.
18
+
By default, no password is set, and a datababase is accessible from the
19
+
`postgres`system account through a UNIX socket. It is recommended to encrypt
20
+
the password by using Ansible Vault.
20
21
```yaml
21
22
postgresql_password: !vault |
22
23
$ANSIBLE_VAULT;1.2;AES256;dev
@@ -43,74 +44,84 @@ postgresql_pg_hba_conf:
43
44
auth_method: ident
44
45
```
45
46
### postgresql_server_conf
46
-
The content of the `postgresql_server_conf` variable is
47
-
added to the end of the `/var/lib/pgsql/data/postgresql.conf` file.
48
-
As a result, the default settings are overwritten.
47
+
The content of the `postgresql_server_conf` variable is added to the end of
48
+
the `/var/lib/pgsql/data/postgresql.conf` file. As a result, the default
49
+
settings are overwritten.
49
50
```yaml
50
51
postgresql_server_conf:
51
52
ssl: on
52
53
shared_buffers: 128 MB
53
54
huge_pages: try
54
55
```
55
56
### postgresql_ssl_enable
56
-
To set up a SSL/TLS connection, set the `postgresql_ssl_enable` variable to `True` and provide a server certificate and a private key.
57
+
To set up a SSL/TLS connection, set the `postgresql_ssl_enable` variable to
58
+
`True`and provide a server certificate and a private key.
57
59
```yaml
58
60
postgresql_ssl_enable: true
59
61
```
60
62
### postgresql_cert_name
61
-
In case you want to use own key and certificate. Use `postgresql_cert_name` variable. It's necessary to have both files in the same directory and with the same name with suffixes .crt and .key
63
+
If you want to use your own certificate and private key, use the
64
+
`postgresql_cert_name`variable to specify the certificate name. You must keep
65
+
both certificate and key files in the same directory and under the same name
66
+
with the `.crt` and `.key` suffixes.
62
67
63
-
Use `postgresql_cert_name` variable to specify certificate name.
64
-
For example your crt file is located in `/etc/certs/server.crt` and key in `/etc/certs/server.key`. So `postgresql_cert_name` value should be
68
+
For example, if your certificate file is located in `/etc/certs/server.crt` and
69
+
your private key in `/etc/certs/server.key`, set the `postgresql_cert_name`
70
+
value to:
65
71
```yaml
66
72
postgresql_cert_name: /etc/certs/server
67
73
```
68
74
### postgresql_certificates
69
-
This is a `list` of `dict` in the same format as used
70
-
by the `fedora.linux_system_roles.certificate` role. Specify this variable if
71
-
you want the certificate role to generate the certificates for the PostgreSQL server
72
-
configured by the PostgreSQL role. With this example, `self-signed` certificate
73
-
`postgresql_cert.crt`is generated in `/etc/pki/tls/certs`.
74
-
Default to `[]`.
75
+
The `postgresql_certificates` variable requires a `list` of `dict` in the same
76
+
format as used by the `fedora.linux_system_roles.certificate` role. Specify the
77
+
`postgresql_certificates`variable if you want the certificate role to generate
78
+
certificates for the PostgreSQL server configured by the PostgreSQL role.
79
+
In the following example, a `self-signed` certificate `postgresql_cert.crt` is
80
+
generated in the `/etc/pki/tls/certs/` directory. By default, no certificates
81
+
are automatically generated (`[]`).
75
82
```yaml
76
83
postgresql_certificates:
77
84
- name: postgresql_cert
78
85
dns: ['localhost', 'www.example.com']
79
86
ca: self-sign
80
87
```
81
88
### postgresql_input_file
82
-
To run an SQL script, define a path to your SQL file using the `postgresql_input_file` variable:
89
+
To run an SQL script, define a path to your SQL file by using the
90
+
`postgresql_input_file` variable:
83
91
```yaml
84
92
postgresql_input_file: "/tmp/mypath/file.sql"
85
93
```
86
94
### postgresql_server_tuning
87
95
By default, the PostgreSQL system role enables server settings optimization
88
-
based on system resources. To disabe the tuning,
89
-
set the `postgresql_server_tuning` variable to `False`.
96
+
based on system resources. To disabe the tuning, set the
97
+
`postgresql_server_tuning`variable to `False`.
90
98
```yaml
91
99
postgresql_server_tuning: false
92
100
```
93
101
94
102
See the [`examples/`](examples) for details.
95
103
96
-
## Idempotention
104
+
## Idempotence
97
105
This section should cover role behavior for repeated runs.
98
106
### Password change
99
-
Once the password is set using `postgresql_password` variable it isn't possible to
100
-
change it by setting other value. Also for every database acces using superuser must
101
-
be used `postgresql_password`. Including functionality of `postgresql_input_file`
107
+
Once you set the password by using the `postgresql_password` variable, it is
108
+
impossible to change the password by setting another value. You must use the
109
+
`postgresql_password`variable for every database acces under the superuser,
110
+
including running an SQL script (the functionality of the
111
+
`postgresql_input_file`variable).
102
112
### Config file redefinition
103
-
Config files generated from `postgresql_pg_hba_conf` and `postgresql_conf` are
104
-
regenerated within each single run. So every change rewrite the
113
+
Configuration files generated from `postgresql_pg_hba_conf` and `postgresql_conf`
114
+
are regenerated within each single run. Therefore, every change rewrites the
105
115
previous configuration.
106
116
### Version change
107
-
Once the postgresql server is installed it isn't possible upgrade the server by
108
-
increasing version number in `postgresql_version` also downgrade is not allowed.
117
+
Once the PostgreSQL server is installed, it is impossible to upgrade or
118
+
downgrade the server by increasing or decreasing the version number in the
119
+
`postgresql_version`variable.
109
120
### Server tunning
110
121
This option reflects the setup of the latest run of the role.
111
122
### SSL usage
112
-
This option reflects the setup of the latest run of the role. Postgresql server needs
113
-
properly defined certificates and keys for running with enabled SSL/TLS.
123
+
This option reflects the setup of the latest run of the role. The PostgreSQL
124
+
server needs properly defined certificates and keys to run with enabled SSL/TLS.
0 commit comments