]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blame - README.md
Allow to use any ansible become method
[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
d0bc90e0
P
17#### Dependencies
18
19No dependencies
20
21Recommended dependencies:
8371771c 22- [trainline-eu.ansible_barman_role](https://galaxy.ansible.com/trainline-eu/ansible_barman_role)
d0bc90e0
P
23
24#### Compatibility matrix
25
26This table lists the tested version of OS/PostgreSQL couples.
27
28| Distribution / PostgreSQL | 9.1 | 9.4 | 9.5 | 9.6 | 10 | 11 |
29| ------------------------- |:---:|:---:|:---:|:---:|:---:|:---:|
91a1727f
TH
30| Debian 8.x | :no_entry: :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
31| 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
32
33- :white_check_mark: - tested, works fine
34- :grey_question: - will work in the future (help out if you can)
35- :interrobang: - maybe works, not tested
36- :no_entry: - PostgreSQL has reached EOL
37
d0bc90e0
P
38#### Variables
39
40```yaml
41# Basic settings
42postgres_listen_addresses: [ '127.0.0.1' ] # Optional
43postgres_log_dir: '/home/postgres-logs' # Optional
44postgres_data_dir: '/home/postgres' # Optional
45postgres_clusters: # Mandatory
91a1727f 46 - version: 11 # Mandatory
d0bc90e0
P
47 name: 'main' # Mandatory
48 port: 5432 # Mandatory
49 checksums: True # Optional
50 fsync_enabled: False # Optional
51 archive_enabled: False # Optional
52 # List of users to be created (optional)
53 users:
54 - username: 'replicator' # Mandatory
55 password: 'SuperSecret' # Mandatory
56 permissions: 'REPLICATION' # Mandatory
57 # List of databases to be created (optional)
58 databases:
59 - dbname: my_database # Mandatory
60 owner: john # Mandatory
7b241a44
P
61 extensions: # Optional
62 - names: [ 'postgis', 'postgis_topology' ]
63 apt_deps: [ 'postgresql-11-postgis' ]
d0bc90e0
P
64
65# Postgres config (Optional)
66postgres_log_line_prefix: '%m [%p] database: %d host: %h user: %u '
67postgres_datestyle: 'iso, dmy'
68postgres_locale_formats: fr_FR.UTF-8
69postgres_text_search_config: pg_catalog.french
70
71# Postgres pg_hba config (optional)
72postgres_allowed_hosts:
73 - user: all
74 range: 10.0.0.0/24
75postgres_replication_hosts:
76 - user: replicator
77 range: 10.0.0.0/24
29f3186f
TH
78
79# Ansible related Configuration
80postgres_become_method: su # Optional
d0bc90e0
P
81```
82
83#### Testing
84
85This 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.
86
87Coverage of this playbook is probably not complete but at least it's there.
88
89If 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).
90
91#### License
92
93Licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
94
95
96#### Thanks
97
98Creators:
99- [Gaëtan Duchaussois](https://twitter.com/gduchaussois)
100- [Théophile Helleboid](https://twitter.com/chtitux)
101- [Paul Bonaud](https://twitter.com/paulRb_r)
102
103Maintainers:
104- [Théophile Helleboid](https://twitter.com/chtitux)
105- [Paul Bonaud](https://twitter.com/paulRb_r)
106
107#### Feedback, bug-reports, requests, ...
108
109Are [welcome](https://github.com/trainline-eu/postgresql/issues)!