Skip to content

Commit d90d329

Browse files
committed
Support PostgreSQL v12
1 parent 3158a37 commit d90d329

18 files changed

+1618
-69
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ services:
99

1010
env:
1111
matrix:
12-
- IMAGE_NAME="ubuntu-upstart:14.04"
1312
- IMAGE_NAME="ubuntu:16.04-builded"
1413
- IMAGE_NAME="debian:8-builded"
1514
- IMAGE_NAME="debian:9-builded"
@@ -28,7 +27,7 @@ script:
2827
- ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml
2928

3029
# Idempotence test
31-
- ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml > idempotence_out
30+
- ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml | tee idempotence_out
3231
- ./tests/idempotence_check.sh idempotence_out
3332

3433
notifications:

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,28 @@ Including an example of how to use your role:
3636

3737
| Distribution / PostgreSQL | <= 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 |
3838
| ------------------------- |:---:|:---:|:---:|:---:|:--:|:--:|:--:|
39-
| Ubuntu 14.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
40-
| Ubuntu 16.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
41-
| Debian 8.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
42-
| Debian 9.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
43-
| CentOS 6.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
44-
| CentOS 7.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
39+
| Ubuntu 14.04 | :no_entry: | :no_entry:| :no_entry:| :no_entry:| :no_entry:| :no_entry:| :no_entry:|
40+
| Ubuntu 16.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
41+
| Debian 8.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
42+
| Debian 9.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
43+
| CentOS 6.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
44+
| CentOS 7.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
4545
| CentOS 8.x | :no_entry: | :grey_question:| :grey_question:| :grey_question:| :grey_question:| :grey_question:| :grey_question:|
4646
| Fedora latest | :no_entry: | :x:| :x:| :x:| :x:| :x:| :x:|
4747

4848
- :white_check_mark: - tested, works fine
4949
- :warning: - Not for production use
5050
- :grey_question: - will work in the future (help out if you can)
5151
- :interrobang: - maybe works, not tested
52-
- :no_entry: - PostgreSQL has reached EOL
52+
- :no_entry: - Has reached End of Life (EOL)
5353

5454

5555

5656
#### Variables
5757

