Skip to content

Commit

Permalink
Merge pull request #450 from gclough/postgresql_12
Browse files Browse the repository at this point in the history
Support PostgreSQL v12
  • Loading branch information
gclough authored Oct 25, 2019
2 parents ec4f4c7 + 94b74ca commit 97d6d5c
Show file tree
Hide file tree
Showing 18 changed files with 1,607 additions and 70 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:

env:
matrix:
- IMAGE_NAME="ubuntu-upstart:14.04"
- IMAGE_NAME="ubuntu:16.04-builded"
- IMAGE_NAME="debian:8-builded"
- IMAGE_NAME="debian:9-builded"
Expand All @@ -28,7 +27,7 @@ script:
- ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml

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

notifications:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,28 @@ Including an example of how to use your role:

| Distribution / PostgreSQL | <= 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 |
| ------------------------- |:---:|:---:|:---:|:---:|:--:|:--:|:--:|
| Ubuntu 14.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
| Ubuntu 16.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
| Debian 8.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
| Debian 9.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
| CentOS 6.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
| CentOS 7.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :grey_question:|
| Ubuntu 14.04 | :no_entry: | :no_entry:| :no_entry:| :no_entry:| :no_entry:| :no_entry:| :no_entry:|
| Ubuntu 16.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
| Debian 8.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
| Debian 9.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
| CentOS 6.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
| CentOS 7.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
| CentOS 8.x | :no_entry: | :grey_question:| :grey_question:| :grey_question:| :grey_question:| :grey_question:| :grey_question:|
| Fedora latest | :no_entry: | :x:| :x:| :x:| :x:| :x:| :x:|

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



#### Variables

