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
This role installs, configures, and starts PostgreSQL Server.
4
+
The PostgreSQL system installs, configures, and starts the PostgreSQL server.
5
5
6
6
The role also optimizes the database server settings to improve performance.
7
7
8
8
The role currently works with PostgreSQL server 10 12 and 13.
9
9
## Role Variables
10
10
### postgresql_verison
11
-
Allow set up version of Postgresql server. This role supports Postgresql 10 12 and 13
11
+
You can set the version of PostgreSQL server to 10, 12, or 13.
12
12
```yaml
13
13
postgresql_version: "13"
14
14
```
15
15
### postgresql_password
16
-
Optionally, you can set up password for database super user `postgres` by default
17
-
there is not a password, datababase is accessible from `postgres` system account via UNIX socket.
18
-
users are encouraged to use ansible vault
16
+
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.
19
20
```yaml
20
21
postgresql_password: !vault |
21
22
$ANSIBLE_VAULT;1.2;AES256;dev
22
23
....
23
24
```
24
25
### postgresql_pg_hba_conf
25
-
A description of input variables that are not reqiured. Upstream configuration is used by default.
26
-
Usage of `postgresql_pg_hba_conf` causes replacement of default upstream configuration
26
+
The content of the `postgresql_pg_hba_conf` variable replaces the default
27
+
upstream configuration in the `/var/lib/pgsql/data/pg_hba.conf` file.
27
28
```yaml
28
29
postgresql_pg_hba_conf:
29
30
- type: local
@@ -42,23 +43,24 @@ postgresql_pg_hba_conf:
42
43
auth_method: ident
43
44
```
44
45
### postgresql_server_conf
45
-
Usage of `postgresql_server_conf` adds defined values at the end of postgresql.conf.
46
-
So the default ones are overwritten.
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
49
```yaml
48
50
postgresql_server_conf:
49
51
ssl: on
50
52
shared_buffers: 128 MB
51
53
huge_pages: try
52
54
```
53
55
### postgresql_ssl_enable
54
-
To set up ssl connection it's necessary to set up `postgresql_ssl_enable` variable and provide server certificate and key.
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.
55
57
```yaml
56
58
postgresql_ssl_enable: true
57
59
```
58
60
### postgresql_cert_name
59
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
60
62
61
-
To specify certificate name use `postgresql_cert_name` variable.
63
+
Use `postgresql_cert_name` variable to specify certificate name.
62
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
63
65
```yaml
64
66
postgresql_cert_name: /etc/certs/server
@@ -77,24 +79,24 @@ postgresql_certificates:
77
79
ca: self-sign
78
80
```
79
81
### postgresql_input_file
80
-
For running SQL script define path to your SQL file using `postgresql_input_file`:
82
+
To run an SQL script, define a path to your SQL file using the `postgresql_input_file` variable:
81
83
```yaml
82
84
postgresql_input_file: "/tmp/mypath/file.sql"
83
85
```
84
86
### postgresql_server_tuning
85
-
By default the system role makes server settings tuning based on system resources,
86
-
This functionality is enabled by default. For disabling it there is a possibility to
87
-
set up the `postgresql_server_tuning` variable.
87
+
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`.
88
90
```yaml
89
91
postgresql_server_tuning: false
90
92
```
91
93
92
-
More about usage could be found in [`examples/`](examples) directory
94
+
See the [`examples/`](examples) for details.
93
95
94
96
## Idempotention
95
97
This section should cover role behavior for repeated runs.
96
98
### Password change
97
-
Once the password is set using `postgresql_password` variable it isn`t possible to
99
+
Once the password is set using `postgresql_password` variable it isn't possible to
98
100
change it by setting other value. Also for every database acces using superuser must
99
101
be used `postgresql_password`. Including functionality of `postgresql_input_file`
0 commit comments