]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blame - README.md
Update README.md with links to Galaxy
[github/fretlink/ansible-postgresql-role.git] / README.md
CommitLineData
8371771c 1## PostgreSQL Ansible role [![Build Status](https://travis-ci.org/trainline-eu/ansible-postgresql-role.svg?branch=master)](https://travis-ci.org/trainline-eu/ansible-postgresql-role)
d0bc90e0
P
2
3Ansible role which installs and configures PostgreSQL clusters, databases and users.
4
8371771c
TH
5See [role page on Ansible Galaxy](https://galaxy.ansible.com/trainline-eu/ansible_postgresql_role).
6
d0bc90e0
P
7#### Installation
8
9This role has been tested on Ansible 2.3.0 and higher.
10
11To install:
12
13```
b91d7341 14ansible-galaxy install trainline-eu.ansible_postgresql_role
d0bc90e0
P
15```
16
17
18#### Dependencies
19
20No dependencies
21
22Recommended dependencies:
8371771c 23- [trainline-eu.ansible_barman_role](https://galaxy.ansible.com/trainline-eu/ansible_barman_role)
d0bc90e0
P
24
25#### Compatibility matrix
26
27This table lists the tested version of OS/PostgreSQL couples.
28
29| Distribution / PostgreSQL | 9.1 | 9.4 | 9.5 | 9.6 | 10 | 11 |
30| ------------------------- |:---:|:---:|:---:|:---:|:---:|:---:|
91a1727f
TH
31| Debian 8.x | :no_entry: :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
32| Debian 9.x | :no_entry: :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
d0bc90e0
P
33
34- :white_check_mark: - tested, works fine
35- :grey_question: - will work in the future (help out if you can)
36- :interrobang: - maybe works, not tested
37- :no_entry: - PostgreSQL has reached EOL
38
39
40#### Variables
41
42```yaml
43# Basic settings
44postgres_listen_addresses: [ '127.0.0.1' ] # Optional
45postgres_log_dir: '/home/postgres-logs' # Optional
46postgres_data_dir: '/home/postgres' # Optional
47postgres_clusters: # Mandatory
91a1727f 48 - version: 11 # Mandatory
d0bc90e0
P
49 name: 'main' # Mandatory
50 port: 5432 # Mandatory
51 checksums: True # Optional
52 fsync_enabled: False # Optional
53 archive_enabled: False # Optional
54 # List of users to be created (optional)
55 users:
56 - username: 'replicator' # Mandatory
57 password: 'SuperSecret' # Mandatory
58 permissions: 'REPLICATION' # Mandatory
59 # List of databases to be created (optional)
60 databases:
61 - dbname: my_database # Mandatory
62 owner: john # Mandatory
63
64# Postgres config (Optional)
65postgres_log_line_prefix: '%m [%p] database: %d host: %h user: %u '
66postgres_datestyle: 'iso, dmy'
67postgres_locale_formats: fr_FR.UTF-8
68postgres_text_search_config: pg_catalog.french
69
70# Postgres pg_hba config (optional)
71postgres_allowed_hosts:
72 - user: all
73 range: 10.0.0.0/24
74postgres_replication_hosts:
75 - user: replicator
76 range: 10.0.0.0/24
77```
78
79#### Testing
80
81This project comes with a `test/main.yml` testing playbook. It uses `Docker` to provision containers locally and sets up a 3 node postgresql cluster with a barman server.
82
83Coverage of this playbook is probably not complete but at least it's there.
84
85If you are contributing, please first test your changes in a new playbook in the `test/` directory within docker containers, (using the targeted distribution), and if possible, ensure your change is covered in the tests found in [.travis.yml](./.travis.yml).
86
87#### License
88
89Licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
90
91
92#### Thanks
93
94Creators:
95- [Gaëtan Duchaussois](https://twitter.com/gduchaussois)
96- [Théophile Helleboid](https://twitter.com/chtitux)
97- [Paul Bonaud](https://twitter.com/paulRb_r)
98
99Maintainers:
100- [Théophile Helleboid](https://twitter.com/chtitux)
101- [Paul Bonaud](https://twitter.com/paulRb_r)
102
103#### Feedback, bug-reports, requests, ...
104
105Are [welcome](https://github.com/trainline-eu/postgresql/issues)!