Skip to content

Commit a509360

Browse files
lspackovafila43
authored andcommitted
Update README.md
1 parent f5a21ce commit a509360

File tree

1 file changed

+43
-32
lines changed

1 file changed

+43
-32
lines changed

README.md

+43-32
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
# PostgreSQL system role
22
![CI Testing](https://github.com/linux-system-roles/postgresql/workflows/tox/badge.svg)
33

4-
The PostgreSQL system installs, configures, and starts the PostgreSQL server.
4+
The PostgreSQL system role installs, configures, and starts the PostgreSQL
5+
server.
56

67
The role also optimizes the database server settings to improve performance.
78

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.
910
## Role Variables
1011
### 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.
1213
```yaml
1314
postgresql_version: "13"
1415
```
1516
### postgresql_password
1617
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.
2021
```yaml
2122
postgresql_password: !vault |
2223
$ANSIBLE_VAULT;1.2;AES256;dev
@@ -43,74 +44,84 @@ postgresql_pg_hba_conf:
4344
auth_method: ident
4445
```
4546
### 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.
4950
```yaml
5051
postgresql_server_conf:
5152
ssl: on
5253
shared_buffers: 128 MB
5354
huge_pages: try
5455
```
5556
### 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.
5759
```yaml
5860
postgresql_ssl_enable: true
5961
```
6062
### 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.
6267

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:
6571
```yaml
6672
postgresql_cert_name: /etc/certs/server
6773
```
6874
### 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 (`[]`).
7582
```yaml
7683
postgresql_certificates:
7784
- name: postgresql_cert
7885
dns: ['localhost', 'www.example.com']
7986
ca: self-sign
8087
```
8188
### 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:
8391
```yaml
8492
postgresql_input_file: "/tmp/mypath/file.sql"
8593
```
8694
### postgresql_server_tuning
8795
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`.
9098
```yaml
9199
postgresql_server_tuning: false
92100
```
93101

94102
See the [`examples/`](examples) for details.
95103

96-
## Idempotention
104+
## Idempotence
97105
This section should cover role behavior for repeated runs.
98106
### 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).
102112
### 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
105115
previous configuration.
106116
### 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.
109120
### Server tunning
110121
This option reflects the setup of the latest run of the role.
111122
### 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.
114125
## Example Playbook
115126

116127

0 commit comments

Comments
 (0)