5858
```yaml
5959
# Basic settings
60-
postgresql_version: 11
60+
postgresql_version: 12
6161
postgresql_encoding: "UTF-8"
6262
postgresql_locale: "en_US.UTF-8"
6363
postgresql_ctype: "en_US.UTF-8"

Vagrantfile

+8-43
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Vagrant.configure('2') do |config|
1010
config.vm.define 'ubuntu16.local' do |machine|
1111

1212
machine.vm.box = "bento/ubuntu-16.04"
13-
machine.vm.network :private_network, ip: '192.168.88.22'
13+
machine.vm.network :private_network, ip: '192.168.88.10'
1414
machine.vm.hostname = 'ubuntu16.local'
1515

1616
machine.vm.provision 'ansible' do |ansible|
@@ -26,7 +26,7 @@ Vagrant.configure('2') do |config|
2626
config.vm.define 'jessie64.local' do |machine|
2727

2828
machine.vm.box = "debian/jessie64"
29-
machine.vm.network :private_network, ip: '192.168.88.23'
29+
machine.vm.network :private_network, ip: '192.168.88.20'
3030
machine.vm.hostname = 'jessie64.local'
3131

3232
machine.vm.provision 'ansible' do |ansible|
@@ -42,7 +42,7 @@ Vagrant.configure('2') do |config|
4242
config.vm.define 'wheezy64.local' do |machine|
4343

4444
machine.vm.box = "debian/wheezy64"
45-
machine.vm.network :private_network, ip: '192.168.88.24'
45+
machine.vm.network :private_network, ip: '192.168.88.21'
4646
machine.vm.hostname = 'wheezy64.local'
4747

4848
machine.vm.provision 'ansible' do |ansible|
@@ -58,7 +58,7 @@ Vagrant.configure('2') do |config|
5858
config.vm.define 'centos6.local' do |machine|
5959

6060
machine.vm.box = "centos/6"
61-
machine.vm.network :private_network, ip: '192.168.88.25'
61+
machine.vm.network :private_network, ip: '192.168.88.30'
6262
machine.vm.hostname = 'centos6.local'
6363

6464
machine.vm.provision 'ansible' do |ansible|
@@ -74,7 +74,7 @@ Vagrant.configure('2') do |config|
7474
config.vm.define 'centos7.local' do |machine|
7575

7676
machine.vm.box = "centos/7"
77-
machine.vm.network :private_network, ip: '192.168.88.26'
77+
machine.vm.network :private_network, ip: '192.168.88.31'
7878
machine.vm.hostname = 'centos7.local'
7979

8080
machine.vm.provision 'ansible' do |ansible|
@@ -93,7 +93,7 @@ Vagrant.configure('2') do |config|
9393
## config.vm.define 'fedora27.local' do |machine|
9494
##
9595
## machine.vm.box = "fedora/27-cloud-base"
96-
## machine.vm.network :private_network, ip: '192.168.88.27'
96+
## machine.vm.network :private_network, ip: '192.168.88.40'
9797
## machine.vm.hostname = 'fedora27.local'
9898
##
9999
## machine.vm.provision 'ansible' do |ansible|
@@ -103,42 +103,7 @@ Vagrant.configure('2') do |config|
103103
## ansible.inventory_path = 'vagrant-inventory'
104104
## ansible.host_key_checking = false
105105
## end
106-
107-
end
108-
109-
config.vm.define 'trusty64.local' do |machine|
110-
111-
machine.vm.box = "ubuntu/trusty64"
112-
machine.vm.network :private_network, ip: '192.168.88.28'
113-
machine.vm.hostname = 'trusty64.local'
114-
115-
machine.vm.provision 'ansible' do |ansible|
116-
ansible.playbook = 'tests/playbook.yml'
117-
ansible.verbose = "vvv"
118-
ansible.become = true
119-
ansible.inventory_path = 'vagrant-inventory'
120-
ansible.host_key_checking = false
121-
end
122-
123-
end
124-
125-
#
126-
# Broken, raised https://github.com/ANXS/postgresql/issues/391 to investigate
127-
#
128-
# config.vm.define 'precise64.local' do |machine|
129-
#
130-
# machine.vm.box = "ubuntu/precise64"
131-
# machine.vm.network :private_network, ip: '192.168.88.29'
132-
# machine.vm.hostname = 'precise64.local'
133-
#
134-
# machine.vm.provision 'ansible' do |ansible|
135-
# ansible.playbook = 'tests/playbook.yml'
136-
# ansible.verbose = "vvv"
137-
# ansible.become = true
138-
# ansible.inventory_path = 'vagrant-inventory'
139-
# ansible.host_key_checking = false
140-
# end
141-
#
142-
# end
106+
##
107+
## end
143108

144109
end

defaults/main.yml

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# file: postgresql/defaults/main.yml
22

33
# Basic settings
4-
postgresql_version: 11
4+
postgresql_version: 12
55
postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}" # Short version of the postgresql_version, used in some path and filenames
66
postgresql_encoding: "UTF-8"
77
postgresql_data_checksums: false
@@ -138,6 +138,8 @@ postgresql_ssl_ciphers:
138138
- "@STRENGTH"
139139
postgresql_ssl_prefer_server_ciphers: on
140140
postgresql_ssl_ecdh_curve: "prime256v1"
141+
postgresql_ssl_min_protocol_version: "TLSv1" # (>= 12)
142+
postgresql_ssl_max_protocol_version: "" # (>= 12)
141143
postgresql_ssl_dh_params_file: "" # (>= 10)
142144
postgresql_ssl_passphrase_command: "" # (>= 11)
143145
postgresql_ssl_passphrase_command_supports_reload: off # (>= 11)
@@ -159,6 +161,7 @@ postgresql_krb_caseins_users: off
159161
postgresql_tcp_keepalives_idle: 0
160162
postgresql_tcp_keepalives_interval: 0
161163
postgresql_tcp_keepalives_count: 0
164+
postgresql_tcp_user_timeout: 0 # (>= 12)
162165

163166

164167
#------------------------------------------------------------------------------
@@ -180,6 +183,8 @@ postgresql_maintenance_work_mem: 16MB # min 1MB
180183
postgresql_replacement_sort_tuples: 150000 # (>= 9.6) limits use of replacement selection sort
181184
postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
182185
postgresql_max_stack_depth: 2MB # min 100kB
186+
postgresql_shared_memory_type: "mmap" # (>= 12)
187+
183188
postgresql_dynamic_shared_memory_type: "posix" # the default is the first option
184189
# supported by the operating system:
185190
# posix
@@ -263,6 +268,8 @@ postgresql_wal_sync_method: "fsync"
263268
postgresql_full_page_writes: on
264269
postgresql_wal_compression: off # (>= 9.5)
265270
postgresql_wal_log_hints: off # also do full page writes of non-critical updates
271+
postgresql_wal_init_zero: on # zero-fill new WAL files
272+
postgresql_wal_recycle: on # recycle WAL files
266273

267274
postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
268275
postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
@@ -297,6 +304,23 @@ postgresql_archive_command: ""
297304
# force a logfile segment switch after this
298305
postgresql_archive_timeout: 0
299306

307+
# - Archive Recovery -
308+
309+
postgresql_restore_command: "" # (>= 12)
310+
postgresql_archive_cleanup_command: "" # (>= 12)
311+
postgresql_recovery_end_command: "" # (>= 12)
312+
postgresql_recovery_target: "" # (>= 12)
313+
postgresql_recovery_target_name: "" # (>= 12)
314+
postgresql_recovery_target_time: "" # (>= 12)
315+
postgresql_recovery_target_xid: "" # (>= 12)
316+
postgresql_recovery_target_lsn: "" # (>= 12)
317+
postgresql_recovery_target_inclusive: "" # (>= 12)
318+
postgresql_recovery_target_timeline: "latest" # (>= 12)
319+
postgresql_recovery_target_action: "pause" # (>= 12)
320+
postgresql_primary_conninfo: "" # (>= 12)
321+
postgresql_primary_slot_name: "" # (>= 12)
322+
postgresql_promote_trigger_file: "" # (>= 12)
323+
postgresql_recovery_min_apply_delay: 0 # (>= 12)
300324

301325
#------------------------------------------------------------------------------
302326
# REPLICATION
@@ -419,7 +443,8 @@ postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
419443
postgresql_from_collapse_limit: 8
420444
postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
421445
postgresql_force_parallel_mode: off # on, off, regress (>= 9.6)
422-
postgresql_jit: off # (>= 11)
446+
postgresql_jit: on # (>= 11: off, 12: on)
447+
postgresql_plan_cache_mode: "auto" # (>= 12)
423448

424449

425450
#------------------------------------------------------------------------------
@@ -509,6 +534,7 @@ postgresql_log_min_error_statement: "error"
509534
# -1 is disabled, 0 logs all statements and their durations, > 0 logs only
510535
# statements running at least this number of milliseconds
511536
postgresql_log_min_duration_statement: -1
537+
postgresql_log_transaction_sample_rate: 0.0 # (>= 12)
512538

513539

514540
# - What to Log -
@@ -605,7 +631,7 @@ postgresql_autovacuum_freeze_max_age: 200000000
605631
# maximum Multixact age before forced vacuum (>= 9.3)
606632
postgresql_autovacuum_multixact_freeze_max_age: 400000000
607633
# default vacuum cost delay for autovacuum, in milliseconds
608-
postgresql_autovacuum_vacuum_cost_delay: 20ms
634+
postgresql_autovacuum_vacuum_cost_delay: 2ms # (<= 11: 20ms, >=12 2ms)
609635
# default vacuum cost limit for autovacuum,
610636
postgresql_autovacuum_vacuum_cost_limit: -1
611637

@@ -621,6 +647,7 @@ postgresql_search_path: # schema names
621647
- "public"
622648
postgresql_default_tablespace: "" # a tablespace name, "" uses the default
623649
postgresql_temp_tablespaces: [] # a list of tablespace names
650+
postgresql_default_table_access_method: "heap"
624651

625652
postgresql_check_function_bodies: on
626653
postgresql_default_transaction_isolation: "read committed"

meta/main.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ galaxy_info:
1515
- name: Ubuntu
1616
versions:
1717
- xenial
18-
- trusty
18+
- bionic
1919
- name: EL
2020
versions:
2121
- 6
2222
- 7
23-
- name: Fedora
24-
versions:
25-
- 27
23+
#
24+
# DISABLED
25+
#
26+
# - name: Fedora
27+
# versions:
28+
# - 27
2629

2730
galaxy_tags:
2831
- postgresql

tasks/main.yml

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
- "../vars/empty.yml"
77
tags: [always]
88

9+
#
10+
# Override defaults/main.yml with PostgreSQL version specific values
11+
#
12+
- include_vars: "{{ item }}"
13+
with_first_found:
14+
- "../vars/postgresql_{{ postgresql_version }}.yml"
15+
- "../vars/empty.yml"
16+
tags: [always]
17+
918
- import_tasks: install_apt.yml
1019
when: ansible_pkg_mgr == "apt"
1120
tags: [postgresql, postgresql-install]

0 commit comments

Comments
 (0)