```yaml
# Basic settings
postgresql_version: 11
postgresql_version: 12
postgresql_encoding: "UTF-8"
postgresql_locale: "en_US.UTF-8"
postgresql_ctype: "en_US.UTF-8"
Expand Down
53 changes: 9 additions & 44 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Vagrant.configure('2') do |config|
config.vm.define 'ubuntu16.local' do |machine|

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

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

machine.vm.box = "debian/jessie64"
machine.vm.network :private_network, ip: '192.168.88.23'
machine.vm.network :private_network, ip: '192.168.88.20'
machine.vm.hostname = 'jessie64.local'

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

machine.vm.box = "debian/wheezy64"
machine.vm.network :private_network, ip: '192.168.88.24'
machine.vm.network :private_network, ip: '192.168.88.21'
machine.vm.hostname = 'wheezy64.local'

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

machine.vm.box = "centos/6"
machine.vm.network :private_network, ip: '192.168.88.25'
machine.vm.network :private_network, ip: '192.168.88.30'
machine.vm.hostname = 'centos6.local'

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

machine.vm.box = "centos/7"
machine.vm.network :private_network, ip: '192.168.88.26'
machine.vm.network :private_network, ip: '192.168.88.31'
machine.vm.hostname = 'centos7.local'

machine.vm.provision 'ansible' do |ansible|
Expand All @@ -93,7 +93,7 @@ Vagrant.configure('2') do |config|
## config.vm.define 'fedora27.local' do |machine|
##
## machine.vm.box = "fedora/27-cloud-base"
## machine.vm.network :private_network, ip: '192.168.88.27'
## machine.vm.network :private_network, ip: '192.168.88.40'
## machine.vm.hostname = 'fedora27.local'
##
## machine.vm.provision 'ansible' do |ansible|
Expand All @@ -103,42 +103,7 @@ Vagrant.configure('2') do |config|
## ansible.inventory_path = 'vagrant-inventory'
## ansible.host_key_checking = false
## end
##
## end

# end

config.vm.define 'trusty64.local' do |machine|

machine.vm.box = "ubuntu/trusty64"
machine.vm.network :private_network, ip: '192.168.88.28'
machine.vm.hostname = 'trusty64.local'

machine.vm.provision 'ansible' do |ansible|
ansible.playbook = 'tests/playbook.yml'
ansible.verbose = "vvv"
ansible.become = true
ansible.inventory_path = 'vagrant-inventory'
ansible.host_key_checking = false
end

end

#
# Broken, raised https://github.com/ANXS/postgresql/issues/391 to investigate
#
# config.vm.define 'precise64.local' do |machine|
#
# machine.vm.box = "ubuntu/precise64"
# machine.vm.network :private_network, ip: '192.168.88.29'
# machine.vm.hostname = 'precise64.local'
#
# machine.vm.provision 'ansible' do |ansible|
# ansible.playbook = 'tests/playbook.yml'
# ansible.verbose = "vvv"
# ansible.become = true
# ansible.inventory_path = 'vagrant-inventory'
# ansible.host_key_checking = false
# end
#
# end

end
end
33 changes: 30 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# file: postgresql/defaults/main.yml

# Basic settings
postgresql_version: 11
postgresql_version: 12
postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}" # Short version of the postgresql_version, used in some path and filenames
postgresql_encoding: "UTF-8"
postgresql_data_checksums: false
Expand Down Expand Up @@ -138,6 +138,8 @@ postgresql_ssl_ciphers:
- "@STRENGTH"
postgresql_ssl_prefer_server_ciphers: on
postgresql_ssl_ecdh_curve: "prime256v1"
postgresql_ssl_min_protocol_version: "TLSv1" # (>= 12)
postgresql_ssl_max_protocol_version: "" # (>= 12)
postgresql_ssl_dh_params_file: "" # (>= 10)
postgresql_ssl_passphrase_command: "" # (>= 11)
postgresql_ssl_passphrase_command_supports_reload: off # (>= 11)
Expand All @@ -159,6 +161,7 @@ postgresql_krb_caseins_users: off
postgresql_tcp_keepalives_idle: 0
postgresql_tcp_keepalives_interval: 0
postgresql_tcp_keepalives_count: 0
postgresql_tcp_user_timeout: 0 # (>= 12)


#------------------------------------------------------------------------------
Expand All @@ -180,6 +183,8 @@ postgresql_maintenance_work_mem: 16MB # min 1MB
postgresql_replacement_sort_tuples: 150000 # (>= 9.6) limits use of replacement selection sort
postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
postgresql_max_stack_depth: 2MB # min 100kB
postgresql_shared_memory_type: "mmap" # (>= 12)

postgresql_dynamic_shared_memory_type: "posix" # the default is the first option
# supported by the operating system:
# posix
Expand Down Expand Up @@ -263,6 +268,8 @@ postgresql_wal_sync_method: "fsync"
postgresql_full_page_writes: on
postgresql_wal_compression: off # (>= 9.5)
postgresql_wal_log_hints: off # also do full page writes of non-critical updates
postgresql_wal_init_zero: on # zero-fill new WAL files
postgresql_wal_recycle: on # recycle WAL files

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

# - Archive Recovery -

postgresql_restore_command: "" # (>= 12)
postgresql_archive_cleanup_command: "" # (>= 12)
postgresql_recovery_end_command: "" # (>= 12)
postgresql_recovery_target: "" # (>= 12)
postgresql_recovery_target_name: "" # (>= 12)
postgresql_recovery_target_time: "" # (>= 12)
postgresql_recovery_target_xid: "" # (>= 12)
postgresql_recovery_target_lsn: "" # (>= 12)
postgresql_recovery_target_inclusive: "" # (>= 12)
postgresql_recovery_target_timeline: "latest" # (>= 12)
postgresql_recovery_target_action: "pause" # (>= 12)
postgresql_primary_conninfo: "" # (>= 12)
postgresql_primary_slot_name: "" # (>= 12)
postgresql_promote_trigger_file: "" # (>= 12)
postgresql_recovery_min_apply_delay: 0 # (>= 12)

#------------------------------------------------------------------------------
# REPLICATION
Expand Down Expand Up @@ -419,7 +443,8 @@ postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
postgresql_from_collapse_limit: 8
postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
postgresql_force_parallel_mode: off # on, off, regress (>= 9.6)
postgresql_jit: off # (>= 11)
postgresql_jit: on # (>= 11: off, 12: on)
postgresql_plan_cache_mode: "auto" # (>= 12)


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


# - What to Log -
Expand Down Expand Up @@ -605,7 +631,7 @@ postgresql_autovacuum_freeze_max_age: 200000000
# maximum Multixact age before forced vacuum (>= 9.3)
postgresql_autovacuum_multixact_freeze_max_age: 400000000
# default vacuum cost delay for autovacuum, in milliseconds
postgresql_autovacuum_vacuum_cost_delay: 20ms
postgresql_autovacuum_vacuum_cost_delay: 2ms # (<= 11: 20ms, >=12 2ms)
# default vacuum cost limit for autovacuum,
postgresql_autovacuum_vacuum_cost_limit: -1

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

postgresql_check_function_bodies: on
postgresql_default_transaction_isolation: "read committed"
Expand Down
11 changes: 7 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ galaxy_info:
- name: Ubuntu
versions:
- xenial
- trusty
- bionic
- name: EL
versions:
- 6
- 7
- name: Fedora
versions:
- 27
#
# DISABLED
#
# - name: Fedora
# versions:
# - 27

galaxy_tags:
- postgresql
Expand Down
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
- "../vars/empty.yml"
tags: [always]

#
# Override defaults/main.yml with PostgreSQL version specific values
#
- include_vars: "{{ item }}"
with_first_found:
- "../vars/postgresql_{{ postgresql_version }}.yml"
- "../vars/empty.yml"
tags: [always]

- import_tasks: install_apt.yml
when: ansible_pkg_mgr == "apt"
tags: [postgresql, postgresql-install]
Expand Down
Loading

0 comments on commit 97d6d5c

Please sign in to comment.