diff --git a/ansible/roles.galaxy/ANXS.postgresql/.github/workflows/ci.yml b/ansible/roles.galaxy/ANXS.postgresql/.github/workflows/ci.yml new file mode 100644 index 0000000..e1d0a0c --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +--- +name: CI +'on': + pull_request: + branches: + - master + push: + branches: + - master +# schedule: +# - cron: "0 4 * * 4" + +defaults: + run: + working-directory: 'postgresql' + +jobs: + +# lint: +# name: Lint +# runs-on: ubuntu-latest +# steps: +# - name: Check out the codebase. +# uses: actions/checkout@v2 +# with: +# path: 'postgresql' +# +# - name: Set up Python 3. +# uses: actions/setup-python@v2 +# with: +# python-version: '3.x' +# +# - name: Install test dependencies. +# run: pip3 install yamllint +# +# - name: Lint code. +# run: | +# yamllint . + + molecule: + name: Molecule + runs-on: ubuntu-latest + strategy: + matrix: + include: + - distro: centos7 + - distro: centos8 + - distro: debian9 + - distro: debian10 + - distro: fedora33 + - distro: ubuntu1604 + - distro: ubuntu1804 + - distro: ubuntu2004 + + steps: + - name: Check out the codebase. + uses: actions/checkout@v2 + with: + path: 'postgresql' + + - name: Set up Python 3. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install test dependencies. + run: pip3 install ansible molecule[docker] docker + + - name: Run Molecule tests. + run: molecule test + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + MOLECULE_DISTRO: ${{ matrix.distro }} + MOLECULE_PLAYBOOK: ${{ matrix.playbook }} diff --git a/ansible/roles.galaxy/ANXS.postgresql/.travis.yml b/ansible/roles.galaxy/ANXS.postgresql/.travis.yml deleted file mode 100644 index 0ccd7f5..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- - -language: python -python: "2.7" -sudo: required -dist: trusty -services: - - docker - -env: - matrix: - - IMAGE_NAME="ubuntu-upstart:14.04" - - IMAGE_NAME="ubuntu:16.04-builded" - - IMAGE_NAME="debian:8-builded" - - IMAGE_NAME="debian:9-builded" - - IMAGE_NAME="centos:7-builded" - - IMAGE_NAME="centos:6-builded" - - IMAGE_NAME="fedora:27-builded" -install: - - pip install ansible=="2.4.4.0" docker-py - - ln -s ${PWD} tests/docker/ANXS.postgresql - -script: - # Syntax check - - ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml --syntax-check - - # Play test - - 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 - - ./tests/idempotence_check.sh idempotence_out - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/ansible/roles.galaxy/ANXS.postgresql/README.md b/ansible/roles.galaxy/ANXS.postgresql/README.md index 86a898f..5ad10a1 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/README.md +++ b/ansible/roles.galaxy/ANXS.postgresql/README.md @@ -1,4 +1,4 @@ -## ANXS - PostgreSQL [![Build Status](https://travis-ci.org/ANXS/postgresql.svg?branch=master)](https://travis-ci.org/ANXS/postgresql) +## ANXS - PostgreSQL [![Build Status](https://github.com/ANXS/postgresql/actions/workflows/ci.yml/badge.svg)](https://github.com/ANXS/postgresql/actions/workflows/ci.yml) --- Help Wanted! If you are able and willing to help maintain this Ansible role then please open a GitHub issue. A lot of people seem to use this role and we (quite obviously) need assistance! @@ -15,9 +15,37 @@ This has been tested on Ansible 2.4.0 and higher. To install: ``` -ansible-galaxy install ANXS.postgresql +ansible-galaxy install anxs.postgresql ``` +#### Example Playbook + +An example how to include this role: + +```yml +--- +- hosts: postgresql-server + roles: + - role: ANXS.postgresql + become: yes +``` + +An example how to include this role as a task: + +```yml +--- +- hosts: postgresql-server + tasks: + - block: # workaround, see https://stackoverflow.com/a/56558842 + - name: PSQL installation and configuration + include_role: + name: ANXS.postgresql + vars: + postgresql_users: + - name: abc + password: abc + become: true +``` #### Dependencies @@ -26,34 +54,36 @@ ansible-galaxy install ANXS.postgresql #### Compatibility matrix -| Distribution / PostgreSQL | <= 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | -| ------------------------- |:---:|:---:|:---:|:---:|:--:|:--:| -| Ubuntu 14.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| -| Ubuntu 16.04 | :no_entry: | :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:| -| Debian 9.x | :no_entry: | :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:| -| CentOS 7.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| -| Fedora latest | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| :white_check_mark:| +| Distribution / PostgreSQL | 9.6 | 10 | 11 | 12 | 13 | +| ------------------------- |:---:|:--:|:--:|:--:|:--:| +| CentOS 7.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| CentOS 8.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Debian 9.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Debian 10.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | +| Ubuntu 16.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Ubuntu 18.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Ubuntu 20.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Fedora 33 | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | - :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: 13 postgresql_encoding: "UTF-8" postgresql_locale: "en_US.UTF-8" postgresql_ctype: "en_US.UTF-8" postgresql_admin_user: "postgres" -postgresql_default_auth_method: "trust" +postgresql_default_auth_method: "peer" postgresql_service_enabled: false # should the service be enabled, default is true @@ -69,6 +99,7 @@ postgresql_databases: uuid_ossp: yes # flag to install the uuid-ossp extension on this database (yes/no) citext: yes # flag to install the citext extension on this database (yes/no) encoding: "UTF-8" # override global {{ postgresql_encoding }} variable per database + state: "present" # optional; one of 'present', 'absent', 'dump', 'restore' lc_collate: "en_GB.UTF-8" # override global {{ postgresql_locale }} variable per database lc_ctype: "en_GB.UTF-8" # override global {{ postgresql_ctype }} variable per database @@ -84,6 +115,7 @@ postgresql_users: - name: baz pass: pass encrypted: yes # if password should be encrypted, postgresql >= 10 does only accepts encrypted passwords + state: "present" # optional; one of 'present', 'absent' # List of schemas to be created (optional) postgresql_database_schemas: @@ -107,7 +139,17 @@ postgresql_user_privileges: There's a lot more knobs and bolts to set, which you can find in the [defaults/main.yml](./defaults/main.yml) -#### Testing +#### Testing - Molecule + +This project comes with a molecule configuration. Please see [./molecule/README.md](./molecule/README.md) + +Examples: + +``` +molecule test +``` + +#### Testing - Vagrant This project comes with a Vagrantfile, this is a fast and easy way to test changes to the role, fire it up with `vagrant up` @@ -119,12 +161,10 @@ If you want to toy with the test play, see [tests/playbook.yml](./tests/playbook If you are contributing, please first test your changes within the vagrant environment, (using the targeted distribution), and if possible, ensure your change is covered in the tests found in [.travis.yml](./.travis.yml) - #### License Licensed under the MIT License. See the [LICENSE](./LICENSE) file for details. - #### Thanks Creator: @@ -135,6 +175,7 @@ Maintainers: - [Jonathan Freedman](https://github.com/otakup0pe) - [Sergei Antipov](https://github.com/UnderGreen) - [Greg Clough](https://github.com/gclough) +- [Magnus Lübeck](https://github.com/maglub) Top Contributors: - [David Farrington](https://github.com/farridav) diff --git a/ansible/roles.galaxy/ANXS.postgresql/Vagrantfile b/ansible/roles.galaxy/ANXS.postgresql/Vagrantfile index 3d13cd6..45c2b89 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/Vagrantfile +++ b/ansible/roles.galaxy/ANXS.postgresql/Vagrantfile @@ -7,26 +7,29 @@ Vagrant.configure('2') do |config| config.ssh.insert_key = false config.ssh.private_key_path = '~/.vagrant.d/insecure_private_key' - 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.hostname = 'ubuntu16.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 + # + # DISABLED + # + # config.vm.define 'ubuntu16.local' do |machine| + # + # machine.vm.box = "bento/ubuntu-16.04" + # machine.vm.network :private_network, ip: '192.168.88.10' + # machine.vm.hostname = 'ubuntu16.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 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| @@ -42,7 +45,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| @@ -55,26 +58,10 @@ Vagrant.configure('2') do |config| end - config.vm.define 'centos6.local' do |machine| - - machine.vm.box = "centos/6" - machine.vm.network :private_network, ip: '192.168.88.25' - machine.vm.hostname = 'centos6.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 - 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.30' machine.vm.hostname = 'centos7.local' machine.vm.provision 'ansible' do |ansible| @@ -87,55 +74,23 @@ Vagrant.configure('2') do |config| end - 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.hostname = 'fedora27.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 - - 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 +## +## Fedora is disabled, as the build fails +## +## config.vm.define 'fedora27.local' do |machine| +## +## machine.vm.box = "fedora/27-cloud-base" +## machine.vm.network :private_network, ip: '192.168.88.40' +## machine.vm.hostname = 'fedora27.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 diff --git a/ansible/roles.galaxy/ANXS.postgresql/defaults/main.yml b/ansible/roles.galaxy/ANXS.postgresql/defaults/main.yml index 948106e..ba7c41e 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/defaults/main.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/defaults/main.yml @@ -1,7 +1,7 @@ # file: postgresql/defaults/main.yml # Basic settings -postgresql_version: 11 +postgresql_version: 13 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 @@ -40,7 +40,16 @@ postgresql_ext_install_contrib: no postgresql_ext_install_dev_headers: no postgresql_ext_install_postgis: no -postgresql_ext_postgis_version: "2.5" # be careful: check whether the postgresql/postgis versions work together +# PostGIS +postgresql_postgis_release_compatibility: + 9.5: "3.0" + 9.6: "3.1" + 10: "3.1" + 12: "3.1" + 13: "3.1" + +postgresql_ext_postgis_version: "{{ postgresql_postgis_release_compatibility.get(postgresql_version) }}" +postgresql_ext_postgis_version_terse: "{{ postgresql_ext_postgis_version | replace('.','') }}" postgresql_ext_postgis_deps: - libgeos-c1 @@ -138,7 +147,9 @@ postgresql_ssl_ciphers: - "@STRENGTH" postgresql_ssl_prefer_server_ciphers: on postgresql_ssl_ecdh_curve: "prime256v1" -postgresql_ssl_dh_params_file: "" # (>= 10) +postgresql_ssl_min_protocol_version: "TLSv1.2" # (>= 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) postgresql_ssl_renegotiation_limit: 512MB # amount of data between renegotiations @@ -146,7 +157,7 @@ postgresql_ssl_cert_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem" # (>= 9.2) postgresql_ssl_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key" # (>= 9.2) postgresql_ssl_ca_file: "" # (>= 9.2) postgresql_ssl_crl_file: "" # (>= 9.2) -postgresql_password_encryption: on +postgresql_password_encryption: "{{ 'md5' if postgresql_version is version_compare('10', '>=') else 'on' }}" # (>=10.0 set to scram-sha-256 for best security) postgresql_db_user_namespace: off postgresql_row_security: off # (>= 9.5) @@ -159,6 +170,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) #------------------------------------------------------------------------------ @@ -176,10 +188,14 @@ postgresql_temp_buffers: 8MB # min 800kB postgresql_max_prepared_transactions: 0 # zero disables the feature postgresql_work_mem: 1MB # min 64kB +postgresql_hash_mem_multiplier: 1.0 # (>= 13) 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_logical_decoding_work_mem: 64MB # (>= 13) 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 @@ -222,6 +238,7 @@ postgresql_bgwriter_flush_after: 0 # (>= 9.6) 0 disables, # - Asynchronous Behavior - postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching +postgresql_maintenance_io_concurrency: 10 # (>= 13) postgresql_max_worker_processes: 8 # (change requires restart) postgresql_max_parallel_maintenance_workers: 2 # (>= 11) taken from max_parallel_workers postgresql_max_parallel_workers_per_gather: 0 # (>= 9.6) taken from max_worker_processes @@ -238,7 +255,7 @@ postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default # - Settings - -postgresql_wal_level: "minimal" # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical +postgresql_wal_level: "replica" # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical postgresql_fsync: on # flush data to disk for crash safety # (turning this off can cause # unrecoverable data corruption) @@ -263,17 +280,19 @@ 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 postgresql_wal_writer_flush_after: 1MB # (>= 9.6) 0 disables +postgresql_wal_skip_threshold: 2MB # (>= 13) postgresql_commit_delay: 0 # range 0-100000, in microseconds postgresql_commit_siblings: 5 # range 1-1000 # - Checkpoints - -postgresql_checkpoint_segments: 3 # (<= 9.4) in logfile segments, min 1, 16MB each postgresql_max_wal_size: 1GB # (>= 9.5) postgresql_min_wal_size: 80MB # (>= 9.5) postgresql_checkpoint_flush_after: 0 # (>= 9.6) 0 disables, @@ -297,6 +316,24 @@ 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 @@ -307,10 +344,13 @@ postgresql_archive_timeout: 0 # Set these on the master and on any standby that will send replication data. # max number of walsender processes -postgresql_max_wal_senders: 0 +postgresql_max_wal_senders: 10 postgresql_wal_sender_delay: 1s # walsender cycle time, 1-10000 milliseconds (<= 9.1) -postgresql_wal_keep_segments: 0 # in logfile segments, 16MB each; 0 disables +postgresql_wal_keep_segments: 0 # in logfile segments, 16MB each; 0 disables +postgresql_wal_keep_size: 0 # (>= 13) +postgresql_max_slot_wal_keep_size: -1 # (>= 13) + postgresql_replication_timeout: 60s # in milliseconds; 0 disables (<= 9.2) postgresql_wal_sender_timeout: 60s # in milliseconds; 0 disables (>= 9.3) postgresql_max_replication_slots: 0 # max number of replication slots @@ -339,6 +379,7 @@ postgresql_hot_standby: off postgresql_max_standby_archive_delay: 30s # -1 allows indefinite delay # max delay before canceling queries when reading streaming WAL; postgresql_max_standby_streaming_delay: 30s # -1 allows indefinite delay +postgresql_wal_receiver_create_temp_slot: off # (>= 13) # send replies at least this often postgresql_wal_receiver_status_interval: 10s # 0 disables # send info from standby to prevent query conflicts @@ -348,7 +389,7 @@ postgresql_wal_receiver_timeout: 60s # time to wait before retrying to retrieve WAL after a failed attempt postgresql_wal_retrieve_retry_interval: 5s # (>= 9.5) -# - Subscribers - (>= 10) +# - Subscribers - (>= 10) # These settings are ignored on a publisher. @@ -374,6 +415,7 @@ postgresql_enable_nestloop: on postgresql_enable_parallel_append: on # (>= 11) postgresql_enable_seqscan: on postgresql_enable_sort: on +postgresql_enable_incremental_sort: on # (>= 13) postgresql_enable_tidscan: on postgresql_enable_partitionwise_join: off # (>= 11) postgresql_enable_partitionwise_aggregate: off # (>= 11) @@ -419,7 +461,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) #------------------------------------------------------------------------------ @@ -509,6 +552,9 @@ 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_min_duration_sample: -1 # (>= 13) +postgresql_log_statement_sample_rate: 1.0 # (>= 13) +postgresql_log_transaction_sample_rate: 0.0 # (>= 12) # - What to Log - @@ -548,6 +594,8 @@ postgresql_log_line_prefix: "%t " # log lock waits >= deadlock_timeout postgresql_log_lock_waits: off +postgresql_log_parameter_max_length: -1 # (>= 13) +postgresql_log_parameter_max_length_on_error: 0 # (>= 13) postgresql_log_statement: "none" # none, ddl, mod, all postgresql_log_replication_commands: off # log temporary files equal or larger @@ -594,10 +642,12 @@ postgresql_autovacuum_max_workers: 3 postgresql_autovacuum_naptime: 1min # min number of row updates before vacuum postgresql_autovacuum_vacuum_threshold: 50 +postgresql_autovacuum_vacuum_insert_threshold: 1000 # (>= 13) # min number of row updates before analyze postgresql_autovacuum_analyze_threshold: 50 # fraction of table size before vacuum postgresql_autovacuum_vacuum_scale_factor: 0.2 +postgresql_autovacuum_vacuum_insert_scale_factor: 0.2 # (>= 13) # fraction of table size before analyze postgresql_autovacuum_analyze_scale_factor: 0.1 # maximum XID age before forced vacuum @@ -605,7 +655,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 @@ -621,6 +671,8 @@ 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_tablespaces_dirs: [] # a list of directories for tablespaces to be created postgresql_check_function_bodies: on postgresql_default_transaction_isolation: "read committed" @@ -640,7 +692,7 @@ postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3) postgresql_bytea_output: "hex" # hex, escape postgresql_xmlbinary: "base64" postgresql_xmloption: "content" -postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2) +postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2) postgresql_gin_pending_list_limit: 4MB # (>= 9.5) @@ -760,6 +812,7 @@ postgresql_pgtune_type: "Mixed" # Maximum number of expected connections, if "no", default based on db type postgresql_pgtune_connections: no + #------------------------------------------------------------------------------ # INSTALL/REPO #------------------------------------------------------------------------------ diff --git a/ansible/roles.galaxy/ANXS.postgresql/meta/.galaxy_install_info b/ansible/roles.galaxy/ANXS.postgresql/meta/.galaxy_install_info index 70a6a01..8b4edf7 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/meta/.galaxy_install_info +++ b/ansible/roles.galaxy/ANXS.postgresql/meta/.galaxy_install_info @@ -1,2 +1,2 @@ -install_date: Tue Jan 14 02:10:44 2020 -version: v1.11.1 +install_date: 'Fri 06 Oct 2023 03:49:00 AM ' +version: v1.13.0 diff --git a/ansible/roles.galaxy/ANXS.postgresql/meta/main.yml b/ansible/roles.galaxy/ANXS.postgresql/meta/main.yml index f384e8e..00fe91a 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/meta/main.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/meta/main.yml @@ -3,38 +3,44 @@ galaxy_info: author: pjan vandaele company: ANXS + namespace: anxs + role_name: postgresql description: "Install and configure PostgreSQL, dependencies, extensions, databases and users." min_ansible_version: 2.4.0 license: MIT + platforms: - name: Debian versions: - - jessie - stretch - - name: Ubuntu - versions: - - xenial - - trusty + - buster + - name: EL versions: - - 6 - 7 + - 8 + + - name: Ubuntu + versions: + - bionic + - focal + - xenial + - name: Fedora versions: - - 27 - categories: - - database - - database:sql + - 33 + galaxy_tags: - postgresql - postgres - - sql - database + - database:sql + - sql - postgis - debian - - ubuntu - centos - redhat - fedora + - ubuntu dependencies: [] diff --git a/ansible/roles.galaxy/ANXS.postgresql/molecule/README.md b/ansible/roles.galaxy/ANXS.postgresql/molecule/README.md new file mode 100644 index 0000000..b1ed8b5 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/molecule/README.md @@ -0,0 +1,95 @@ +# Introduction + +This directory is the home of the test playbooks: + +* ../tests/prepare.yml => setting up a VM or container with the minimum requirements (that usually is there, but not always in a container) +* ../tests/playbook.yml => running a test against a VM or container (default postgres version: 13) + +# Molecule + +The default tested version is postgresql 9.6, 10, 11, 12, and 13 on Ubuntu 20.04. Linting is disabled for the tests. + +The default distribution is ubuntu2004. You can override th with setting the environment variable MOLECULE_DISTRO to one of: + +* centos7 +* centos8 +* fedora33 +* debian9 +* debian10 +* ubuntu1604 +* ubuntu1804 +* ubuntu2004 + +Manual execution of the molecule tests with the distro of your liking. Examples: + +``` +MOLECULE_DISTRO=centos8 molecule converge +MOLECULE_DISTRO=debian10 molecule converge +MOLECULE_DISTRO=ubuntu2004 molecule converge +``` + +The images we use are extended with systemd by Jeff Geerling. See https://hub.docker.com/u/geerlingguy/ + +Prior to the testing, molecule runs the prepare.yml playbook to: + +* Create a user called `ansible`, with the default group membership of either `wheel` (CentOS, Fedora), or `sudo` (Debian, ubuntu) +* Install a couple of packages that Jeff Geerling did not install in his container images, that are needed in order to test the role properly + +The main file ./molecule/default/molecule.yml sets up versions to test from 9.6 to 13. + +# Tests + +The playbooks read variables from two files. One common vars file, and one with unique variables per OS and distribution major version. + +* ../tests/vars.yml <== read by all OS:es +* ../tests/vars.{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yml + +``` +$ ls -1 tests/ | grep vars +vars.yml +vars.CentOS.7.yml +vars.CentOS.8.yml +vars.Debian.10.yml +vars.Debian.9.yml +vars.Debian.yml +vars.Fedora.33.yml +vars.Ubuntu.16.yml +vars.Ubuntu.18.yml +vars.Ubuntu.20.yml +``` + +The main difference, currently, is which python version to use. + +# Local installation of molecule + +``` +pip install molecule molecule-docker +``` + +# Examples + +To run molecule tests locally, you can run the following commands: + +``` +#--- to just create the default containers (ubuntu2004), and run prepare.yml +molecule create + +#--- to run the tests and keep the containers +molecule converge + +#--- full life cycle of tests +molecule test + +#--- to clean up (i.e after converge, if you would like to change to a different distribution) +molecule destroy + +#--- with specific distro release +MOLECULE_DISTRO=ubuntu2004 molecule create +MOLECULE_DISTRO=ubuntu2004 molecule converge +MOLECULE_DISTRO=ubuntu2004 molecule test +MOLECULE_DISTRO=ubuntu2004 molecule destroy +``` + +# References + +* https://github.com/search?q=user%3Ageerlingguy+docker-.*-ansible \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/molecule/default/molecule.yml b/ansible/roles.galaxy/ANXS.postgresql/molecule/default/molecule.yml new file mode 100644 index 0000000..6d53ec0 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/molecule/default/molecule.yml @@ -0,0 +1,64 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: | + set -e +# yamllint . +# ansible-lint +platforms: + - name: postgresql-9_6 + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" + command: "" + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + pre_build_image: true + - name: postgresql-10 + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" + command: "" + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + pre_build_image: true + - name: postgresql-11 + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" + command: "" + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + pre_build_image: true + - name: postgresql-12 + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" + command: "" + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + pre_build_image: true + - name: postgresql-13 + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" + command: "" + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + pre_build_image: true +provisioner: + name: ansible + playbooks: + prepare: ${MOLECULE_PLAYBOOK:-../../tests/prepare.yml} + converge: ${MOLECULE_PLAYBOOK:-../../tests/playbook.yml} + inventory: + host_vars: + postgresql-9_6: + postgresql_version: 9.6 + postgresql-10: + postgresql_version: 10 + postgresql-11: + postgresql_version: 11 + postgresql-12: + postgresql_version: 12 + postgresql-13: + postgresql_version: 13 +verifier: + name: ansible diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/check_pg_version_mismatch.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/check_pg_version_mismatch.yml index c64c346..6d25709 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/check_pg_version_mismatch.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/check_pg_version_mismatch.yml @@ -14,7 +14,7 @@ # Check database version - name: PostgreSQL | Check database version shell: > - psql --quiet --tuples-only --command="select substring(version(),'[^\s]+\s+[^\s]+');" | sed 's/^ //' + psql --quiet --tuples-only --port={{ postgresql_port | int }} --command="select substring(version(),'[^\s]+\s+[^\s]+');" | sed 's/^ //' become: yes become_user: "{{ postgresql_service_user }}" changed_when: false diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/configure.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/configure.yml index 8f5f696..c9ce93b 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/configure.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/configure.yml @@ -16,6 +16,15 @@ mode: 0700 register: pgdata_dir_exist +- name: PostgreSQL | Make sure postgres tablespaces directories exist + file: + path: "{{ item }}" + owner: "{{ postgresql_service_user }}" + group: "{{ postgresql_service_group }}" + state: directory + mode: 0700 + with_items: "{{ postgresql_tablespaces_dirs }}" + - name: PostgreSQL | Make sure the postgres WAL directory exists file: path: "{{ postgresql_wal_directory }}" @@ -217,8 +226,17 @@ mode: u=rwX,g=rwXs,o=rx notify: restart postgresql -- name: PostgreSQL | Reload all conf files - service: - name: "{{ postgresql_service_name }}" - state: reloaded +- block: + - name: PostgreSQL | Ensure PostgreSQL is running + service: + name: "{{ postgresql_service_name }}" + state: started + register: postgresql_cold_started + + - name: PostgreSQL | Reload PostgreSQL configuration + service: + name: "{{ postgresql_service_name }}" + state: reloaded + register: postgresql_reloaded + when: not postgresql_cold_started.changed when: postgresql_configuration_pt1.changed or postgresql_configuration_pt2.changed or postgresql_configuration_pt3.changed or postgresql_systemd_custom_conf.changed diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/databases.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/databases.yml index 8e41223..97cfb3a 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/databases.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/databases.yml @@ -14,7 +14,7 @@ lc_ctype: "{{ item.lc_ctype | default(postgresql_ctype) }}" port: "{{postgresql_port}}" template: "template0" - state: present + state: "{{ item.state | default('present') }}" login_user: "{{postgresql_admin_user}}" become: yes become_user: "{{postgresql_admin_user}}" @@ -32,12 +32,12 @@ with_subelements: - "{{ postgresql_database_extensions }}" - extensions - register: result + ignore_errors: "{{ ansible_check_mode }}" - name: PostgreSQL | Add hstore to the databases with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" with_items: "{{postgresql_databases}}" register: hstore_ext_result failed_when: hstore_ext_result.rc != 0 and ("already exists, skipping" not in hstore_ext_result.stderr) @@ -47,7 +47,7 @@ - name: PostgreSQL | Add uuid-ossp to the database with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" with_items: "{{postgresql_databases}}" register: uuid_ext_result failed_when: uuid_ext_result.rc != 0 and ("already exists, skipping" not in uuid_ext_result.stderr) @@ -57,35 +57,35 @@ - name: PostgreSQL | Add postgis to the databases with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'&&psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'&&psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'" with_items: "{{postgresql_databases}}" when: item.gis is defined and item.gis - name: PostgreSQL | add cube to the database with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{ postgresql_admin_user }} -c 'create extension if not exists cube;'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{ postgresql_admin_user }} -c 'create extension if not exists cube;'" with_items: "{{postgresql_databases}}" when: item.cube is defined and item.cube - name: PostgreSQL | Add plpgsql to the database with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{ postgresql_admin_user }} -c 'CREATE EXTENSION IF NOT EXISTS plpgsql;'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{ postgresql_admin_user }} -c 'CREATE EXTENSION IF NOT EXISTS plpgsql;'" with_items: "{{postgresql_databases}}" when: item.plpgsql is defined and item.plpgsql - name: PostgreSQL | add earthdistance to the database with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{ postgresql_admin_user }} -c 'create extension if not exists earthdistance;'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{ postgresql_admin_user }} -c 'create extension if not exists earthdistance;'" with_items: "{{postgresql_databases}}" when: item.earthdistance is defined and item.earthdistance - name: PostgreSQL | Add citext to the database with the requirement become: yes become_user: "{{postgresql_service_user}}" - shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS citext;'" + shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --port={{ postgresql_port | int }} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS citext;'" with_items: "{{postgresql_databases}}" register: citext_ext_result failed_when: citext_ext_result.rc != 0 and ("already exists, skipping" not in citext_ext_result.stderr) diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/install_dnf.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/install_fedora.yml similarity index 57% rename from ansible/roles.galaxy/ANXS.postgresql/tasks/install_dnf.yml rename to ansible/roles.galaxy/ANXS.postgresql/tasks/install_fedora.yml index 8adf707..b1aa9c5 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/install_dnf.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/install_fedora.yml @@ -4,11 +4,19 @@ # validate www.postgresql.org (or probably any other source). - block: - - name: PostgrSQL | Install all the required depedencies | dnf + - name: PostgrSQL | Install all the required dependencies | dnf dnf: - name: "ca-certificates, python-pycurl, glibc-common, libselinux-python, python*-psycopg2" + name: "ca-certificates, python*-pycurl, glibc-common, python*-libselinux, python*-psycopg2, glibc-locale-source" state: present + #--- The package manager installed psycopg2 release 2.8.8 on Fedora 33 is not compatible with postgres < 10 + #--- This issue will probably spread to other distributions when the package based installation of + #--- psycopg2 catches up with more recent releases + - name: PIP install psycopg2-binary on Fedora 33 only if postgresql version < 10 + pip: + name: psycopg2-binary + when: postgresql_version_terse | int <= 96 and postgresql_version_terse | int >= 90 and ansible_distribution == 'Fedora' and ansible_distribution_major_version + - name: PostgreSQL | Add yum Repository | dnf yum_repository: name: postgresql diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/install_yum.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/install_rhel.yml similarity index 75% rename from ansible/roles.galaxy/ANXS.postgresql/tasks/install_yum.yml rename to ansible/roles.galaxy/ANXS.postgresql/tasks/install_rhel.yml index e06a060..f8a755b 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/install_yum.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/install_rhel.yml @@ -4,35 +4,41 @@ # validate www.postgresql.org (or probably any other source). - block: - - name: PostgreSQL | Install all the required dependencies | yum + - name: PostgreSQL | Install all the required dependencies (yum) | RHEL yum: - name: ["ca-certificates","python-psycopg2", "python-pycurl", "glibc-common","epel-release","libselinux-python"] + name: "{{ postgresql_packages }}" state: present + update_cache: yes - - name: PostgreSQL | Add PostgreSQL repository | yum + - name: PostgreSQL | Add PostgreSQL repository | RHEL yum_repository: name: postgresql description: postgresql yum repo baseurl: "{{ postgresql_yum_repository_baseurl }}" gpgkey: "{{ postgresql_yum_repository_gpgkey }}" + enabled: yes when: postgresql_install_repository - - - name: PostgreSQL | Make sure the dependencies are installed | yum - yum: - name: ["python-psycopg2", "python-pycurl", "glibc-common","libselinux-python"] - state: present - update_cache: yes - - name: PostgreSQL | Install PostgreSQL | yum + - name: PostgreSQL | Disable postgresql module (necessary for RHEL8+) + command: + cmd: dnf module disable postgresql -y + when: "ansible_distribution_major_version == '8'" + register: disable_postgresql_module + changed_when: + - "disable_postgresql_module.rc == 0" + - "'Disabling modules:\\n postgresql' in disable_postgresql_module.stdout" + + - name: PostgreSQL | Install PostgreSQL | RHEL yum: name: - "postgresql{{ postgresql_version_terse }}-server" - "postgresql{{ postgresql_version_terse }}" - "postgresql{{ postgresql_version_terse }}-contrib" state: present + update_cache: yes environment: "{{ postgresql_env }}" - - name: PostgreSQL | Setup service users profile | yum + - name: PostgreSQL | Setup service users profile | RHEL template: src: pgsql_profile.j2 dest: "~{{ postgresql_service_user }}/.pgsql_profile" @@ -41,7 +47,7 @@ mode: 0700 when: postgresql_service_user_pgsql_profile - - name: PostgreSQL | Create ~/pgtab.example | yum + - name: PostgreSQL | Create ~/pgtab.example | RHEL template: src: pgtab.j2 dest: "~{{ postgresql_service_user }}/pgtab.example" @@ -50,7 +56,7 @@ mode: 0644 when: postgresql_service_user_pgsql_profile - - name: PostgreSQL | Create ~/pgtab header | yum + - name: PostgreSQL | Create ~/pgtab header | RHEL lineinfile: path: "~{{ postgresql_service_user }}/pgtab" owner: "{{ postgresql_service_user }}" @@ -62,7 +68,7 @@ line: "# pgclustername : pgtabversion : pgrelease : pgport : pgdatabase : pgroot : pgbindir : [pgdata] : [pgwalarch] : [pgbackups]" when: postgresql_service_user_pgsql_profile - - name: PostgreSQL | Create ~/pgtab Ansible warning | yum + - name: PostgreSQL | Create ~/pgtab Ansible warning | RHEL lineinfile: path: "~{{ postgresql_service_user }}/pgtab" owner: "{{ postgresql_service_user }}" @@ -73,7 +79,7 @@ line: "# NOTICE: This file is managed by Ansible. Do not modify it." when: postgresql_service_user_pgsql_profile - - name: PostgreSQL | Add database to ~/pgtab | yum + - name: PostgreSQL | Add database to ~/pgtab | RHEL lineinfile: path: "~{{ postgresql_service_user }}/pgtab" owner: "{{ postgresql_service_user }}" @@ -83,7 +89,7 @@ line: "{{ postgresql_cluster_name }}:1:{{ postgresql_version }}:{{ postgresql_port }}:{{ postgresql_service_user }}:/var/lib/pgsql:/usr/pgsql-{{ postgresql_version }}/bin:{{ postgresql_data_directory }}:::" when: postgresql_service_user_pgsql_profile - - name: PostgreSQL | PGTune | yum + - name: PostgreSQL | PGTune | RHEL yum: name: pgtune state: present diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/main.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/main.yml index 1be654b..9eedb06 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/main.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/main.yml @@ -2,19 +2,29 @@ - include_vars: "{{ item }}" with_first_found: + - "../vars/{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml" - "../vars/{{ ansible_os_family }}.yml" - "../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] -- import_tasks: install_yum.yml - when: ansible_pkg_mgr == "yum" and ( ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) +- import_tasks: install_rhel.yml + when: (ansible_pkg_mgr == "yum" or ansible_pkg_mgr == "dnf") and (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "OracleLinux") tags: [postgresql, postgresql-install] -- import_tasks: install_dnf.yml +- import_tasks: install_fedora.yml when: ansible_pkg_mgr == "dnf" and ansible_distribution == "Fedora" tags: [postgresql, postgresql-install] diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/schemas.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/schemas.yml index 01b0503..6842e65 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/schemas.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/schemas.yml @@ -9,7 +9,7 @@ login_password: "{{ item.password | default(omit) }}" login_user: "{{ postgresql_admin_user }}" port: "{{ postgresql_port }}" - state: "{{ item.state | default(present) }}" + state: "{{ item.state | default('present') }}" become: yes become_user: "{{ postgresql_admin_user }}" with_items: "{{ postgresql_database_schemas }}" diff --git a/ansible/roles.galaxy/ANXS.postgresql/tasks/users.yml b/ansible/roles.galaxy/ANXS.postgresql/tasks/users.yml index 12e2c9f..dafe16c 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tasks/users.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tasks/users.yml @@ -11,7 +11,7 @@ password: "{{ item.pass | default(omit) }}" encrypted: "{{ item.encrypted | default(omit) }}" port: "{{postgresql_port}}" - state: present + state: "{{ item.state | default('present') }}" login_user: "{{postgresql_admin_user}}" no_log: true become: yes diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-10.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-10.j2 index 5363699..2016bbe 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-10.j2 +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-10.j2 @@ -87,7 +87,7 @@ ssl_cert_file = '{{postgresql_ssl_cert_file}}' # (change requires restart) ssl_key_file = '{{postgresql_ssl_key_file}}' # (change requires restart) ssl_ca_file = '{{postgresql_ssl_ca_file}}' # (change requires restart) ssl_crl_file = '{{postgresql_ssl_crl_file}}' # (change requires restart) -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} # md5 or scram-sha-256 +password_encryption = {{postgresql_password_encryption}} # md5 or scram-sha-256 db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} row_security = {{'on' if postgresql_row_security else 'off'}} diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-11.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-11.j2 index dd989ee..56dac58 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-11.j2 +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-11.j2 @@ -87,7 +87,7 @@ tcp_keepalives_count = {{ postgresql_tcp_keepalives_count }} # TCP_KEEPCNT; # - Authentication - authentication_timeout = {{ postgresql_authentication_timeout }} # 1s-600s -password_encryption = {{ 'on' if postgresql_password_encryption else 'off' }} # md5 or scram-sha-256 +password_encryption = {{ postgresql_password_encryption }} # md5 or scram-sha-256 db_user_namespace = {{ 'on' if postgresql_db_user_namespace else 'off' }} # GSSAPI using Kerberos @@ -169,7 +169,7 @@ effective_io_concurrency = {{ postgresql_effective_io_concurrency }} # 1-1000; max_worker_processes = {{ postgresql_max_worker_processes }} # (change requires restart) max_parallel_maintenance_workers = {{ postgresql_max_parallel_maintenance_workers }} # taken from max_parallel_workers max_parallel_workers_per_gather = {{ postgresql_max_parallel_workers_per_gather }} # taken from max_parallel_workers -parallel_leader_participation = {{ 'on' if postgresql_parallel_leader_participation else 'off' }} +parallel_leader_participation = {{ 'on' if postgresql_parallel_leader_participation else 'off' }} max_parallel_workers = {{ postgresql_max_parallel_workers }} # maximum number of max_worker_processes that # can be used in parallel operations old_snapshot_threshold = {{ postgresql_old_snapshot_threshold }} # 1min-60d; -1 disables; 0 is immediate @@ -252,7 +252,7 @@ track_commit_timestamp = {{ 'on' if postgresql_track_commit_timestamp else 'off' # These settings are ignored on a standby server. -synchronous_standby_names = '{{ postgresql_synchronous_standby_num_sync }}{% if postgresql_synchronous_standby_names != [] %} ({{ postgresql_synchronous_standby_names | join(',') }}){% endif %}' # standby servers that provide sync rep +synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}{% if postgresql_synchronous_standby_choose_sync != "" and postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_choose_sync }} {% endif %}{% if postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_num_sync }} ({% endif %}"{{ postgresql_synchronous_standby_names | join('\",\"') }}"{% if postgresql_synchronous_standby_num_sync != "" %}){% endif %}{% endif %}' # standby servers that provide sync rep # method to choose sync standbys, number of sync standbys, # and comma-separated list of application_name # from standby(s); '*' = all @@ -350,7 +350,7 @@ geqo_seed = {{ postgresql_geqo_seed }} # range 0.0-1.0 default_statistics_target = {{ postgresql_default_statistics_target }} # range 1-10000 constraint_exclusion = {{ postgresql_constraint_exclusion }} # on, off, or partition cursor_tuple_fraction = {{ postgresql_cursor_tuple_fraction }} # range 0.0-1.0 -from_collapse_limit = {{ postgresql_from_collapse_limit }} +from_collapse_limit = {{ postgresql_from_collapse_limit }} join_collapse_limit = {{ postgresql_join_collapse_limit }} # 1 disables collapsing of explicit # JOIN clauses force_parallel_mode = {{ 'on' if ( postgresql_force_parallel_mode | bool == true or postgresql_force_parallel_mode == 'on' ) else ( 'regress' if postgresql_force_parallel_mode == 'regress' else 'off' ) }} diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-12.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-12.j2 new file mode 100644 index 0000000..b69622f --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-12.j2 @@ -0,0 +1,756 @@ +# {{ ansible_managed }} +# ----------------------------- +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name = value +# +# (The "=" is optional.) Whitespace may be used. Comments are introduced with +# "#" anywhere on a line. The complete list of parameter names and allowed +# values can be found in the PostgreSQL documentation. +# +# The commented-out settings shown in this file represent the default values. +# Re-commenting a setting is NOT sufficient to revert it to the default value; +# you need to reload the server. +# +# This file is read on server startup and when the server receives a SIGHUP +# signal. If you edit the file on a running system, you have to SIGHUP the +# server for the changes to take effect, run "pg_ctl reload", or execute +# "SELECT pg_reload_conf()". Some parameters, which are marked below, +# require a server shutdown and restart to take effect. +# +# Any parameter can also be given as a command-line option to the server, e.g., +# "postgres -c log_connections=on". Some parameters can be changed at run time +# with the "SET" SQL command. +# +# Memory units: kB = kilobytes Time units: ms = milliseconds +# MB = megabytes s = seconds +# GB = gigabytes min = minutes +# TB = terabytes h = hours +# d = days + + +#------------------------------------------------------------------------------ +# FILE LOCATIONS +#------------------------------------------------------------------------------ + +# The default values of these variables are driven from the -D command-line +# option or PGDATA environment variable, represented here as ConfigDir. + +data_directory = '{{ postgresql_data_directory }}' # use data in another directory + # (change requires restart) +hba_file = '{{ postgresql_hba_file }}' # host-based authentication file + # (change requires restart) +ident_file = '{{ postgresql_ident_file }}' # ident configuration file + # (change requires restart) + +# If external_pid_file is not explicitly set, no extra PID file is written. +external_pid_file = '{{ postgresql_external_pid_file }}' # write an extra PID file + # (change requires restart) + + +#------------------------------------------------------------------------------ +# CONNECTIONS AND AUTHENTICATION +#------------------------------------------------------------------------------ + +# - Connection Settings - + +listen_addresses = '{{ postgresql_listen_addresses | join(',') }}' # what IP address(es) to listen on; + # comma-separated list of addresses; + # defaults to 'localhost'; use '*' for all + # (change requires restart) +port = {{ postgresql_port }} # (change requires restart) +max_connections = {{ postgresql_max_connections }} # (change requires restart) +superuser_reserved_connections = {{ postgresql_superuser_reserved_connections }} # (change requires restart) +unix_socket_directories = '{{ postgresql_unix_socket_directories | join(',') }}' # comma-separated list of directories + # (change requires restart) +unix_socket_group = '{{ postgresql_unix_socket_group }}' # (change requires restart) +unix_socket_permissions = {{ postgresql_unix_socket_permissions }} # begin with 0 to use octal notation + # (change requires restart) +bonjour = {{ 'on' if postgresql_bonjour else 'off' }} # advertise server via Bonjour + # (change requires restart) +bonjour_name = '{{ postgresql_bonjour_name }}' # defaults to the computer name + # (change requires restart) + +# - TCP settings - +# see "man 7 tcp" for details + +tcp_keepalives_idle = {{ postgresql_tcp_keepalives_idle }} # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +tcp_keepalives_interval = {{ postgresql_tcp_keepalives_interval }} # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +tcp_keepalives_count = {{ postgresql_tcp_keepalives_count }} # TCP_KEEPCNT; + # 0 selects the system default +tcp_user_timeout = {{ postgresql_tcp_user_timeout }} # TCP_USER_TIMEOUT, in milliseconds; + # 0 selects the system default + +# - Authentication - + +authentication_timeout = {{ postgresql_authentication_timeout }} # 1s-600s +password_encryption = {{ postgresql_password_encryption }} # md5 or scram-sha-256 +db_user_namespace = {{ 'on' if postgresql_db_user_namespace else 'off' }} + +# GSSAPI using Kerberos + +krb_server_keyfile = '{{ postgresql_krb_server_keyfile }}' +krb_caseins_users = {{ 'on' if postgresql_krb_caseins_users else 'off' }} + +# - SSL - + +ssl = {{ 'on' if postgresql_ssl else 'off' }} +ssl_ca_file = '{{ postgresql_ssl_ca_file }}' +ssl_cert_file = '{{ postgresql_ssl_cert_file }}' +ssl_crl_file = '{{ postgresql_ssl_crl_file }}' +ssl_key_file = '{{ postgresql_ssl_key_file }}' +ssl_ciphers = '{{ postgresql_ssl_ciphers | join(':') }}' # allowed SSL ciphers +ssl_prefer_server_ciphers = {{ 'on' if postgresql_ssl_prefer_server_ciphers else 'off' }} +ssl_ecdh_curve = '{{ postgresql_ssl_ecdh_curve }}' +ssl_min_protocol_version = '{{ postgresql_ssl_min_protocol_version }}' +ssl_max_protocol_version = '{{ postgresql_ssl_max_protocol_version }}' +ssl_dh_params_file = '{{ postgresql_ssl_dh_params_file }}' +ssl_passphrase_command = '{{ postgresql_ssl_passphrase_command }}' +ssl_passphrase_command_supports_reload = {{ 'on' if postgresql_ssl_passphrase_command_supports_reload else 'off' }} + + +#------------------------------------------------------------------------------ +# RESOURCE USAGE (except WAL) +#------------------------------------------------------------------------------ + +# - Memory - + +shared_buffers = {{ postgresql_shared_buffers }} # min 128kB + # (change requires restart) +huge_pages = {{ postgresql_huge_pages }} # on, off, or try + # (change requires restart) +temp_buffers = {{ postgresql_temp_buffers }} # min 800kB +max_prepared_transactions = {{ postgresql_max_prepared_transactions }} # zero disables the feature + # (change requires restart) +# Caution: it is not advisable to set max_prepared_transactions nonzero unless +# you actively intend to use prepared transactions. +work_mem = {{ postgresql_work_mem }} # min 64kB +maintenance_work_mem = {{ postgresql_maintenance_work_mem }} # min 1MB +autovacuum_work_mem = {{ postgresql_autovacuum_work_mem }} # min 1MB, or -1 to use maintenance_work_mem +max_stack_depth = {{ postgresql_max_stack_depth }} # min 100kB +shared_memory_type = {{ postgresql_shared_memory_type }} # the default is the first option + # supported by the operating system: + # mmap + # sysv + # windows + # (change requires restart) +dynamic_shared_memory_type = {{ postgresql_dynamic_shared_memory_type }} # the default is the first option + # supported by the operating system: + # posix + # sysv + # windows + # mmap + # (change requires restart) + +# - Disk - + +temp_file_limit = {{ postgresql_temp_file_limit }} # limits per-process temp file space + # in kB, or -1 for no limit + +# - Kernel Resources - + +max_files_per_process = {{ postgresql_max_files_per_process }} # min 25 + # (change requires restart) + +# - Cost-Based Vacuum Delay - + +vacuum_cost_delay = {{ postgresql_vacuum_cost_delay }} # 0-100 milliseconds (0 disables) +vacuum_cost_page_hit = {{ postgresql_vacuum_cost_page_hit }} # 0-10000 credits +vacuum_cost_page_miss = {{ postgresql_vacuum_cost_page_miss }} # 0-10000 credits +vacuum_cost_page_dirty = {{ postgresql_vacuum_cost_page_dirty }} # 0-10000 credits +vacuum_cost_limit = {{ postgresql_vacuum_cost_limit }} # 1-10000 credits + +# - Background Writer - + +bgwriter_delay = {{ postgresql_bgwriter_delay }} # 10-10000ms between rounds +bgwriter_lru_maxpages = {{ postgresql_bgwriter_lru_maxpages }} # max buffers written/round, 0 disables +bgwriter_lru_multiplier = {{ postgresql_bgwriter_lru_multiplier }} # 0-10.0 multiplier on buffers scanned/round +bgwriter_flush_after = {{ postgresql_bgwriter_flush_after }} # measured in pages, 0 disables + +# - Asynchronous Behavior - + +effective_io_concurrency = {{ postgresql_effective_io_concurrency }} # 1-1000; 0 disables prefetching +max_worker_processes = {{ postgresql_max_worker_processes }} # (change requires restart) +max_parallel_maintenance_workers = {{ postgresql_max_parallel_maintenance_workers }} # taken from max_parallel_workers +max_parallel_workers_per_gather = {{ postgresql_max_parallel_workers_per_gather }} # taken from max_parallel_workers +parallel_leader_participation = {{ 'on' if postgresql_parallel_leader_participation else 'off' }} +max_parallel_workers = {{ postgresql_max_parallel_workers }} # maximum number of max_worker_processes that + # can be used in parallel operations +old_snapshot_threshold = {{ postgresql_old_snapshot_threshold }} # 1min-60d; -1 disables; 0 is immediate + # (change requires restart) +backend_flush_after = {{ postgresql_backend_flush_after }} # measured in pages, 0 disables + + +#------------------------------------------------------------------------------ +# WRITE-AHEAD LOG +#------------------------------------------------------------------------------ + +# - Settings - + +wal_level = {{ postgresql_wal_level }} # minimal, replica, or logical + # (change requires restart) +fsync = {{ 'on' if postgresql_fsync else 'off' }} # flush data to disk for crash safety + # (turning this off can cause + # unrecoverable data corruption) +synchronous_commit = {{ postgresql_synchronous_commit }} # synchronization level; + # off, local, remote_write, remote_apply, or on +wal_sync_method = {{ postgresql_wal_sync_method }} # the default is the first option + # supported by the operating system: + # open_datasync + # fdatasync (default on Linux) + # fsync + # fsync_writethrough + # open_sync +full_page_writes = {{ 'on' if postgresql_full_page_writes else 'off' }} # recover from partial page writes +wal_compression = {{ 'on' if postgresql_wal_compression else 'off' }} # enable compression of full-page writes +wal_log_hints = {{ 'on' if postgresql_wal_log_hints else 'off' }} # also do full page writes of non-critical updates + # (change requires restart) +wal_init_zero = {{ 'on' if postgresql_wal_init_zero else 'off' }} # zero-fill new WAL files +wal_recycle = {{ 'on' if postgresql_wal_recycle else 'off' }} # recycle WAL files +wal_buffers = {{ postgresql_wal_buffers }} # min 32kB, -1 sets based on shared_buffers + # (change requires restart) +wal_writer_delay = {{ postgresql_wal_writer_delay }} # 1-10000 milliseconds +wal_writer_flush_after = {{ postgresql_wal_writer_flush_after }} # measured in pages, 0 disables + +commit_delay = {{ postgresql_commit_delay }} # range 0-100000, in microseconds +commit_siblings = {{ postgresql_commit_siblings }} # range 1-1000 + +# - Checkpoints - + +checkpoint_timeout = {{ postgresql_checkpoint_timeout }} # range 30s-1d +max_wal_size = {{ postgresql_max_wal_size }} +min_wal_size = {{ postgresql_min_wal_size }} +checkpoint_completion_target = {{ postgresql_checkpoint_completion_target }} # checkpoint target duration, 0.0 - 1.0 +checkpoint_flush_after = {{ postgresql_checkpoint_flush_after }} # measured in pages, 0 disables +checkpoint_warning = {{ postgresql_checkpoint_warning }} # 0 disables + +# - Archiving - + +archive_mode = {{ 'on' if ( postgresql_archive_mode | bool == true or postgresql_archive_mode == 'on' ) else ( 'always' if postgresql_archive_mode == 'always' else 'off' ) }} # enables archiving; off, on, or always + # (change requires restart) +archive_command = '{{ postgresql_archive_command }}' # command to use to archive a logfile segment + # placeholders: %p = path of file to archive + # %f = file name only + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' +archive_timeout = {{ postgresql_archive_timeout }} # force a logfile segment switch after this + # number of seconds; 0 disables + +# - Archive Recovery - + +# These are only used in recovery mode. + +restore_command = '{{ postgresql_restore_command }}' # command to use to restore an archived logfile segment + # placeholders: %p = path of file to restore + # %f = file name only + # e.g. 'cp /mnt/server/archivedir/%f %p' + # (change requires restart) +archive_cleanup_command = '{{ postgresql_archive_cleanup_command }}' # command to execute at every restartpoint +recovery_end_command = '{{ postgresql_recovery_end_command }}' # command to execute at completion of recovery + +# - Recovery Target - + +# Set these only when performing a targeted recovery. + +recovery_target = '{{ postgresql_recovery_target }}' # 'immediate' to end recovery as soon as a + # consistent state is reached + # (change requires restart) +recovery_target_name = '{{ postgresql_recovery_target_name }}' # the named restore point to which recovery will proceed + # (change requires restart) +recovery_target_time = '{{ postgresql_recovery_target_time }}' # the time stamp up to which recovery will proceed + # (change requires restart) +recovery_target_xid = '{{ postgresql_recovery_target_xid }}' # the transaction ID up to which recovery will proceed + # (change requires restart) +recovery_target_lsn = '{{ postgresql_recovery_target_lsn }}' # the WAL LSN up to which recovery will proceed + # (change requires restart) +recovery_target_inclusive = {{ 'on' if postgresql_recovery_target_inclusive else 'off' }} # Specifies whether to stop: + # just after the specified recovery target (on) + # just before the recovery target (off) + # (change requires restart) +recovery_target_timeline = '{{ postgresql_recovery_target_timeline }}' # 'current', 'latest', or timeline ID + # (change requires restart) +recovery_target_action = '{{ postgresql_recovery_target_action }}' # 'pause', 'promote', 'shutdown' + # (change requires restart) + + +#------------------------------------------------------------------------------ +# REPLICATION +#------------------------------------------------------------------------------ + +# - Sending Servers - + +# Set these on the master and on any standby that will send replication data. + +max_wal_senders = {{ postgresql_max_wal_senders }} # max number of walsender processes + # (change requires restart) +wal_keep_segments = {{ postgresql_wal_keep_segments }} # in logfile segments; 0 disables +wal_sender_timeout = {{ postgresql_wal_sender_timeout }} # in milliseconds; 0 disables + +max_replication_slots = {{ postgresql_max_replication_slots }} # max number of replication slots + # (change requires restart) +track_commit_timestamp = {{ 'on' if postgresql_track_commit_timestamp else 'off' }} # collect timestamp of transaction commit + # (change requires restart) + +# - Master Server - + +# These settings are ignored on a standby server. + +synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}{% if postgresql_synchronous_standby_choose_sync != "" and postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_choose_sync }} {% endif %}{% if postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_num_sync }} ({% endif %}"{{ postgresql_synchronous_standby_names | join('\",\"') }}"{% if postgresql_synchronous_standby_num_sync != "" %}){% endif %}{% endif %}' # standby servers that provide sync rep + # method to choose sync standbys, number of sync standbys, + # and comma-separated list of application_name + # from standby(s); '*' = all +vacuum_defer_cleanup_age = {{ postgresql_vacuum_defer_cleanup_age }} # number of xacts by which cleanup is delayed + +# - Standby Servers - + +# These settings are ignored on a master server. + +primary_conninfo = '{{ postgresql_primary_conninfo }}' # connection string to sending server + # (change requires restart) +primary_slot_name = '{{ postgresql_primary_slot_name }}' # replication slot on sending server + # (change requires restart) +promote_trigger_file = '{{ postgresql_promote_trigger_file }}' # file name whose presence ends recovery +hot_standby = {{ 'on' if postgresql_hot_standby else 'off' }} # "off" disallows queries during recovery + # (change requires restart) +max_standby_archive_delay = {{ postgresql_max_standby_archive_delay }} # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +max_standby_streaming_delay = {{ postgresql_max_standby_streaming_delay }} # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +wal_receiver_status_interval = {{ postgresql_wal_receiver_status_interval }} # send replies at least this often + # 0 disables +hot_standby_feedback = {{ 'on' if postgresql_hot_standby_feedback else 'off' }} # send info from standby to prevent + # query conflicts +wal_receiver_timeout = {{ postgresql_wal_receiver_timeout }} # time that receiver waits for + # communication from master + # in milliseconds; 0 disables +wal_retrieve_retry_interval = {{ postgresql_wal_retrieve_retry_interval }} # time to wait before retrying to + # retrieve WAL after a failed attempt +recovery_min_apply_delay = {{ postgresql_recovery_min_apply_delay }} # minimum delay for applying changes during recovery + +# - Subscribers - + +# These settings are ignored on a publisher. + +max_logical_replication_workers = {{ postgresql_max_logical_replication_workers }} # taken from max_worker_processes + # (change requires restart) +max_sync_workers_per_subscription = {{ postgresql_max_sync_workers_per_subscription }} # taken from max_logical_replication_workers + + +#------------------------------------------------------------------------------ +# QUERY TUNING +#------------------------------------------------------------------------------ + +# - Planner Method Configuration - + +enable_bitmapscan = {{ 'on' if postgresql_enable_bitmapscan else 'off' }} +enable_hashagg = {{ 'on' if postgresql_enable_hashagg else 'off' }} +enable_hashjoin = {{ 'on' if postgresql_enable_hashjoin else 'off' }} +enable_indexscan = {{ 'on' if postgresql_enable_indexscan else 'off' }} +enable_indexonlyscan = {{ 'on' if postgresql_enable_indexonlyscan else 'off' }} +enable_material = {{ 'on' if postgresql_enable_material else 'off' }} +enable_mergejoin = {{ 'on' if postgresql_enable_mergejoin else 'off' }} +enable_nestloop = {{ 'on' if postgresql_enable_nestloop else 'off' }} +enable_parallel_append = {{ 'on' if postgresql_enable_parallel_append else 'off' }} +enable_seqscan = {{ 'on' if postgresql_enable_seqscan else 'off' }} +enable_sort = {{ 'on' if postgresql_enable_sort else 'off' }} +enable_tidscan = {{ 'on' if postgresql_enable_tidscan else 'off' }} +enable_partitionwise_join = {{ 'on' if postgresql_enable_partitionwise_join else 'off' }} +enable_partitionwise_aggregate = {{ 'on' if postgresql_enable_partitionwise_aggregate else 'off' }} +enable_parallel_hash = {{ 'on' if postgresql_enable_parallel_hash else 'off' }} +enable_partition_pruning = {{ 'on' if postgresql_enable_partition_pruning else 'off' }} + +# - Planner Cost Constants - + +seq_page_cost = {{ postgresql_seq_page_cost }} # measured on an arbitrary scale +random_page_cost = {{ postgresql_random_page_cost }} # same scale as above +cpu_tuple_cost = {{ postgresql_cpu_tuple_cost }} # same scale as above +cpu_index_tuple_cost = {{ postgresql_cpu_index_tuple_cost }} # same scale as above +cpu_operator_cost = {{ postgresql_cpu_operator_cost }} # same scale as above +parallel_tuple_cost = {{ postgresql_parallel_tuple_cost }} # same scale as above +parallel_setup_cost = {{ postgresql_parallel_setup_cost }} # same scale as above + +jit_above_cost = {{ postgresql_jit_above_cost }} # perform JIT compilation if available + # and query more expensive than this; + # -1 disables +jit_inline_above_cost = {{ postgresql_jit_inline_above_cost }} # inline small functions if query is + # more expensive than this; -1 disables +jit_optimize_above_cost = {{ postgresql_jit_optimize_above_cost }} # use expensive JIT optimizations if + # query is more expensive than this; + # -1 disables + +min_parallel_table_scan_size = {{ postgresql_min_parallel_table_scan_size }} +min_parallel_index_scan_size = {{ postgresql_min_parallel_index_scan_size }} +effective_cache_size = {{ postgresql_effective_cache_size }} + +# - Genetic Query Optimizer - + +geqo = {{ 'on' if postgresql_geqo else 'off' }} +geqo_threshold = {{ postgresql_geqo_threshold }} +geqo_effort = {{ postgresql_geqo_effort }} # range 1-10 +geqo_pool_size = {{ postgresql_geqo_pool_size }} # selects default based on effort +geqo_generations = {{ postgresql_geqo_generations }} # selects default based on effort +geqo_selection_bias = {{ postgresql_geqo_selection_bias }} # range 1.5-2.0 +geqo_seed = {{ postgresql_geqo_seed }} # range 0.0-1.0 + +# - Other Planner Options - + +default_statistics_target = {{ postgresql_default_statistics_target }} # range 1-10000 +constraint_exclusion = {{ postgresql_constraint_exclusion }} # on, off, or partition +cursor_tuple_fraction = {{ postgresql_cursor_tuple_fraction }} # range 0.0-1.0 +from_collapse_limit = {{ postgresql_from_collapse_limit }} +join_collapse_limit = {{ postgresql_join_collapse_limit }} # 1 disables collapsing of explicit + # JOIN clauses +force_parallel_mode = {{ 'on' if ( postgresql_force_parallel_mode | bool == true or postgresql_force_parallel_mode == 'on' ) else ( 'regress' if postgresql_force_parallel_mode == 'regress' else 'off' ) }} +jit = {{ 'on' if postgresql_jit else 'off' }} # allow JIT compilation +plan_cache_mode = {{ postgresql_plan_cache_mode }} # auto, force_generic_plan or + # force_custom_plan + + +#------------------------------------------------------------------------------ +# REPORTING AND LOGGING +#------------------------------------------------------------------------------ + +# - Where to Log - + +log_destination = '{{ postgresql_log_destination }}' # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. + +# This is used when logging to stderr: +logging_collector = {{ 'on' if postgresql_logging_collector else 'off' }} # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) + +# These are only used if logging_collector is on: +log_directory = '{{ postgresql_log_directory }}' # directory where log files are written, + # can be absolute or relative to PGDATA +log_filename = '{{ postgresql_log_filename }}' # log file name pattern, + # can include strftime() escapes +log_file_mode = {{ postgresql_log_file_mode }} # creation mode for log files, + # begin with 0 to use octal notation +log_truncate_on_rotation = {{ 'on' if postgresql_log_truncate_on_rotation else 'off' }} # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. +log_rotation_age = {{ postgresql_log_rotation_age }} # Automatic rotation of logfiles will + # happen after that time. 0 disables. +log_rotation_size = {{ postgresql_log_rotation_size }} # Automatic rotation of logfiles will + # happen after that much log output. + # 0 disables. + +# These are relevant when logging to syslog: +syslog_facility = '{{ postgresql_syslog_facility }}' +syslog_ident = '{{ postgresql_syslog_ident }}' +syslog_sequence_numbers = {{ 'on' if postgresql_syslog_sequence_numbers else 'off' }} +syslog_split_messages = {{ 'on' if postgresql_syslog_split_messages else 'off' }} + +# This is only relevant when logging to eventlog (win32): +# (change requires restart) +event_source = '{{ postgresql_event_source }}' + +# - When to Log - + +log_min_messages = {{ postgresql_log_min_messages }} # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + +log_min_error_statement = {{ postgresql_log_min_error_statement }} # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + +log_min_duration_statement = {{ postgresql_log_min_duration_statement }} # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + +log_transaction_sample_rate = {{ postgresql_log_transaction_sample_rate }} # Fraction of transactions whose statements + # are logged regardless of their duration. 1.0 logs all + # statements from all transactions, 0.0 never logs. + +# - What to Log - + +debug_print_parse = {{ 'on' if postgresql_debug_print_parse else 'off' }} +debug_print_rewritten = {{ 'on' if postgresql_debug_print_rewritten else 'off' }} +debug_print_plan = {{ 'on' if postgresql_debug_print_plan else 'off' }} +debug_pretty_print = {{ 'on' if postgresql_debug_pretty_print else 'off' }} +log_checkpoints = {{ 'on' if postgresql_log_checkpoints else 'off' }} +log_connections = {{ 'on' if postgresql_log_connections else 'off' }} +log_disconnections = {{ 'on' if postgresql_log_disconnections else 'off' }} +log_duration = {{ 'on' if postgresql_log_duration else 'off' }} +log_error_verbosity = {{ postgresql_log_error_verbosity }} # terse, default, or verbose messages +log_hostname = {{ 'on' if postgresql_log_hostname else 'off' }} +log_line_prefix = '{{ postgresql_log_line_prefix }}' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %n = timestamp with milliseconds (as a Unix epoch) + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' +log_lock_waits = {{ 'on' if postgresql_log_lock_waits else 'off' }} # log lock waits >= deadlock_timeout +log_statement = '{{ postgresql_log_statement }}' # none, ddl, mod, all +log_replication_commands = {{ 'on' if postgresql_log_replication_commands else 'off' }} +log_temp_files = {{ postgresql_log_temp_files }} # log temporary files equal or larger + # than the specified size in kilobytes; + # -1 disables, 0 logs all temp files +log_timezone = '{{ postgresql_log_timezone }}' + +#------------------------------------------------------------------------------ +# PROCESS TITLE +#------------------------------------------------------------------------------ + +cluster_name = '{{ postgresql_cluster_name }}' # added to process titles if nonempty + # (change requires restart) +update_process_title = {{ 'on' if postgresql_update_process_title else 'off' }} + + +#------------------------------------------------------------------------------ +# STATISTICS +#------------------------------------------------------------------------------ + +# - Query and Index Statistics Collector - + +track_activities = {{ 'on' if postgresql_track_activities else 'off' }} +track_counts = {{ 'on' if postgresql_track_counts else 'off' }} +track_io_timing = {{ 'on' if postgresql_track_io_timing else 'off' }} +track_functions = {{ postgresql_track_functions }} # none, pl, all +track_activity_query_size = {{ postgresql_track_activity_query_size }} # (change requires restart) +stats_temp_directory = '{{ postgresql_stats_temp_directory }}' + + +# - Monitoring - + +log_parser_stats = {{ 'on' if postgresql_log_parser_stats else 'off' }} +log_planner_stats = {{ 'on' if postgresql_log_planner_stats else 'off' }} +log_executor_stats = {{ 'on' if postgresql_log_executor_stats else 'off' }} +log_statement_stats = {{ 'on' if postgresql_log_statement_stats else 'off' }} + + +#------------------------------------------------------------------------------ +# AUTOVACUUM +#------------------------------------------------------------------------------ + +autovacuum = {{ 'on' if postgresql_autovacuum else 'off' }} # Enable autovacuum subprocess? 'on' + # requires track_counts to also be on. +log_autovacuum_min_duration = {{ postgresql_log_autovacuum_min_duration }} # -1 disables, 0 logs all actions and + # their durations, > 0 logs only + # actions running at least this number + # of milliseconds. +autovacuum_max_workers = {{ postgresql_autovacuum_max_workers }} # max number of autovacuum subprocesses + # (change requires restart) +autovacuum_naptime = {{ postgresql_autovacuum_naptime }} # time between autovacuum runs +autovacuum_vacuum_threshold = {{ postgresql_autovacuum_vacuum_threshold }} # min number of row updates before + # vacuum +autovacuum_analyze_threshold = {{ postgresql_autovacuum_analyze_threshold }} # min number of row updates before + # analyze +autovacuum_vacuum_scale_factor = {{ postgresql_autovacuum_vacuum_scale_factor }} # fraction of table size before vacuum +autovacuum_analyze_scale_factor = {{ postgresql_autovacuum_analyze_scale_factor }} # fraction of table size before analyze +autovacuum_freeze_max_age = {{ postgresql_autovacuum_freeze_max_age }} # maximum XID age before forced vacuum + # (change requires restart) +autovacuum_multixact_freeze_max_age = {{ postgresql_autovacuum_multixact_freeze_max_age }} # maximum multixact age + # before forced vacuum + # (change requires restart) +autovacuum_vacuum_cost_delay = {{ postgresql_autovacuum_vacuum_cost_delay }} # default vacuum cost delay for + # autovacuum, in milliseconds; + # -1 means use vacuum_cost_delay +autovacuum_vacuum_cost_limit = {{ postgresql_autovacuum_vacuum_cost_limit }} # default vacuum cost limit for + # autovacuum, -1 means use + # vacuum_cost_limit + + +#------------------------------------------------------------------------------ +# CLIENT CONNECTION DEFAULTS +#------------------------------------------------------------------------------ + +# - Statement Behavior - + +client_min_messages = {{ postgresql_client_min_messages }} # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error +search_path = '{{ postgresql_search_path | join(',') }}' # schema names +row_security = {{ 'on' if postgresql_row_security else 'off' }} +default_tablespace = '{{ postgresql_default_tablespace }}' # a tablespace name, '' uses the default +temp_tablespaces = '{{ postgresql_temp_tablespaces | join(',') }}' # a list of tablespace names, '' uses + # only default tablespace +default_table_access_method = '{{ postgresql_default_table_access_method }}' +check_function_bodies = {{ 'on' if postgresql_check_function_bodies else 'off' }} +default_transaction_isolation = '{{ postgresql_default_transaction_isolation }}' +default_transaction_read_only = {{ 'on' if postgresql_default_transaction_read_only else 'off' }} +default_transaction_deferrable = {{ 'on' if postgresql_default_transaction_deferrable else 'off' }} +session_replication_role = '{{ postgresql_session_replication_role }}' +statement_timeout = {{ postgresql_statement_timeout }} # in milliseconds, 0 is disabled +lock_timeout = {{ postgresql_lock_timeout }} # in milliseconds, 0 is disabled +idle_in_transaction_session_timeout = {{ postgresql_idle_in_transaction_session_timeout }} # in milliseconds, 0 is disabled +vacuum_freeze_min_age = {{ postgresql_vacuum_freeze_min_age }} +vacuum_freeze_table_age = {{ postgresql_vacuum_freeze_table_age }} +vacuum_multixact_freeze_min_age = {{ postgresql_vacuum_multixact_freeze_min_age }} +vacuum_multixact_freeze_table_age = {{ postgresql_vacuum_multixact_freeze_table_age }} +vacuum_cleanup_index_scale_factor = {{ postgresql_vacuum_cleanup_index_scale_factor }} # fraction of total number of tuples + # before index cleanup, 0 always performs + # index cleanup +bytea_output = '{{ postgresql_bytea_output }}' # hex, escape +xmlbinary = '{{ postgresql_xmlbinary }}' +xmloption = '{{ postgresql_xmloption }}' +gin_fuzzy_search_limit = {{ postgresql_gin_fuzzy_search_limit }} +gin_pending_list_limit = {{ postgresql_gin_pending_list_limit }} + +# - Locale and Formatting - + +datestyle = '{{ postgresql_datestyle | join(',') }}' +intervalstyle = '{{ postgresql_intervalstyle }}' +timezone = '{{ postgresql_timezone }}' +timezone_abbreviations = '{{ postgresql_timezone_abbreviations }}' # Select the set of available time zone + # abbreviations. Currently, there are + # Default + # Australia (historical usage) + # India + # You can create your own file in + # share/timezonesets/. +extra_float_digits = {{ postgresql_extra_float_digits }} # min -15, max 3; any value >0 actually + # selects precise output mode +{% if not postgresql_client_encoding %} +#client_encoding = sql_ascii # actually, defaults to database +{% else %} +client_encoding = {{ postgresql_client_encoding }} # actually, defaults to database +{% endif %} + # encoding + +# These settings are initialized by initdb, but they can be changed. +lc_messages = '{{ postgresql_lc_messages }}' # locale for system error message + # strings +lc_monetary = '{{ postgresql_lc_monetary }}' # locale for monetary formatting +lc_numeric = '{{ postgresql_lc_numeric }}' # locale for number formatting +lc_time = '{{ postgresql_lc_time }}' # locale for time formatting + +# default configuration for text search +default_text_search_config = '{{ postgresql_default_text_search_config }}' + +# - Shared Library Preloading - + +shared_preload_libraries = '{{ postgresql_shared_preload_libraries | join(',') }}' # (change requires restart) +local_preload_libraries = '{{ postgresql_local_preload_libraries | join(',') }}' +session_preload_libraries = '{{ postgresql_session_preload_libraries | join(',') }}' +jit_provider = '{{ postgresql_jit_provider }}' # JIT library to use + +# - Other Defaults - + +dynamic_library_path = '{{ postgresql_dynamic_library_path }}' + + +#------------------------------------------------------------------------------ +# LOCK MANAGEMENT +#------------------------------------------------------------------------------ + +deadlock_timeout = {{ postgresql_deadlock_timeout }} +max_locks_per_transaction = {{ postgresql_max_locks_per_transaction }} # min 10 + # (change requires restart) +max_pred_locks_per_transaction = {{ postgresql_max_pred_locks_per_transaction }} # min 10 + # (change requires restart) +max_pred_locks_per_relation = {{ postgresql_max_pred_locks_per_relation }} # negative values mean + # (max_pred_locks_per_transaction + # / -max_pred_locks_per_relation) - 1 +max_pred_locks_per_page = {{ postgresql_max_pred_locks_per_page }} # min 0 + + +#------------------------------------------------------------------------------ +# VERSION AND PLATFORM COMPATIBILITY +#------------------------------------------------------------------------------ + +# - Previous PostgreSQL Versions - + +array_nulls = {{ 'on' if postgresql_array_nulls else 'off' }} +backslash_quote = {{ postgresql_backslash_quote }} # on, off, or safe_encoding +escape_string_warning = {{ 'on' if postgresql_escape_string_warning else 'off' }} +lo_compat_privileges = {{ 'on' if postgresql_lo_compat_privileges else 'off' }} +operator_precedence_warning = {{ 'on' if postgresql_operator_precedence_warning else 'off' }} +quote_all_identifiers = {{ 'on' if postgresql_quote_all_identifiers else 'off' }} +standard_conforming_strings = {{ 'on' if postgresql_standard_conforming_strings else 'off' }} +synchronize_seqscans = {{ 'on' if postgresql_synchronize_seqscans else 'off' }} + +# - Other Platforms and Clients - + +transform_null_equals = {{ 'on' if postgresql_transform_null_equals else 'off' }} + + +#------------------------------------------------------------------------------ +# ERROR HANDLING +#------------------------------------------------------------------------------ + +exit_on_error = {{ 'on' if postgresql_exit_on_error else 'off' }} # terminate session on any error? +restart_after_crash = {{ 'on' if postgresql_restart_after_crash else 'off' }} # reinitialize after backend crash? +data_sync_retry = {{ 'on' if postgresql_data_sync_retry else 'off' }} # retry or panic on failure to fsync + # data? + # (change requires restart) + + +#------------------------------------------------------------------------------ +# CONFIG FILE INCLUDES +#------------------------------------------------------------------------------ + +# These options allow settings to be loaded from files other than the +# default postgresql.conf. Note that these are directives, not variable +# assignments, so they can usefully be given more than once. + +include_dir = '{{ postgresql_include_dir }}' # include files ending in '.conf' from + # a directory, e.g., 'conf.d' +{{ '#' if not postgresql_include_if_exists | bool else '' }}include_if_exists = '{{ postgresql_include_if_exists }}' # include file only if it exists +{{ '#' if not postgresql_include | bool else '' }}include = '{{ postgresql_include }}' # include file + + +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +# Add settings for extensions here diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.4.orig b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-12.orig similarity index 66% rename from ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.4.orig rename to ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-12.orig index 8dfd485..26c1b87 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.4.orig +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-12.orig @@ -16,9 +16,9 @@ # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. +# server for the changes to take effect, run "pg_ctl reload", or execute +# "SELECT pg_reload_conf()". Some parameters, which are marked below, +# require a server shutdown and restart to take effect. # # Any parameter can also be given as a command-line option to the server, e.g., # "postgres -c log_connections=on". Some parameters can be changed at run time @@ -62,8 +62,6 @@ # (change requires restart) #port = 5432 # (change requires restart) #max_connections = 100 # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). #superuser_reserved_connections = 3 # (change requires restart) #unix_socket_directories = '/tmp' # comma-separated list of directories # (change requires restart) @@ -75,35 +73,43 @@ #bonjour_name = '' # defaults to the computer name # (change requires restart) -# - Security and Authentication - +# - TCP settings - +# see "man 7 tcp" for details + +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +#tcp_keepalives_count = 0 # TCP_KEEPCNT; + # 0 selects the system default +#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; + # 0 selects the system default + +# - Authentication - #authentication_timeout = 1min # 1s-600s -#ssl = off # (change requires restart) -#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers - # (change requires restart) -#ssl_prefer_server_ciphers = on # (change requires restart) -#ssl_ecdh_curve = 'prime256v1' # (change requires restart) -#ssl_renegotiation_limit = 512MB # amount of data between renegotiations -#ssl_cert_file = 'server.crt' # (change requires restart) -#ssl_key_file = 'server.key' # (change requires restart) -#ssl_ca_file = '' # (change requires restart) -#ssl_crl_file = '' # (change requires restart) -#password_encryption = on +#password_encryption = md5 # md5 or scram-sha-256 #db_user_namespace = off # GSSAPI using Kerberos #krb_server_keyfile = '' #krb_caseins_users = off -# - TCP Keepalives - -# see "man 7 tcp" for details +# - SSL - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default +#ssl = off +#ssl_ca_file = '' +#ssl_cert_file = 'server.crt' +#ssl_crl_file = '' +#ssl_key_file = 'server.key' +#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers +#ssl_prefer_server_ciphers = on +#ssl_ecdh_curve = 'prime256v1' +#ssl_min_protocol_version = 'TLSv1' +#ssl_max_protocol_version = '' +#ssl_dh_params_file = '' +#ssl_passphrase_command = '' +#ssl_passphrase_command_supports_reload = off #------------------------------------------------------------------------------ @@ -119,36 +125,39 @@ #temp_buffers = 8MB # min 800kB #max_prepared_transactions = 0 # zero disables the feature # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. +# Caution: it is not advisable to set max_prepared_transactions nonzero unless +# you actively intend to use prepared transactions. #work_mem = 4MB # min 64kB #maintenance_work_mem = 64MB # min 1MB #autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem #max_stack_depth = 2MB # min 100kB +#shared_memory_type = mmap # the default is the first option + # supported by the operating system: + # mmap + # sysv + # windows + # (change requires restart) #dynamic_shared_memory_type = posix # the default is the first option # supported by the operating system: # posix # sysv # windows # mmap - # use none to disable dynamic shared memory + # (change requires restart) # - Disk - -#temp_file_limit = -1 # limits per-session temp file space +#temp_file_limit = -1 # limits per-process temp file space # in kB, or -1 for no limit -# - Kernel Resource Usage - +# - Kernel Resources - #max_files_per_process = 1000 # min 25 # (change requires restart) -#shared_preload_libraries = '' # (change requires restart) # - Cost-Based Vacuum Delay - -#vacuum_cost_delay = 0 # 0-100 milliseconds +#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) #vacuum_cost_page_hit = 1 # 0-10000 credits #vacuum_cost_page_miss = 10 # 0-10000 credits #vacuum_cost_page_dirty = 20 # 0-10000 credits @@ -157,26 +166,37 @@ # - Background Writer - #bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round +#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round +#bgwriter_flush_after = 0 # measured in pages, 0 disables # - Asynchronous Behavior - #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching -#max_worker_processes = 8 +#max_worker_processes = 8 # (change requires restart) +#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers +#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers +#parallel_leader_participation = on +#max_parallel_workers = 8 # maximum number of max_worker_processes that + # can be used in parallel operations +#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate + # (change requires restart) +#backend_flush_after = 0 # measured in pages, 0 disables #------------------------------------------------------------------------------ -# WRITE AHEAD LOG +# WRITE-AHEAD LOG #------------------------------------------------------------------------------ # - Settings - -#wal_level = minimal # minimal, archive, hot_standby, or logical +#wal_level = replica # minimal, replica, or logical # (change requires restart) -#fsync = on # turns forced synchronization on or off +#fsync = on # flush data to disk for crash safety + # (turning this off can cause + # unrecoverable data corruption) #synchronous_commit = on # synchronization level; - # off, local, remote_write, or on + # off, local, remote_write, remote_apply, or on #wal_sync_method = fsync # the default is the first option # supported by the operating system: # open_datasync @@ -185,25 +205,31 @@ # fsync_writethrough # open_sync #full_page_writes = on # recover from partial page writes +#wal_compression = off # enable compression of full-page writes #wal_log_hints = off # also do full page writes of non-critical updates # (change requires restart) +#wal_init_zero = on # zero-fill new WAL files +#wal_recycle = on # recycle WAL files #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers # (change requires restart) #wal_writer_delay = 200ms # 1-10000 milliseconds +#wal_writer_flush_after = 1MB # measured in pages, 0 disables #commit_delay = 0 # range 0-100000, in microseconds #commit_siblings = 5 # range 1-1000 # - Checkpoints - -#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each -#checkpoint_timeout = 5min # range 30s-1h +#checkpoint_timeout = 5min # range 30s-1d +#max_wal_size = 1GB +#min_wal_size = 80MB #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 +#checkpoint_flush_after = 0 # measured in pages, 0 disables #checkpoint_warning = 30s # 0 disables # - Archiving - -#archive_mode = off # allows archiving to be done +#archive_mode = off # enables archiving; off, on, or always # (change requires restart) #archive_command = '' # command to use to archive a logfile segment # placeholders: %p = path of file to archive @@ -212,21 +238,59 @@ #archive_timeout = 0 # force a logfile segment switch after this # number of seconds; 0 disables +# - Archive Recovery - + +# These are only used in recovery mode. + +#restore_command = '' # command to use to restore an archived logfile segment + # placeholders: %p = path of file to restore + # %f = file name only + # e.g. 'cp /mnt/server/archivedir/%f %p' + # (change requires restart) +#archive_cleanup_command = '' # command to execute at every restartpoint +#recovery_end_command = '' # command to execute at completion of recovery + +# - Recovery Target - + +# Set these only when performing a targeted recovery. + +#recovery_target = '' # 'immediate' to end recovery as soon as a + # consistent state is reached + # (change requires restart) +#recovery_target_name = '' # the named restore point to which recovery will proceed + # (change requires restart) +#recovery_target_time = '' # the time stamp up to which recovery will proceed + # (change requires restart) +#recovery_target_xid = '' # the transaction ID up to which recovery will proceed + # (change requires restart) +#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed + # (change requires restart) +#recovery_target_inclusive = on # Specifies whether to stop: + # just after the specified recovery target (on) + # just before the recovery target (off) + # (change requires restart) +#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID + # (change requires restart) +#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' + # (change requires restart) + #------------------------------------------------------------------------------ # REPLICATION #------------------------------------------------------------------------------ -# - Sending Server(s) - +# - Sending Servers - # Set these on the master and on any standby that will send replication data. -#max_wal_senders = 0 # max number of walsender processes +#max_wal_senders = 10 # max number of walsender processes # (change requires restart) -#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables +#wal_keep_segments = 0 # in logfile segments; 0 disables #wal_sender_timeout = 60s # in milliseconds; 0 disables -#max_replication_slots = 0 # max number of replication slots +#max_replication_slots = 10 # max number of replication slots + # (change requires restart) +#track_commit_timestamp = off # collect timestamp of transaction commit # (change requires restart) # - Master Server - @@ -234,7 +298,8 @@ # These settings are ignored on a standby server. #synchronous_standby_names = '' # standby servers that provide sync rep - # comma-separated list of application_name + # method to choose sync standbys, number of sync standbys, + # and comma-separated list of application_name # from standby(s); '*' = all #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed @@ -242,7 +307,12 @@ # These settings are ignored on a master server. -#hot_standby = off # "on" allows queries during recovery +#primary_conninfo = '' # connection string to sending server + # (change requires restart) +#primary_slot_name = '' # replication slot on sending server + # (change requires restart) +#promote_trigger_file = '' # file name whose presence ends recovery +#hot_standby = on # "off" disallows queries during recovery # (change requires restart) #max_standby_archive_delay = 30s # max delay before canceling queries # when reading WAL from archive; @@ -257,6 +327,17 @@ #wal_receiver_timeout = 60s # time that receiver waits for # communication from master # in milliseconds; 0 disables +#wal_retrieve_retry_interval = 5s # time to wait before retrying to + # retrieve WAL after a failed attempt +#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery + +# - Subscribers - + +# These settings are ignored on a publisher. + +#max_logical_replication_workers = 4 # taken from max_worker_processes + # (change requires restart) +#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers #------------------------------------------------------------------------------ @@ -273,9 +354,14 @@ #enable_material = on #enable_mergejoin = on #enable_nestloop = on +#enable_parallel_append = on #enable_seqscan = on #enable_sort = on #enable_tidscan = on +#enable_partitionwise_join = off +#enable_partitionwise_aggregate = off +#enable_parallel_hash = on +#enable_partition_pruning = on # - Planner Cost Constants - @@ -284,6 +370,20 @@ #cpu_tuple_cost = 0.01 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above +#parallel_tuple_cost = 0.1 # same scale as above +#parallel_setup_cost = 1000.0 # same scale as above + +#jit_above_cost = 100000 # perform JIT compilation if available + # and query more expensive than this; + # -1 disables +#jit_inline_above_cost = 500000 # inline small functions if query is + # more expensive than this; -1 disables +#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if + # query is more expensive than this; + # -1 disables + +#min_parallel_table_scan_size = 8MB +#min_parallel_index_scan_size = 512kB #effective_cache_size = 4GB # - Genetic Query Optimizer - @@ -304,33 +404,37 @@ #from_collapse_limit = 8 #join_collapse_limit = 8 # 1 disables collapsing of explicit # JOIN clauses +#force_parallel_mode = off +#jit = on # allow JIT compilation +#plan_cache_mode = auto # auto, force_generic_plan or + # force_custom_plan #------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING +# REPORTING AND LOGGING #------------------------------------------------------------------------------ # - Where to Log - -#log_destination = 'stderr' # Valid values are combinations of +log_destination = 'stderr' # Valid values are combinations of # stderr, csvlog, syslog, and eventlog, # depending on platform. csvlog # requires logging_collector to be on. # This is used when logging to stderr: -#logging_collector = off # Enable capturing of stderr and csvlog +logging_collector = on # Enable capturing of stderr and csvlog # into log files. Required to be on for # csvlogs. # (change requires restart) # These are only used if logging_collector is on: -#log_directory = 'pg_log' # directory where log files are written, +log_directory = 'log' # directory where log files are written, # can be absolute or relative to PGDATA -#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, +log_filename = 'postgresql-%a.log' # log file name pattern, # can include strftime() escapes #log_file_mode = 0600 # creation mode for log files, # begin with 0 to use octal notation -#log_truncate_on_rotation = off # If on, an existing log file with the +log_truncate_on_rotation = on # If on, an existing log file with the # same name as the new log file will be # truncated rather than appended to. # But such truncation only occurs on @@ -338,32 +442,24 @@ # or size-driven rotation. Default is # off, meaning append to existing files # in all cases. -#log_rotation_age = 1d # Automatic rotation of logfiles will +log_rotation_age = 1d # Automatic rotation of logfiles will # happen after that time. 0 disables. -#log_rotation_size = 10MB # Automatic rotation of logfiles will +log_rotation_size = 0 # Automatic rotation of logfiles will # happen after that much log output. # 0 disables. # These are relevant when logging to syslog: #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' +#syslog_sequence_numbers = on +#syslog_split_messages = on # This is only relevant when logging to eventlog (win32): +# (change requires restart) #event_source = 'PostgreSQL' # - When to Log - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 @@ -397,6 +493,9 @@ # statements running at least this number # of milliseconds +#log_transaction_sample_rate = 0.0 # Fraction of transactions whose statements + # are logged regardless of their duration. 1.0 logs all + # statements from all transactions, 0.0 never logs. # - What to Log - @@ -410,7 +509,7 @@ #log_duration = off #log_error_verbosity = default # terse, default, or verbose messages #log_hostname = off -#log_line_prefix = '' # special values: +log_line_prefix = '%m [%p] ' # special values: # %a = application name # %u = user name # %d = database name @@ -419,6 +518,7 @@ # %p = process ID # %t = timestamp without milliseconds # %m = timestamp with milliseconds + # %n = timestamp with milliseconds (as a Unix epoch) # %i = command tag # %e = SQL state # %c = session ID @@ -432,28 +532,36 @@ # e.g. '<%u%%%d> ' #log_lock_waits = off # log lock waits >= deadlock_timeout #log_statement = 'none' # none, ddl, mod, all +#log_replication_commands = off #log_temp_files = -1 # log temporary files equal or larger # than the specified size in kilobytes; # -1 disables, 0 logs all temp files #log_timezone = 'GMT' +#------------------------------------------------------------------------------ +# PROCESS TITLE +#------------------------------------------------------------------------------ + +#cluster_name = '' # added to process titles if nonempty + # (change requires restart) +#update_process_title = on + #------------------------------------------------------------------------------ -# RUNTIME STATISTICS +# STATISTICS #------------------------------------------------------------------------------ -# - Query/Index Statistics Collector - +# - Query and Index Statistics Collector - #track_activities = on #track_counts = on #track_io_timing = off #track_functions = none # none, pl, all #track_activity_query_size = 1024 # (change requires restart) -#update_process_title = on #stats_temp_directory = 'pg_stat_tmp' -# - Statistics Monitoring - +# - Monitoring - #log_parser_stats = off #log_planner_stats = off @@ -462,7 +570,7 @@ #------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS +# AUTOVACUUM #------------------------------------------------------------------------------ #autovacuum = on # Enable autovacuum subprocess? 'on' @@ -485,7 +593,7 @@ #autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age # before forced vacuum # (change requires restart) -#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for +#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for # autovacuum, in milliseconds; # -1 means use vacuum_cost_delay #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for @@ -499,10 +607,22 @@ # - Statement Behavior - -#search_path = '"$user",public' # schema names +#client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error +#search_path = '"$user", public' # schema names +#row_security = on #default_tablespace = '' # a tablespace name, '' uses the default #temp_tablespaces = '' # a list of tablespace names, '' uses # only default tablespace +#default_table_access_method = 'heap' #check_function_bodies = on #default_transaction_isolation = 'read committed' #default_transaction_read_only = off @@ -510,13 +630,19 @@ #session_replication_role = 'origin' #statement_timeout = 0 # in milliseconds, 0 is disabled #lock_timeout = 0 # in milliseconds, 0 is disabled +#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled #vacuum_freeze_min_age = 50000000 #vacuum_freeze_table_age = 150000000 #vacuum_multixact_freeze_min_age = 5000000 #vacuum_multixact_freeze_table_age = 150000000 +#vacuum_cleanup_index_scale_factor = 0.1 # fraction of total number of tuples + # before index cleanup, 0 always performs + # index cleanup #bytea_output = 'hex' # hex, escape #xmlbinary = 'base64' #xmloption = 'content' +#gin_fuzzy_search_limit = 0 +#gin_pending_list_limit = 4MB # - Locale and Formatting - @@ -530,7 +656,8 @@ # India # You can create your own file in # share/timezonesets/. -#extra_float_digits = 0 # min -15, max 3 +#extra_float_digits = 1 # min -15, max 3; any value >0 actually + # selects precise output mode #client_encoding = sql_ascii # actually, defaults to database # encoding @@ -544,11 +671,16 @@ # default configuration for text search #default_text_search_config = 'pg_catalog.simple' -# - Other Defaults - +# - Shared Library Preloading - -#dynamic_library_path = '$libdir' +#shared_preload_libraries = '' # (change requires restart) #local_preload_libraries = '' #session_preload_libraries = '' +#jit_provider = 'llvmjit' # JIT library to use + +# - Other Defaults - + +#dynamic_library_path = '$libdir' #------------------------------------------------------------------------------ @@ -558,26 +690,26 @@ #deadlock_timeout = 1s #max_locks_per_transaction = 64 # min 10 # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. #max_pred_locks_per_transaction = 64 # min 10 # (change requires restart) +#max_pred_locks_per_relation = -2 # negative values mean + # (max_pred_locks_per_transaction + # / -max_pred_locks_per_relation) - 1 +#max_pred_locks_per_page = 2 # min 0 #------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY +# VERSION AND PLATFORM COMPATIBILITY #------------------------------------------------------------------------------ # - Previous PostgreSQL Versions - #array_nulls = on #backslash_quote = safe_encoding # on, off, or safe_encoding -#default_with_oids = off #escape_string_warning = on #lo_compat_privileges = off +#operator_precedence_warning = off #quote_all_identifiers = off -#sql_inheritance = on #standard_conforming_strings = on #synchronize_seqscans = on @@ -592,6 +724,9 @@ #exit_on_error = off # terminate session on any error? #restart_after_crash = on # reinitialize after backend crash? +#data_sync_retry = off # retry or panic on failure to fsync + # data? + # (change requires restart) #------------------------------------------------------------------------------ @@ -599,12 +734,13 @@ #------------------------------------------------------------------------------ # These options allow settings to be loaded from files other than the -# default postgresql.conf. +# default postgresql.conf. Note that these are directives, not variable +# assignments, so they can usefully be given more than once. -#include_dir = 'conf.d' # include files ending in '.conf' from - # directory 'conf.d' -#include_if_exists = 'exists.conf' # include file only if it exists -#include = 'special.conf' # include file +#include_dir = '...' # include files ending in '.conf' from + # a directory, e.g., 'conf.d' +#include_if_exists = '...' # include file only if it exists +#include = '...' # include file #------------------------------------------------------------------------------ diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-13.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-13.j2 new file mode 100644 index 0000000..b34b3ca --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-13.j2 @@ -0,0 +1,786 @@ +# {{ ansible_managed }} +# ----------------------------- +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name = value +# +# (The "=" is optional.) Whitespace may be used. Comments are introduced with +# "#" anywhere on a line. The complete list of parameter names and allowed +# values can be found in the PostgreSQL documentation. +# +# The commented-out settings shown in this file represent the default values. +# Re-commenting a setting is NOT sufficient to revert it to the default value; +# you need to reload the server. +# +# This file is read on server startup and when the server receives a SIGHUP +# signal. If you edit the file on a running system, you have to SIGHUP the +# server for the changes to take effect, run "pg_ctl reload", or execute +# "SELECT pg_reload_conf()". Some parameters, which are marked below, +# require a server shutdown and restart to take effect. +# +# Any parameter can also be given as a command-line option to the server, e.g., +# "postgres -c log_connections=on". Some parameters can be changed at run time +# with the "SET" SQL command. +# +# Memory units: kB = kilobytes Time units: ms = milliseconds +# MB = megabytes s = seconds +# GB = gigabytes min = minutes +# TB = terabytes h = hours +# d = days + + +#------------------------------------------------------------------------------ +# FILE LOCATIONS +#------------------------------------------------------------------------------ + +# The default values of these variables are driven from the -D command-line +# option or PGDATA environment variable, represented here as ConfigDir. + +data_directory = '{{ postgresql_data_directory }}' # use data in another directory + # (change requires restart) +hba_file = '{{ postgresql_hba_file }}' # host-based authentication file + # (change requires restart) +ident_file = '{{ postgresql_ident_file }}' # ident configuration file + # (change requires restart) + +# If external_pid_file is not explicitly set, no extra PID file is written. +external_pid_file = '{{ postgresql_external_pid_file }}' # write an extra PID file + # (change requires restart) + + +#------------------------------------------------------------------------------ +# CONNECTIONS AND AUTHENTICATION +#------------------------------------------------------------------------------ + +# - Connection Settings - + +listen_addresses = '{{ postgresql_listen_addresses | join(',') }}' # what IP address(es) to listen on; + # comma-separated list of addresses; + # defaults to 'localhost'; use '*' for all + # (change requires restart) +port = {{ postgresql_port }} # (change requires restart) +max_connections = {{ postgresql_max_connections }} # (change requires restart) +superuser_reserved_connections = {{ postgresql_superuser_reserved_connections }} # (change requires restart) +unix_socket_directories = '{{ postgresql_unix_socket_directories | join(',') }}' # comma-separated list of directories + # (change requires restart) +unix_socket_group = '{{ postgresql_unix_socket_group }}' # (change requires restart) +unix_socket_permissions = {{ postgresql_unix_socket_permissions }} # begin with 0 to use octal notation + # (change requires restart) +bonjour = {{ 'on' if postgresql_bonjour else 'off' }} # advertise server via Bonjour + # (change requires restart) +bonjour_name = '{{ postgresql_bonjour_name }}' # defaults to the computer name + # (change requires restart) + +# - TCP settings - +# see "man tcp" for details + +tcp_keepalives_idle = {{ postgresql_tcp_keepalives_idle }} # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +tcp_keepalives_interval = {{ postgresql_tcp_keepalives_interval }} # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +tcp_keepalives_count = {{ postgresql_tcp_keepalives_count }} # TCP_KEEPCNT; + # 0 selects the system default +tcp_user_timeout = {{ postgresql_tcp_user_timeout }} # TCP_USER_TIMEOUT, in milliseconds; + # 0 selects the system default + +# - Authentication - + +authentication_timeout = {{ postgresql_authentication_timeout }} # 1s-600s +password_encryption = {{ postgresql_password_encryption }} # md5 or scram-sha-256 +db_user_namespace = {{ 'on' if postgresql_db_user_namespace else 'off' }} + +# GSSAPI using Kerberos + +krb_server_keyfile = '{{ postgresql_krb_server_keyfile }}' +krb_caseins_users = {{ 'on' if postgresql_krb_caseins_users else 'off' }} + +# - SSL - + +ssl = {{ 'on' if postgresql_ssl else 'off' }} +ssl_ca_file = '{{ postgresql_ssl_ca_file }}' +ssl_cert_file = '{{ postgresql_ssl_cert_file }}' +ssl_crl_file = '{{ postgresql_ssl_crl_file }}' +ssl_key_file = '{{ postgresql_ssl_key_file }}' +ssl_ciphers = '{{ postgresql_ssl_ciphers | join(':') }}' # allowed SSL ciphers +ssl_prefer_server_ciphers = {{ 'on' if postgresql_ssl_prefer_server_ciphers else 'off' }} +ssl_ecdh_curve = '{{ postgresql_ssl_ecdh_curve }}' +ssl_min_protocol_version = '{{ postgresql_ssl_min_protocol_version }}' +ssl_max_protocol_version = '{{ postgresql_ssl_max_protocol_version }}' +ssl_dh_params_file = '{{ postgresql_ssl_dh_params_file }}' +ssl_passphrase_command = '{{ postgresql_ssl_passphrase_command }}' +ssl_passphrase_command_supports_reload = {{ 'on' if postgresql_ssl_passphrase_command_supports_reload else 'off' }} + + +#------------------------------------------------------------------------------ +# RESOURCE USAGE (except WAL) +#------------------------------------------------------------------------------ + +# - Memory - + +shared_buffers = {{ postgresql_shared_buffers }} # min 128kB + # (change requires restart) +huge_pages = {{ postgresql_huge_pages }} # on, off, or try + # (change requires restart) +temp_buffers = {{ postgresql_temp_buffers }} # min 800kB +max_prepared_transactions = {{ postgresql_max_prepared_transactions }} # zero disables the feature + # (change requires restart) +# Caution: it is not advisable to set max_prepared_transactions nonzero unless +# you actively intend to use prepared transactions. +work_mem = {{ postgresql_work_mem }} # min 64kB +hash_mem_multiplier = {{ postgresql_hash_mem_multiplier }} # 1-1000.0 multiplier on hash table work_mem +maintenance_work_mem = {{ postgresql_maintenance_work_mem }} # min 1MB +autovacuum_work_mem = {{ postgresql_autovacuum_work_mem }} # min 1MB, or -1 to use maintenance_work_mem +logical_decoding_work_mem = {{ postgresql_logical_decoding_work_mem }} # min 64kB +max_stack_depth = {{ postgresql_max_stack_depth }} # min 100kB +shared_memory_type = {{ postgresql_shared_memory_type }} # the default is the first option + # supported by the operating system: + # mmap + # sysv + # windows + # (change requires restart) +dynamic_shared_memory_type = {{ postgresql_dynamic_shared_memory_type }} # the default is the first option + # supported by the operating system: + # posix + # sysv + # windows + # mmap + # (change requires restart) + +# - Disk - + +temp_file_limit = {{ postgresql_temp_file_limit }} # limits per-process temp file space + # in kilobytes, or -1 for no limit + +# - Kernel Resources - + +max_files_per_process = {{ postgresql_max_files_per_process }} # min 64 + # (change requires restart) + +# - Cost-Based Vacuum Delay - + +vacuum_cost_delay = {{ postgresql_vacuum_cost_delay }} # 0-100 milliseconds (0 disables) +vacuum_cost_page_hit = {{ postgresql_vacuum_cost_page_hit }} # 0-10000 credits +vacuum_cost_page_miss = {{ postgresql_vacuum_cost_page_miss }} # 0-10000 credits +vacuum_cost_page_dirty = {{ postgresql_vacuum_cost_page_dirty }} # 0-10000 credits +vacuum_cost_limit = {{ postgresql_vacuum_cost_limit }} # 1-10000 credits + +# - Background Writer - + +bgwriter_delay = {{ postgresql_bgwriter_delay }} # 10-10000ms between rounds +bgwriter_lru_maxpages = {{ postgresql_bgwriter_lru_maxpages }} # max buffers written/round, 0 disables +bgwriter_lru_multiplier = {{ postgresql_bgwriter_lru_multiplier }} # 0-10.0 multiplier on buffers scanned/round +bgwriter_flush_after = {{ postgresql_bgwriter_flush_after }} # measured in pages, 0 disables + +# - Asynchronous Behavior - + +effective_io_concurrency = {{ postgresql_effective_io_concurrency }} # 1-1000; 0 disables prefetching +maintenance_io_concurrency = {{ postgresql_maintenance_io_concurrency }} # 1-1000; 0 disables prefetching +max_worker_processes = {{ postgresql_max_worker_processes }} # (change requires restart) +max_parallel_maintenance_workers = {{ postgresql_max_parallel_maintenance_workers }} # taken from max_parallel_workers +max_parallel_workers_per_gather = {{ postgresql_max_parallel_workers_per_gather }} # taken from max_parallel_workers +parallel_leader_participation = {{ 'on' if postgresql_parallel_leader_participation else 'off' }} +max_parallel_workers = {{ postgresql_max_parallel_workers }} # maximum number of max_worker_processes that + # can be used in parallel operations +old_snapshot_threshold = {{ postgresql_old_snapshot_threshold }} # 1min-60d; -1 disables; 0 is immediate + # (change requires restart) +backend_flush_after = {{ postgresql_backend_flush_after }} # measured in pages, 0 disables + + +#------------------------------------------------------------------------------ +# WRITE-AHEAD LOG +#------------------------------------------------------------------------------ + +# - Settings - + +wal_level = {{ postgresql_wal_level }} # minimal, replica, or logical + # (change requires restart) +fsync = {{ 'on' if postgresql_fsync else 'off' }} # flush data to disk for crash safety + # (turning this off can cause + # unrecoverable data corruption) +synchronous_commit = {{ postgresql_synchronous_commit }} # synchronization level; + # off, local, remote_write, remote_apply, or on +wal_sync_method = {{ postgresql_wal_sync_method }} # the default is the first option + # supported by the operating system: + # open_datasync + # fdatasync (default on Linux) + # fsync + # fsync_writethrough + # open_sync +full_page_writes = {{ 'on' if postgresql_full_page_writes else 'off' }} # recover from partial page writes +wal_compression = {{ 'on' if postgresql_wal_compression else 'off' }} # enable compression of full-page writes +wal_log_hints = {{ 'on' if postgresql_wal_log_hints else 'off' }} # also do full page writes of non-critical updates + # (change requires restart) +wal_init_zero = {{ 'on' if postgresql_wal_init_zero else 'off' }} # zero-fill new WAL files +wal_recycle = {{ 'on' if postgresql_wal_recycle else 'off' }} # recycle WAL files +wal_buffers = {{ postgresql_wal_buffers }} # min 32kB, -1 sets based on shared_buffers + # (change requires restart) +wal_writer_delay = {{ postgresql_wal_writer_delay }} # 1-10000 milliseconds +wal_writer_flush_after = {{ postgresql_wal_writer_flush_after }} # measured in pages, 0 disables +wal_skip_threshold = {{ postgresql_wal_skip_threshold }} + +commit_delay = {{ postgresql_commit_delay }} # range 0-100000, in microseconds +commit_siblings = {{ postgresql_commit_siblings }} # range 1-1000 + +# - Checkpoints - + +checkpoint_timeout = {{ postgresql_checkpoint_timeout }} # range 30s-1d +max_wal_size = {{ postgresql_max_wal_size }} +min_wal_size = {{ postgresql_min_wal_size }} +checkpoint_completion_target = {{ postgresql_checkpoint_completion_target }} # checkpoint target duration, 0.0 - 1.0 +checkpoint_flush_after = {{ postgresql_checkpoint_flush_after }} # measured in pages, 0 disables +checkpoint_warning = {{ postgresql_checkpoint_warning }} # 0 disables + +# - Archiving - + +archive_mode = {{ 'on' if ( postgresql_archive_mode | bool == true or postgresql_archive_mode == 'on' ) else ( 'always' if postgresql_archive_mode == 'always' else 'off' ) }} # enables archiving; off, on, or always + # (change requires restart) +archive_command = '{{ postgresql_archive_command }}' # command to use to archive a logfile segment + # placeholders: %p = path of file to archive + # %f = file name only + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' +archive_timeout = {{ postgresql_archive_timeout }} # force a logfile segment switch after this + # number of seconds; 0 disables + +# - Archive Recovery - + +# These are only used in recovery mode. + +restore_command = '{{ postgresql_restore_command }}' # command to use to restore an archived logfile segment + # placeholders: %p = path of file to restore + # %f = file name only + # e.g. 'cp /mnt/server/archivedir/%f %p' + # (change requires restart) +archive_cleanup_command = '{{ postgresql_archive_cleanup_command }}' # command to execute at every restartpoint +recovery_end_command = '{{ postgresql_recovery_end_command }}' # command to execute at completion of recovery + +# - Recovery Target - + +# Set these only when performing a targeted recovery. + +recovery_target = '{{ postgresql_recovery_target }}' # 'immediate' to end recovery as soon as a + # consistent state is reached + # (change requires restart) +recovery_target_name = '{{ postgresql_recovery_target_name }}' # the named restore point to which recovery will proceed + # (change requires restart) +recovery_target_time = '{{ postgresql_recovery_target_time }}' # the time stamp up to which recovery will proceed + # (change requires restart) +recovery_target_xid = '{{ postgresql_recovery_target_xid }}' # the transaction ID up to which recovery will proceed + # (change requires restart) +recovery_target_lsn = '{{ postgresql_recovery_target_lsn }}' # the WAL LSN up to which recovery will proceed + # (change requires restart) +recovery_target_inclusive = {{ 'on' if postgresql_recovery_target_inclusive else 'off' }} # Specifies whether to stop: + # just after the specified recovery target (on) + # just before the recovery target (off) + # (change requires restart) +recovery_target_timeline = '{{ postgresql_recovery_target_timeline }}' # 'current', 'latest', or timeline ID + # (change requires restart) +recovery_target_action = '{{ postgresql_recovery_target_action }}' # 'pause', 'promote', 'shutdown' + # (change requires restart) + + +#------------------------------------------------------------------------------ +# REPLICATION +#------------------------------------------------------------------------------ + +# - Sending Servers - + +# Set these on the master and on any standby that will send replication data. + +max_wal_senders = {{ postgresql_max_wal_senders }} # max number of walsender processes + # (change requires restart) +wal_keep_size = {{ postgresql_wal_keep_size }} # in megabytes; 0 disables +max_slot_wal_keep_size = {{ postgresql_max_slot_wal_keep_size }} # in megabytes; -1 disables +wal_sender_timeout = {{ postgresql_wal_sender_timeout }} # in milliseconds; 0 disables + +max_replication_slots = {{ postgresql_max_replication_slots }} # max number of replication slots + # (change requires restart) +track_commit_timestamp = {{ 'on' if postgresql_track_commit_timestamp else 'off' }} # collect timestamp of transaction commit + # (change requires restart) + +# - Master Server - + +# These settings are ignored on a standby server. + +synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}{% if postgresql_synchronous_standby_choose_sync != "" and postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_choose_sync }} {% endif %}{% if postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_num_sync }} ({% endif %}"{{ postgresql_synchronous_standby_names | join('\",\"') }}"{% if postgresql_synchronous_standby_num_sync != "" %}){% endif %}{% endif %}' # standby servers that provide sync rep + # method to choose sync standbys, number of sync standbys, + # and comma-separated list of application_name + # from standby(s); '*' = all +vacuum_defer_cleanup_age = {{ postgresql_vacuum_defer_cleanup_age }} # number of xacts by which cleanup is delayed + +# - Standby Servers - + +# These settings are ignored on a master server. + +primary_conninfo = '{{ postgresql_primary_conninfo }}' # connection string to sending server + # (change requires restart) +primary_slot_name = '{{ postgresql_primary_slot_name }}' # replication slot on sending server + # (change requires restart) +promote_trigger_file = '{{ postgresql_promote_trigger_file }}' # file name whose presence ends recovery +hot_standby = {{ 'on' if postgresql_hot_standby else 'off' }} # "off" disallows queries during recovery + # (change requires restart) +max_standby_archive_delay = {{ postgresql_max_standby_archive_delay }} # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +max_standby_streaming_delay = {{ postgresql_max_standby_streaming_delay }} # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +wal_receiver_create_temp_slot = {{ postgresql_wal_receiver_create_temp_slot }} # create temp slot if primary_slot_name + # is not set + +wal_receiver_status_interval = {{ postgresql_wal_receiver_status_interval }} # send replies at least this often + # 0 disables +hot_standby_feedback = {{ 'on' if postgresql_hot_standby_feedback else 'off' }} # send info from standby to prevent + # query conflicts +wal_receiver_timeout = {{ postgresql_wal_receiver_timeout }} # time that receiver waits for + # communication from master + # in milliseconds; 0 disables +wal_retrieve_retry_interval = {{ postgresql_wal_retrieve_retry_interval }} # time to wait before retrying to + # retrieve WAL after a failed attempt +recovery_min_apply_delay = {{ postgresql_recovery_min_apply_delay }} # minimum delay for applying changes during recovery + +# - Subscribers - + +# These settings are ignored on a publisher. + +max_logical_replication_workers = {{ postgresql_max_logical_replication_workers }} # taken from max_worker_processes + # (change requires restart) +max_sync_workers_per_subscription = {{ postgresql_max_sync_workers_per_subscription }} # taken from max_logical_replication_workers + + +#------------------------------------------------------------------------------ +# QUERY TUNING +#------------------------------------------------------------------------------ + +# - Planner Method Configuration - + +enable_bitmapscan = {{ 'on' if postgresql_enable_bitmapscan else 'off' }} +enable_hashagg = {{ 'on' if postgresql_enable_hashagg else 'off' }} +enable_hashjoin = {{ 'on' if postgresql_enable_hashjoin else 'off' }} +enable_indexscan = {{ 'on' if postgresql_enable_indexscan else 'off' }} +enable_indexonlyscan = {{ 'on' if postgresql_enable_indexonlyscan else 'off' }} +enable_material = {{ 'on' if postgresql_enable_material else 'off' }} +enable_mergejoin = {{ 'on' if postgresql_enable_mergejoin else 'off' }} +enable_nestloop = {{ 'on' if postgresql_enable_nestloop else 'off' }} +enable_parallel_append = {{ 'on' if postgresql_enable_parallel_append else 'off' }} +enable_seqscan = {{ 'on' if postgresql_enable_seqscan else 'off' }} +enable_sort = {{ 'on' if postgresql_enable_sort else 'off' }} +enable_incremental_sort = {{ 'on' if postgresql_enable_incremental_sort else 'off' }} +enable_tidscan = {{ 'on' if postgresql_enable_tidscan else 'off' }} +enable_partitionwise_join = {{ 'on' if postgresql_enable_partitionwise_join else 'off' }} +enable_partitionwise_aggregate = {{ 'on' if postgresql_enable_partitionwise_aggregate else 'off' }} +enable_parallel_hash = {{ 'on' if postgresql_enable_parallel_hash else 'off' }} +enable_partition_pruning = {{ 'on' if postgresql_enable_partition_pruning else 'off' }} + +# - Planner Cost Constants - + +seq_page_cost = {{ postgresql_seq_page_cost }} # measured on an arbitrary scale +random_page_cost = {{ postgresql_random_page_cost }} # same scale as above +cpu_tuple_cost = {{ postgresql_cpu_tuple_cost }} # same scale as above +cpu_index_tuple_cost = {{ postgresql_cpu_index_tuple_cost }} # same scale as above +cpu_operator_cost = {{ postgresql_cpu_operator_cost }} # same scale as above +parallel_tuple_cost = {{ postgresql_parallel_tuple_cost }} # same scale as above +parallel_setup_cost = {{ postgresql_parallel_setup_cost }} # same scale as above + +jit_above_cost = {{ postgresql_jit_above_cost }} # perform JIT compilation if available + # and query more expensive than this; + # -1 disables +jit_inline_above_cost = {{ postgresql_jit_inline_above_cost }} # inline small functions if query is + # more expensive than this; -1 disables +jit_optimize_above_cost = {{ postgresql_jit_optimize_above_cost }} # use expensive JIT optimizations if + # query is more expensive than this; + # -1 disables + +min_parallel_table_scan_size = {{ postgresql_min_parallel_table_scan_size }} +min_parallel_index_scan_size = {{ postgresql_min_parallel_index_scan_size }} +effective_cache_size = {{ postgresql_effective_cache_size }} + +# - Genetic Query Optimizer - + +geqo = {{ 'on' if postgresql_geqo else 'off' }} +geqo_threshold = {{ postgresql_geqo_threshold }} +geqo_effort = {{ postgresql_geqo_effort }} # range 1-10 +geqo_pool_size = {{ postgresql_geqo_pool_size }} # selects default based on effort +geqo_generations = {{ postgresql_geqo_generations }} # selects default based on effort +geqo_selection_bias = {{ postgresql_geqo_selection_bias }} # range 1.5-2.0 +geqo_seed = {{ postgresql_geqo_seed }} # range 0.0-1.0 + +# - Other Planner Options - + +default_statistics_target = {{ postgresql_default_statistics_target }} # range 1-10000 +constraint_exclusion = {{ postgresql_constraint_exclusion }} # on, off, or partition +cursor_tuple_fraction = {{ postgresql_cursor_tuple_fraction }} # range 0.0-1.0 +from_collapse_limit = {{ postgresql_from_collapse_limit }} +join_collapse_limit = {{ postgresql_join_collapse_limit }} # 1 disables collapsing of explicit + # JOIN clauses +force_parallel_mode = {{ 'on' if ( postgresql_force_parallel_mode | bool == true or postgresql_force_parallel_mode == 'on' ) else ( 'regress' if postgresql_force_parallel_mode == 'regress' else 'off' ) }} +jit = {{ 'on' if postgresql_jit else 'off' }} # allow JIT compilation +plan_cache_mode = {{ postgresql_plan_cache_mode }} # auto, force_generic_plan or + # force_custom_plan + + +#------------------------------------------------------------------------------ +# REPORTING AND LOGGING +#------------------------------------------------------------------------------ + +# - Where to Log - + +log_destination = '{{ postgresql_log_destination }}' # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. + +# This is used when logging to stderr: +logging_collector = {{ 'on' if postgresql_logging_collector else 'off' }} # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) + +# These are only used if logging_collector is on: +log_directory = '{{ postgresql_log_directory }}' # directory where log files are written, + # can be absolute or relative to PGDATA +log_filename = '{{ postgresql_log_filename }}' # log file name pattern, + # can include strftime() escapes +log_file_mode = {{ postgresql_log_file_mode }} # creation mode for log files, + # begin with 0 to use octal notation +log_truncate_on_rotation = {{ 'on' if postgresql_log_truncate_on_rotation else 'off' }} # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. +log_rotation_age = {{ postgresql_log_rotation_age }} # Automatic rotation of logfiles will + # happen after that time. 0 disables. +log_rotation_size = {{ postgresql_log_rotation_size }} # Automatic rotation of logfiles will + # happen after that much log output. + # 0 disables. + +# These are relevant when logging to syslog: +syslog_facility = '{{ postgresql_syslog_facility }}' +syslog_ident = '{{ postgresql_syslog_ident }}' +syslog_sequence_numbers = {{ 'on' if postgresql_syslog_sequence_numbers else 'off' }} +syslog_split_messages = {{ 'on' if postgresql_syslog_split_messages else 'off' }} + +# This is only relevant when logging to eventlog (win32): +# (change requires restart) +event_source = '{{ postgresql_event_source }}' + +# - When to Log - + +log_min_messages = {{ postgresql_log_min_messages }} # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + +log_min_error_statement = {{ postgresql_log_min_error_statement }} # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + +log_min_duration_statement = {{ postgresql_log_min_duration_statement }} # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + +log_min_duration_sample = {{ postgresql_log_min_duration_sample }} # -1 is disabled, 0 logs a sample of statements + # and their durations, > 0 logs only a sample of + # statements running at least this number + # of milliseconds; + # sample fraction is determined by log_statement_sample_rate + +log_statement_sample_rate = {{ postgresql_log_statement_sample_rate }} # fraction of logged statements exceeding + # log_min_duration_sample to be logged; + # 1.0 logs all such statements, 0.0 never logs + +log_transaction_sample_rate = {{ postgresql_log_transaction_sample_rate }} # Fraction of transactions whose statements + # are logged regardless of their duration. 1.0 logs all + # statements from all transactions, 0.0 never logs. + +# - What to Log - + +debug_print_parse = {{ 'on' if postgresql_debug_print_parse else 'off' }} +debug_print_rewritten = {{ 'on' if postgresql_debug_print_rewritten else 'off' }} +debug_print_plan = {{ 'on' if postgresql_debug_print_plan else 'off' }} +debug_pretty_print = {{ 'on' if postgresql_debug_pretty_print else 'off' }} +log_checkpoints = {{ 'on' if postgresql_log_checkpoints else 'off' }} +log_connections = {{ 'on' if postgresql_log_connections else 'off' }} +log_disconnections = {{ 'on' if postgresql_log_disconnections else 'off' }} +log_duration = {{ 'on' if postgresql_log_duration else 'off' }} +log_error_verbosity = {{ postgresql_log_error_verbosity }} # terse, default, or verbose messages +log_hostname = {{ 'on' if postgresql_log_hostname else 'off' }} +log_line_prefix = '{{ postgresql_log_line_prefix }}' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %n = timestamp with milliseconds (as a Unix epoch) + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' +log_lock_waits = {{ 'on' if postgresql_log_lock_waits else 'off' }} # log lock waits >= deadlock_timeout +log_parameter_max_length = {{ postgresql_log_parameter_max_length }} # when logging statements, limit logged + # bind-parameter values to N bytes; + # -1 means print in full, 0 disables +log_parameter_max_length_on_error = {{ postgresql_log_parameter_max_length_on_error }} # when logging an error, limit logged + # bind-parameter values to N bytes; + # -1 means print in full, 0 disables +log_statement = '{{ postgresql_log_statement }}' # none, ddl, mod, all +log_replication_commands = {{ 'on' if postgresql_log_replication_commands else 'off' }} +log_temp_files = {{ postgresql_log_temp_files }} # log temporary files equal or larger + # than the specified size in kilobytes; + # -1 disables, 0 logs all temp files +log_timezone = '{{ postgresql_log_timezone }}' + +#------------------------------------------------------------------------------ +# PROCESS TITLE +#------------------------------------------------------------------------------ + +cluster_name = '{{ postgresql_cluster_name }}' # added to process titles if nonempty + # (change requires restart) +update_process_title = {{ 'on' if postgresql_update_process_title else 'off' }} + + +#------------------------------------------------------------------------------ +# STATISTICS +#------------------------------------------------------------------------------ + +# - Query and Index Statistics Collector - + +track_activities = {{ 'on' if postgresql_track_activities else 'off' }} +track_counts = {{ 'on' if postgresql_track_counts else 'off' }} +track_io_timing = {{ 'on' if postgresql_track_io_timing else 'off' }} +track_functions = {{ postgresql_track_functions }} # none, pl, all +track_activity_query_size = {{ postgresql_track_activity_query_size }} # (change requires restart) +stats_temp_directory = '{{ postgresql_stats_temp_directory }}' + + +# - Monitoring - + +log_parser_stats = {{ 'on' if postgresql_log_parser_stats else 'off' }} +log_planner_stats = {{ 'on' if postgresql_log_planner_stats else 'off' }} +log_executor_stats = {{ 'on' if postgresql_log_executor_stats else 'off' }} +log_statement_stats = {{ 'on' if postgresql_log_statement_stats else 'off' }} + + +#------------------------------------------------------------------------------ +# AUTOVACUUM +#------------------------------------------------------------------------------ + +autovacuum = {{ 'on' if postgresql_autovacuum else 'off' }} # Enable autovacuum subprocess? 'on' + # requires track_counts to also be on. +log_autovacuum_min_duration = {{ postgresql_log_autovacuum_min_duration }} # -1 disables, 0 logs all actions and + # their durations, > 0 logs only + # actions running at least this number + # of milliseconds. +autovacuum_max_workers = {{ postgresql_autovacuum_max_workers }} # max number of autovacuum subprocesses + # (change requires restart) +autovacuum_naptime = {{ postgresql_autovacuum_naptime }} # time between autovacuum runs +autovacuum_vacuum_threshold = {{ postgresql_autovacuum_vacuum_threshold }} # min number of row updates before + # vacuum +autovacuum_vacuum_insert_threshold = {{ postgresql_autovacuum_vacuum_insert_threshold }} # min number of row inserts + # before vacuum; -1 disables insert + # vacuums +autovacuum_analyze_threshold = {{ postgresql_autovacuum_analyze_threshold }} # min number of row updates before + # analyze +autovacuum_vacuum_scale_factor = {{ postgresql_autovacuum_vacuum_scale_factor }} # fraction of table size before vacuum +autovacuum_vacuum_insert_scale_factor = {{ postgresql_autovacuum_vacuum_insert_scale_factor }} # fraction of inserts over table + # size before insert vacuum +autovacuum_analyze_scale_factor = {{ postgresql_autovacuum_analyze_scale_factor }} # fraction of table size before analyze +autovacuum_freeze_max_age = {{ postgresql_autovacuum_freeze_max_age }} # maximum XID age before forced vacuum + # (change requires restart) +autovacuum_multixact_freeze_max_age = {{ postgresql_autovacuum_multixact_freeze_max_age }} # maximum multixact age + # before forced vacuum + # (change requires restart) +autovacuum_vacuum_cost_delay = {{ postgresql_autovacuum_vacuum_cost_delay }} # default vacuum cost delay for + # autovacuum, in milliseconds; + # -1 means use vacuum_cost_delay +autovacuum_vacuum_cost_limit = {{ postgresql_autovacuum_vacuum_cost_limit }} # default vacuum cost limit for + # autovacuum, -1 means use + # vacuum_cost_limit + + +#------------------------------------------------------------------------------ +# CLIENT CONNECTION DEFAULTS +#------------------------------------------------------------------------------ + +# - Statement Behavior - + +client_min_messages = {{ postgresql_client_min_messages }} # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error +search_path = '{{ postgresql_search_path | join(',') }}' # schema names +row_security = {{ 'on' if postgresql_row_security else 'off' }} +default_tablespace = '{{ postgresql_default_tablespace }}' # a tablespace name, '' uses the default +temp_tablespaces = '{{ postgresql_temp_tablespaces | join(',') }}' # a list of tablespace names, '' uses + # only default tablespace +default_table_access_method = '{{ postgresql_default_table_access_method }}' +check_function_bodies = {{ 'on' if postgresql_check_function_bodies else 'off' }} +default_transaction_isolation = '{{ postgresql_default_transaction_isolation }}' +default_transaction_read_only = {{ 'on' if postgresql_default_transaction_read_only else 'off' }} +default_transaction_deferrable = {{ 'on' if postgresql_default_transaction_deferrable else 'off' }} +session_replication_role = '{{ postgresql_session_replication_role }}' +statement_timeout = {{ postgresql_statement_timeout }} # in milliseconds, 0 is disabled +lock_timeout = {{ postgresql_lock_timeout }} # in milliseconds, 0 is disabled +idle_in_transaction_session_timeout = {{ postgresql_idle_in_transaction_session_timeout }} # in milliseconds, 0 is disabled +vacuum_freeze_min_age = {{ postgresql_vacuum_freeze_min_age }} +vacuum_freeze_table_age = {{ postgresql_vacuum_freeze_table_age }} +vacuum_multixact_freeze_min_age = {{ postgresql_vacuum_multixact_freeze_min_age }} +vacuum_multixact_freeze_table_age = {{ postgresql_vacuum_multixact_freeze_table_age }} +vacuum_cleanup_index_scale_factor = {{ postgresql_vacuum_cleanup_index_scale_factor }} # fraction of total number of tuples + # before index cleanup, 0 always performs + # index cleanup +bytea_output = '{{ postgresql_bytea_output }}' # hex, escape +xmlbinary = '{{ postgresql_xmlbinary }}' +xmloption = '{{ postgresql_xmloption }}' +gin_fuzzy_search_limit = {{ postgresql_gin_fuzzy_search_limit }} +gin_pending_list_limit = {{ postgresql_gin_pending_list_limit }} + +# - Locale and Formatting - + +datestyle = '{{ postgresql_datestyle | join(',') }}' +intervalstyle = '{{ postgresql_intervalstyle }}' +timezone = '{{ postgresql_timezone }}' +timezone_abbreviations = '{{ postgresql_timezone_abbreviations }}' # Select the set of available time zone + # abbreviations. Currently, there are + # Default + # Australia (historical usage) + # India + # You can create your own file in + # share/timezonesets/. +extra_float_digits = {{ postgresql_extra_float_digits }} # min -15, max 3; any value >0 actually + # selects precise output mode +{% if not postgresql_client_encoding %} +#client_encoding = sql_ascii # actually, defaults to database +{% else %} +client_encoding = {{ postgresql_client_encoding }} # actually, defaults to database +{% endif %} + # encoding + +# These settings are initialized by initdb, but they can be changed. +lc_messages = '{{ postgresql_lc_messages }}' # locale for system error message + # strings +lc_monetary = '{{ postgresql_lc_monetary }}' # locale for monetary formatting +lc_numeric = '{{ postgresql_lc_numeric }}' # locale for number formatting +lc_time = '{{ postgresql_lc_time }}' # locale for time formatting + +# default configuration for text search +default_text_search_config = '{{ postgresql_default_text_search_config }}' + +# - Shared Library Preloading - + +shared_preload_libraries = '{{ postgresql_shared_preload_libraries | join(',') }}' # (change requires restart) +local_preload_libraries = '{{ postgresql_local_preload_libraries | join(',') }}' +session_preload_libraries = '{{ postgresql_session_preload_libraries | join(',') }}' +jit_provider = '{{ postgresql_jit_provider }}' # JIT library to use + +# - Other Defaults - + +dynamic_library_path = '{{ postgresql_dynamic_library_path }}' + + +#------------------------------------------------------------------------------ +# LOCK MANAGEMENT +#------------------------------------------------------------------------------ + +deadlock_timeout = {{ postgresql_deadlock_timeout }} +max_locks_per_transaction = {{ postgresql_max_locks_per_transaction }} # min 10 + # (change requires restart) +max_pred_locks_per_transaction = {{ postgresql_max_pred_locks_per_transaction }} # min 10 + # (change requires restart) +max_pred_locks_per_relation = {{ postgresql_max_pred_locks_per_relation }} # negative values mean + # (max_pred_locks_per_transaction + # / -max_pred_locks_per_relation) - 1 +max_pred_locks_per_page = {{ postgresql_max_pred_locks_per_page }} # min 0 + + +#------------------------------------------------------------------------------ +# VERSION AND PLATFORM COMPATIBILITY +#------------------------------------------------------------------------------ + +# - Previous PostgreSQL Versions - + +array_nulls = {{ 'on' if postgresql_array_nulls else 'off' }} +backslash_quote = {{ postgresql_backslash_quote }} # on, off, or safe_encoding +escape_string_warning = {{ 'on' if postgresql_escape_string_warning else 'off' }} +lo_compat_privileges = {{ 'on' if postgresql_lo_compat_privileges else 'off' }} +operator_precedence_warning = {{ 'on' if postgresql_operator_precedence_warning else 'off' }} +quote_all_identifiers = {{ 'on' if postgresql_quote_all_identifiers else 'off' }} +standard_conforming_strings = {{ 'on' if postgresql_standard_conforming_strings else 'off' }} +synchronize_seqscans = {{ 'on' if postgresql_synchronize_seqscans else 'off' }} + +# - Other Platforms and Clients - + +transform_null_equals = {{ 'on' if postgresql_transform_null_equals else 'off' }} + + +#------------------------------------------------------------------------------ +# ERROR HANDLING +#------------------------------------------------------------------------------ + +exit_on_error = {{ 'on' if postgresql_exit_on_error else 'off' }} # terminate session on any error? +restart_after_crash = {{ 'on' if postgresql_restart_after_crash else 'off' }} # reinitialize after backend crash? +data_sync_retry = {{ 'on' if postgresql_data_sync_retry else 'off' }} # retry or panic on failure to fsync + # data? + # (change requires restart) + + +#------------------------------------------------------------------------------ +# CONFIG FILE INCLUDES +#------------------------------------------------------------------------------ + +# These options allow settings to be loaded from files other than the +# default postgresql.conf. Note that these are directives, not variable +# assignments, so they can usefully be given more than once. + +include_dir = '{{ postgresql_include_dir }}' # include files ending in '.conf' from + # a directory, e.g., 'conf.d' +{{ '#' if not postgresql_include_if_exists | bool else '' }}include_if_exists = '{{ postgresql_include_if_exists }}' # include file only if it exists +{{ '#' if not postgresql_include | bool else '' }}include = '{{ postgresql_include }}' # include file + + +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +# Add settings for extensions here diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.3.orig b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-13.orig similarity index 58% rename from ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.3.orig rename to ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-13.orig index 18196f8..b84379d 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.3.orig +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-13.orig @@ -16,9 +16,9 @@ # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. +# server for the changes to take effect, run "pg_ctl reload", or execute +# "SELECT pg_reload_conf()". Some parameters, which are marked below, +# require a server shutdown and restart to take effect. # # Any parameter can also be given as a command-line option to the server, e.g., # "postgres -c log_connections=on". Some parameters can be changed at run time @@ -27,7 +27,7 @@ # Memory units: kB = kilobytes Time units: ms = milliseconds # MB = megabytes s = seconds # GB = gigabytes min = minutes -# h = hours +# TB = terabytes h = hours # d = days @@ -61,11 +61,9 @@ # defaults to 'localhost'; use '*' for all # (change requires restart) #port = 5432 # (change requires restart) -#max_connections = 100 # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). +max_connections = 100 # (change requires restart) #superuser_reserved_connections = 3 # (change requires restart) -#unix_socket_directories = '/tmp' # comma-separated list of directories +#unix_socket_directories = '/var/run/postgresql, /tmp' # comma-separated list of directories # (change requires restart) #unix_socket_group = '' # (change requires restart) #unix_socket_permissions = 0777 # begin with 0 to use octal notation @@ -75,34 +73,43 @@ #bonjour_name = '' # defaults to the computer name # (change requires restart) -# - Security and Authentication - +# - TCP settings - +# see "man tcp" for details + +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +#tcp_keepalives_count = 0 # TCP_KEEPCNT; + # 0 selects the system default +#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; + # 0 selects the system default + +# - Authentication - #authentication_timeout = 1min # 1s-600s -#ssl = off # (change requires restart) -#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers - # (change requires restart) -#ssl_renegotiation_limit = 512MB # amount of data between renegotiations -#ssl_cert_file = 'server.crt' # (change requires restart) -#ssl_key_file = 'server.key' # (change requires restart) -#ssl_ca_file = '' # (change requires restart) -#ssl_crl_file = '' # (change requires restart) -#password_encryption = on +#password_encryption = md5 # md5 or scram-sha-256 #db_user_namespace = off -# Kerberos and GSSAPI +# GSSAPI using Kerberos #krb_server_keyfile = '' -#krb_srvname = 'postgres' # (Kerberos only) #krb_caseins_users = off -# - TCP Keepalives - -# see "man 7 tcp" for details +# - SSL - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default +#ssl = off +#ssl_ca_file = '' +#ssl_cert_file = 'server.crt' +#ssl_crl_file = '' +#ssl_key_file = 'server.key' +#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers +#ssl_prefer_server_ciphers = on +#ssl_ecdh_curve = 'prime256v1' +#ssl_min_protocol_version = 'TLSv1.2' +#ssl_max_protocol_version = '' +#ssl_dh_params_file = '' +#ssl_passphrase_command = '' +#ssl_passphrase_command_supports_reload = off #------------------------------------------------------------------------------ @@ -111,33 +118,48 @@ # - Memory - -#shared_buffers = 32MB # min 128kB +shared_buffers = 128MB # min 128kB + # (change requires restart) +#huge_pages = try # on, off, or try # (change requires restart) #temp_buffers = 8MB # min 800kB #max_prepared_transactions = 0 # zero disables the feature # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -#work_mem = 1MB # min 64kB -#maintenance_work_mem = 16MB # min 1MB +# Caution: it is not advisable to set max_prepared_transactions nonzero unless +# you actively intend to use prepared transactions. +#work_mem = 4MB # min 64kB +#hash_mem_multiplier = 1.0 # 1-1000.0 multiplier on hash table work_mem +#maintenance_work_mem = 64MB # min 1MB +#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem +#logical_decoding_work_mem = 64MB # min 64kB #max_stack_depth = 2MB # min 100kB +#shared_memory_type = mmap # the default is the first option + # supported by the operating system: + # mmap + # sysv + # windows + # (change requires restart) +dynamic_shared_memory_type = posix # the default is the first option + # supported by the operating system: + # posix + # sysv + # windows + # mmap + # (change requires restart) # - Disk - -#temp_file_limit = -1 # limits per-session temp file space - # in kB, or -1 for no limit +#temp_file_limit = -1 # limits per-process temp file space + # in kilobytes, or -1 for no limit -# - Kernel Resource Usage - +# - Kernel Resources - -#max_files_per_process = 1000 # min 25 +#max_files_per_process = 1000 # min 64 # (change requires restart) -#shared_preload_libraries = '' # (change requires restart) # - Cost-Based Vacuum Delay - -#vacuum_cost_delay = 0 # 0-100 milliseconds +#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) #vacuum_cost_page_hit = 1 # 0-10000 credits #vacuum_cost_page_miss = 10 # 0-10000 credits #vacuum_cost_page_dirty = 20 # 0-10000 credits @@ -146,25 +168,38 @@ # - Background Writer - #bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round +#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round +#bgwriter_flush_after = 512kB # measured in pages, 0 disables # - Asynchronous Behavior - #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching +#maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching +#max_worker_processes = 8 # (change requires restart) +#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers +#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers +#parallel_leader_participation = on +#max_parallel_workers = 8 # maximum number of max_worker_processes that + # can be used in parallel operations +#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate + # (change requires restart) +#backend_flush_after = 0 # measured in pages, 0 disables #------------------------------------------------------------------------------ -# WRITE AHEAD LOG +# WRITE-AHEAD LOG #------------------------------------------------------------------------------ # - Settings - -#wal_level = minimal # minimal, archive, or hot_standby +#wal_level = replica # minimal, replica, or logical # (change requires restart) -#fsync = on # turns forced synchronization on or off +#fsync = on # flush data to disk for crash safety + # (turning this off can cause + # unrecoverable data corruption) #synchronous_commit = on # synchronization level; - # off, local, remote_write, or on + # off, local, remote_write, remote_apply, or on #wal_sync_method = fsync # the default is the first option # supported by the operating system: # open_datasync @@ -173,23 +208,32 @@ # fsync_writethrough # open_sync #full_page_writes = on # recover from partial page writes +#wal_compression = off # enable compression of full-page writes +#wal_log_hints = off # also do full page writes of non-critical updates + # (change requires restart) +#wal_init_zero = on # zero-fill new WAL files +#wal_recycle = on # recycle WAL files #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers # (change requires restart) #wal_writer_delay = 200ms # 1-10000 milliseconds +#wal_writer_flush_after = 1MB # measured in pages, 0 disables +#wal_skip_threshold = 2MB #commit_delay = 0 # range 0-100000, in microseconds #commit_siblings = 5 # range 1-1000 # - Checkpoints - -#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each -#checkpoint_timeout = 5min # range 30s-1h +#checkpoint_timeout = 5min # range 30s-1d +max_wal_size = 1GB +min_wal_size = 80MB #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 +#checkpoint_flush_after = 256kB # measured in pages, 0 disables #checkpoint_warning = 30s # 0 disables # - Archiving - -#archive_mode = off # allows archiving to be done +#archive_mode = off # enables archiving; off, on, or always # (change requires restart) #archive_command = '' # command to use to archive a logfile segment # placeholders: %p = path of file to archive @@ -198,26 +242,69 @@ #archive_timeout = 0 # force a logfile segment switch after this # number of seconds; 0 disables +# - Archive Recovery - + +# These are only used in recovery mode. + +#restore_command = '' # command to use to restore an archived logfile segment + # placeholders: %p = path of file to restore + # %f = file name only + # e.g. 'cp /mnt/server/archivedir/%f %p' + # (change requires restart) +#archive_cleanup_command = '' # command to execute at every restartpoint +#recovery_end_command = '' # command to execute at completion of recovery + +# - Recovery Target - + +# Set these only when performing a targeted recovery. + +#recovery_target = '' # 'immediate' to end recovery as soon as a + # consistent state is reached + # (change requires restart) +#recovery_target_name = '' # the named restore point to which recovery will proceed + # (change requires restart) +#recovery_target_time = '' # the time stamp up to which recovery will proceed + # (change requires restart) +#recovery_target_xid = '' # the transaction ID up to which recovery will proceed + # (change requires restart) +#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed + # (change requires restart) +#recovery_target_inclusive = on # Specifies whether to stop: + # just after the specified recovery target (on) + # just before the recovery target (off) + # (change requires restart) +#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID + # (change requires restart) +#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' + # (change requires restart) + #------------------------------------------------------------------------------ # REPLICATION #------------------------------------------------------------------------------ -# - Sending Server(s) - +# - Sending Servers - # Set these on the master and on any standby that will send replication data. -#max_wal_senders = 0 # max number of walsender processes +#max_wal_senders = 10 # max number of walsender processes # (change requires restart) -#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables +#wal_keep_size = 0 # in megabytes; 0 disables +#max_slot_wal_keep_size = -1 # in megabytes; -1 disables #wal_sender_timeout = 60s # in milliseconds; 0 disables +#max_replication_slots = 10 # max number of replication slots + # (change requires restart) +#track_commit_timestamp = off # collect timestamp of transaction commit + # (change requires restart) + # - Master Server - # These settings are ignored on a standby server. #synchronous_standby_names = '' # standby servers that provide sync rep - # comma-separated list of application_name + # method to choose sync standbys, number of sync standbys, + # and comma-separated list of application_name # from standby(s); '*' = all #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed @@ -225,7 +312,10 @@ # These settings are ignored on a master server. -#hot_standby = off # "on" allows queries during recovery +#primary_conninfo = '' # connection string to sending server +#primary_slot_name = '' # replication slot on sending server +#promote_trigger_file = '' # file name whose presence ends recovery +#hot_standby = on # "off" disallows queries during recovery # (change requires restart) #max_standby_archive_delay = 30s # max delay before canceling queries # when reading WAL from archive; @@ -233,6 +323,8 @@ #max_standby_streaming_delay = 30s # max delay before canceling queries # when reading streaming WAL; # -1 allows indefinite delay +#wal_receiver_create_temp_slot = off # create temp slot if primary_slot_name + # is not set #wal_receiver_status_interval = 10s # send replies at least this often # 0 disables #hot_standby_feedback = off # send info from standby to prevent @@ -240,6 +332,17 @@ #wal_receiver_timeout = 60s # time that receiver waits for # communication from master # in milliseconds; 0 disables +#wal_retrieve_retry_interval = 5s # time to wait before retrying to + # retrieve WAL after a failed attempt +#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery + +# - Subscribers - + +# These settings are ignored on a publisher. + +#max_logical_replication_workers = 4 # taken from max_worker_processes + # (change requires restart) +#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers #------------------------------------------------------------------------------ @@ -256,9 +359,15 @@ #enable_material = on #enable_mergejoin = on #enable_nestloop = on +#enable_parallel_append = on #enable_seqscan = on #enable_sort = on +#enable_incremental_sort = on #enable_tidscan = on +#enable_partitionwise_join = off +#enable_partitionwise_aggregate = off +#enable_parallel_hash = on +#enable_partition_pruning = on # - Planner Cost Constants - @@ -267,7 +376,21 @@ #cpu_tuple_cost = 0.01 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above -#effective_cache_size = 128MB +#parallel_tuple_cost = 0.1 # same scale as above +#parallel_setup_cost = 1000.0 # same scale as above + +#jit_above_cost = 100000 # perform JIT compilation if available + # and query more expensive than this; + # -1 disables +#jit_inline_above_cost = 500000 # inline small functions if query is + # more expensive than this; -1 disables +#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if + # query is more expensive than this; + # -1 disables + +#min_parallel_table_scan_size = 8MB +#min_parallel_index_scan_size = 512kB +#effective_cache_size = 4GB # - Genetic Query Optimizer - @@ -287,33 +410,37 @@ #from_collapse_limit = 8 #join_collapse_limit = 8 # 1 disables collapsing of explicit # JOIN clauses +#force_parallel_mode = off +#jit = on # allow JIT compilation +#plan_cache_mode = auto # auto, force_generic_plan or + # force_custom_plan #------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING +# REPORTING AND LOGGING #------------------------------------------------------------------------------ # - Where to Log - -#log_destination = 'stderr' # Valid values are combinations of +log_destination = 'stderr' # Valid values are combinations of # stderr, csvlog, syslog, and eventlog, # depending on platform. csvlog # requires logging_collector to be on. # This is used when logging to stderr: -#logging_collector = off # Enable capturing of stderr and csvlog +logging_collector = on # Enable capturing of stderr and csvlog # into log files. Required to be on for # csvlogs. # (change requires restart) # These are only used if logging_collector is on: -#log_directory = 'pg_log' # directory where log files are written, +log_directory = 'log' # directory where log files are written, # can be absolute or relative to PGDATA -#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, +log_filename = 'postgresql-%a.log' # log file name pattern, # can include strftime() escapes #log_file_mode = 0600 # creation mode for log files, # begin with 0 to use octal notation -#log_truncate_on_rotation = off # If on, an existing log file with the +log_truncate_on_rotation = on # If on, an existing log file with the # same name as the new log file will be # truncated rather than appended to. # But such truncation only occurs on @@ -321,32 +448,24 @@ # or size-driven rotation. Default is # off, meaning append to existing files # in all cases. -#log_rotation_age = 1d # Automatic rotation of logfiles will +log_rotation_age = 1d # Automatic rotation of logfiles will # happen after that time. 0 disables. -#log_rotation_size = 10MB # Automatic rotation of logfiles will +log_rotation_size = 0 # Automatic rotation of logfiles will # happen after that much log output. # 0 disables. # These are relevant when logging to syslog: #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' +#syslog_sequence_numbers = on +#syslog_split_messages = on # This is only relevant when logging to eventlog (win32): +# (change requires restart) #event_source = 'PostgreSQL' # - When to Log - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 @@ -380,6 +499,20 @@ # statements running at least this number # of milliseconds +#log_min_duration_sample = -1 # -1 is disabled, 0 logs a sample of statements + # and their durations, > 0 logs only a sample of + # statements running at least this number + # of milliseconds; + # sample fraction is determined by log_statement_sample_rate + +#log_statement_sample_rate = 1.0 # fraction of logged statements exceeding + # log_min_duration_sample to be logged; + # 1.0 logs all such statements, 0.0 never logs + + +#log_transaction_sample_rate = 0.0 # fraction of transactions whose statements + # are logged regardless of their duration; 1.0 logs all + # statements from all transactions, 0.0 never logs # - What to Log - @@ -393,15 +526,17 @@ #log_duration = off #log_error_verbosity = default # terse, default, or verbose messages #log_hostname = off -#log_line_prefix = '' # special values: +log_line_prefix = '%m [%p] ' # special values: # %a = application name # %u = user name # %d = database name # %r = remote host and port # %h = remote host + # %b = backend type # %p = process ID # %t = timestamp without milliseconds # %m = timestamp with milliseconds + # %n = timestamp with milliseconds (as a Unix epoch) # %i = command tag # %e = SQL state # %c = session ID @@ -414,29 +549,43 @@ # %% = '%' # e.g. '<%u%%%d> ' #log_lock_waits = off # log lock waits >= deadlock_timeout +#log_parameter_max_length = -1 # when logging statements, limit logged + # bind-parameter values to N bytes; + # -1 means print in full, 0 disables +#log_parameter_max_length_on_error = 0 # when logging an error, limit logged + # bind-parameter values to N bytes; + # -1 means print in full, 0 disables #log_statement = 'none' # none, ddl, mod, all +#log_replication_commands = off #log_temp_files = -1 # log temporary files equal or larger # than the specified size in kilobytes; # -1 disables, 0 logs all temp files -#log_timezone = 'GMT' +log_timezone = 'Europe/London' + +#------------------------------------------------------------------------------ +# PROCESS TITLE +#------------------------------------------------------------------------------ + +#cluster_name = '' # added to process titles if nonempty + # (change requires restart) +#update_process_title = on #------------------------------------------------------------------------------ -# RUNTIME STATISTICS +# STATISTICS #------------------------------------------------------------------------------ -# - Query/Index Statistics Collector - +# - Query and Index Statistics Collector - #track_activities = on #track_counts = on #track_io_timing = off #track_functions = none # none, pl, all #track_activity_query_size = 1024 # (change requires restart) -#update_process_title = on #stats_temp_directory = 'pg_stat_tmp' -# - Statistics Monitoring - +# - Monitoring - #log_parser_stats = off #log_planner_stats = off @@ -445,7 +594,7 @@ #------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS +# AUTOVACUUM #------------------------------------------------------------------------------ #autovacuum = on # Enable autovacuum subprocess? 'on' @@ -459,16 +608,21 @@ #autovacuum_naptime = 1min # time between autovacuum runs #autovacuum_vacuum_threshold = 50 # min number of row updates before # vacuum +#autovacuum_vacuum_insert_threshold = 1000 # min number of row inserts + # before vacuum; -1 disables insert + # vacuums #autovacuum_analyze_threshold = 50 # min number of row updates before # analyze #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum +#autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table + # size before insert vacuum #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum # (change requires restart) -#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age +#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age # before forced vacuum # (change requires restart) -#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for +#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for # autovacuum, in milliseconds; # -1 means use vacuum_cost_delay #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for @@ -482,10 +636,22 @@ # - Statement Behavior - -#search_path = '"$user",public' # schema names +#client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error +#search_path = '"$user", public' # schema names +#row_security = on #default_tablespace = '' # a tablespace name, '' uses the default #temp_tablespaces = '' # a list of tablespace names, '' uses # only default tablespace +#default_table_access_method = 'heap' #check_function_bodies = on #default_transaction_isolation = 'read committed' #default_transaction_read_only = off @@ -493,44 +659,57 @@ #session_replication_role = 'origin' #statement_timeout = 0 # in milliseconds, 0 is disabled #lock_timeout = 0 # in milliseconds, 0 is disabled +#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled #vacuum_freeze_min_age = 50000000 #vacuum_freeze_table_age = 150000000 #vacuum_multixact_freeze_min_age = 5000000 #vacuum_multixact_freeze_table_age = 150000000 +#vacuum_cleanup_index_scale_factor = 0.1 # fraction of total number of tuples + # before index cleanup, 0 always performs + # index cleanup #bytea_output = 'hex' # hex, escape #xmlbinary = 'base64' #xmloption = 'content' +#gin_fuzzy_search_limit = 0 +#gin_pending_list_limit = 4MB # - Locale and Formatting - -#datestyle = 'iso, mdy' +datestyle = 'iso, mdy' #intervalstyle = 'postgres' -#timezone = 'GMT' +timezone = 'Europe/London' #timezone_abbreviations = 'Default' # Select the set of available time zone # abbreviations. Currently, there are # Default - # Australia + # Australia (historical usage) # India # You can create your own file in # share/timezonesets/. -#extra_float_digits = 0 # min -15, max 3 +#extra_float_digits = 1 # min -15, max 3; any value >0 actually + # selects precise output mode #client_encoding = sql_ascii # actually, defaults to database # encoding # These settings are initialized by initdb, but they can be changed. -#lc_messages = 'C' # locale for system error message +lc_messages = 'en_US.UTF-8' # locale for system error message # strings -#lc_monetary = 'C' # locale for monetary formatting -#lc_numeric = 'C' # locale for number formatting -#lc_time = 'C' # locale for time formatting +lc_monetary = 'en_US.UTF-8' # locale for monetary formatting +lc_numeric = 'en_US.UTF-8' # locale for number formatting +lc_time = 'en_US.UTF-8' # locale for time formatting # default configuration for text search -#default_text_search_config = 'pg_catalog.simple' +default_text_search_config = 'pg_catalog.english' + +# - Shared Library Preloading - + +#shared_preload_libraries = '' # (change requires restart) +#local_preload_libraries = '' +#session_preload_libraries = '' +#jit_provider = 'llvmjit' # JIT library to use # - Other Defaults - #dynamic_library_path = '$libdir' -#local_preload_libraries = '' #------------------------------------------------------------------------------ @@ -540,26 +719,26 @@ #deadlock_timeout = 1s #max_locks_per_transaction = 64 # min 10 # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. #max_pred_locks_per_transaction = 64 # min 10 # (change requires restart) +#max_pred_locks_per_relation = -2 # negative values mean + # (max_pred_locks_per_transaction + # / -max_pred_locks_per_relation) - 1 +#max_pred_locks_per_page = 2 # min 0 #------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY +# VERSION AND PLATFORM COMPATIBILITY #------------------------------------------------------------------------------ # - Previous PostgreSQL Versions - #array_nulls = on #backslash_quote = safe_encoding # on, off, or safe_encoding -#default_with_oids = off #escape_string_warning = on #lo_compat_privileges = off +#operator_precedence_warning = off #quote_all_identifiers = off -#sql_inheritance = on #standard_conforming_strings = on #synchronize_seqscans = on @@ -574,6 +753,9 @@ #exit_on_error = off # terminate session on any error? #restart_after_crash = on # reinitialize after backend crash? +#data_sync_retry = off # retry or panic on failure to fsync + # data? + # (change requires restart) #------------------------------------------------------------------------------ @@ -581,12 +763,13 @@ #------------------------------------------------------------------------------ # These options allow settings to be loaded from files other than the -# default postgresql.conf. +# default postgresql.conf. Note that these are directives, not variable +# assignments, so they can usefully be given more than once. -#include_dir = 'conf.d' # include files ending in '.conf' from - # directory 'conf.d' -#include_if_exists = 'exists.conf' # include file only if it exists -#include = 'special.conf' # include file +#include_dir = '...' # include files ending in '.conf' from + # a directory, e.g., 'conf.d' +#include_if_exists = '...' # include file only if it exists +#include = '...' # include file #------------------------------------------------------------------------------ diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.1.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.1.j2 deleted file mode 100644 index d5a6708..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.1.j2 +++ /dev/null @@ -1,562 +0,0 @@ -# {{ ansible_managed }} -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -data_directory = '{{postgresql_data_directory}}' # use data in another directory - # (change requires restart) -hba_file = '{{postgresql_hba_file}}' # host-based authentication file - # (change requires restart) -ident_file = '{{postgresql_ident_file}}' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -external_pid_file = '{{postgresql_external_pid_file or "(none)"}}' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -listen_addresses = '{{postgresql_listen_addresses|join(',')}}' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; '*' for all - # (change requires restart) -port = {{postgresql_port}} # (change requires restart) -max_connections = {{postgresql_max_connections}} # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -superuser_reserved_connections = {{postgresql_superuser_reserved_connections}} # (change requires restart) -unix_socket_directory = '{{postgresql_unix_socket_directory or (postgresql_unix_socket_directories and postgresql_unix_socket_directories[0]) or ''}}' # (change requires restart) -unix_socket_group = '{{postgresql_unix_socket_group}}' # (change requires restart) -unix_socket_permissions = {{postgresql_unix_socket_permissions}} # begin with 0 to use octal notation - # (change requires restart) -bonjour = {{'on' if postgresql_bonjour else 'off'}} # advertise server via Bonjour - # (change requires restart) -bonjour_name = '{{postgresql_bonjour_name}}' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -authentication_timeout = {{postgresql_authentication_timeout}} # 1s-600s -ssl = {{'on' if postgresql_ssl else 'off'}} # (change requires restart) -ssl_ciphers = '{{postgresql_ssl_ciphers|join(':')}}' # allowed SSL ciphers - # (change requires restart) -ssl_renegotiation_limit = {{postgresql_ssl_renegotiation_limit}} # amount of data between renegotiations -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} -db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} - -# Kerberos and GSSAPI -krb_server_keyfile = '{{postgresql_krb_server_keyfile}}' -krb_srvname = '{{postgresql_krb_srvname}}' # (Kerberos only) -krb_caseins_users = {{'on' if postgresql_db_user_namespace else 'off'}} - -# - TCP Keepalives - -# see "man 7 tcp" for details - -tcp_keepalives_idle = {{postgresql_tcp_keepalives_idle}} # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -tcp_keepalives_interval = {{postgresql_tcp_keepalives_interval}} # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -tcp_keepalives_count = {{postgresql_tcp_keepalives_count}} # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -shared_buffers = {{postgresql_shared_buffers}} # min 128kB - # (change requires restart) -temp_buffers = {{postgresql_temp_buffers}} # min 800kB -max_prepared_transactions = {{postgresql_max_prepared_transactions}} # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -work_mem = {{postgresql_work_mem}} # min 64kB -maintenance_work_mem = {{postgresql_maintenance_work_mem}} # min 1MB -max_stack_depth = {{postgresql_max_stack_depth}} # min 100kB - -# - Kernel Resource Usage - - -max_files_per_process = {{postgresql_max_files_per_process}} # min 25 - # (change requires restart) -shared_preload_libraries = '{{postgresql_shared_preload_libraries|join(',')}}' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -vacuum_cost_delay = {{postgresql_vacuum_cost_delay}} # 0-100 milliseconds -vacuum_cost_page_hit = {{postgresql_vacuum_cost_page_hit}} # 0-10000 credits -vacuum_cost_page_miss = {{postgresql_vacuum_cost_page_miss}} # 0-10000 credits -vacuum_cost_page_dirty = {{postgresql_vacuum_cost_page_dirty}} # 0-10000 credits -vacuum_cost_limit = {{postgresql_vacuum_cost_limit}} # 1-10000 credits - -# - Background Writer - - -bgwriter_delay = {{postgresql_bgwriter_delay}} # 10-10000ms between rounds -bgwriter_lru_maxpages = {{postgresql_bgwriter_lru_maxpages}} # 0-1000 max buffers written/round -bgwriter_lru_multiplier = {{postgresql_bgwriter_lru_multiplier}} # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -effective_io_concurrency = {{postgresql_effective_io_concurrency}} # 1-1000; 0 disables prefetching - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -wal_level = {{postgresql_wal_level}} # minimal, archive, or hot_standby - # (change requires restart) -fsync = {{'on' if postgresql_fsync else 'off'}} # turns forced synchronization on or off -synchronous_commit = {{postgresql_synchronous_commit}} # synchronization level; on, off, or local -wal_sync_method = {{postgresql_wal_sync_method}} # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -full_page_writes = {{'on' if postgresql_full_page_writes else 'off'}} # recover from partial page writes -wal_buffers = {{postgresql_wal_buffers}} # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -wal_writer_delay = {{postgresql_wal_writer_delay}} # 1-10000 milliseconds - -commit_delay = {{postgresql_commit_delay}} # range 0-100000, in microseconds -commit_siblings = {{postgresql_commit_siblings}} # range 1-1000 - -# - Checkpoints - - -checkpoint_segments = {{postgresql_checkpoint_segments}} # in logfile segments, min 1, 16MB each -checkpoint_timeout = {{postgresql_checkpoint_timeout}} # range 30s-1h -checkpoint_completion_target = {{postgresql_checkpoint_completion_target}} # checkpoint target duration, 0.0 - 1.0 -checkpoint_warning = {{postgresql_checkpoint_warning}} # 0 disables - -# - Archiving - - -archive_mode = {{ 'on' if ( postgresql_archive_mode|bool == true or postgresql_archive_mode == 'on' ) else 'off' }} # allows archiving to be done - # (change requires restart) -archive_command = '{{postgresql_archive_command}}' # command to use to archive a logfile segment -archive_timeout = {{postgresql_archive_timeout}} # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Master Server - - -# These settings are ignored on a standby server - -max_wal_senders = {{postgresql_max_wal_senders}} # max number of walsender processes - # (change requires restart) -wal_sender_delay = {{postgresql_wal_sender_delay}} # walsender cycle time, 1-10000 milliseconds -wal_keep_segments = {{postgresql_wal_keep_segments}} # in logfile segments, 16MB each; 0 disables -vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed -replication_timeout = {{postgresql_replication_timeout or postgresql_wal_sender_timeout}} # in milliseconds; 0 disables -synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all - -# - Standby Servers - - -# These settings are ignored on a master server - -hot_standby = {{'on' if postgresql_hot_standby else 'off'}} # "on" allows queries during recovery - # (change requires restart) -max_standby_archive_delay = {{postgresql_max_standby_archive_delay}} # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -max_standby_streaming_delay = {{postgresql_max_standby_streaming_delay}} # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -wal_receiver_status_interval = {{postgresql_wal_receiver_status_interval}} # send replies at least this often - # 0 disables -hot_standby_feedback = {{'on' if postgresql_hot_standby_feedback else 'off'}} # send info from standby to prevent - # query conflicts - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -enable_bitmapscan = {{'on' if postgresql_enable_bitmapscan else 'off'}} -enable_hashagg = {{'on' if postgresql_enable_hashagg else 'off'}} -enable_hashjoin = {{'on' if postgresql_enable_hashjoin else 'off'}} -enable_indexscan = {{'on' if postgresql_enable_indexscan else 'off'}} -enable_material = {{'on' if postgresql_enable_material else 'off'}} -enable_mergejoin = {{'on' if postgresql_enable_mergejoin else 'off'}} -enable_nestloop = {{'on' if postgresql_enable_nestloop else 'off'}} -enable_seqscan = {{'on' if postgresql_enable_seqscan else 'off'}} -enable_sort = {{'on' if postgresql_enable_sort else 'off'}} -enable_tidscan = {{'on' if postgresql_enable_tidscan else 'off'}} - -# - Planner Cost Constants - - -seq_page_cost = {{postgresql_seq_page_cost}} # measured on an arbitrary scale -random_page_cost = {{postgresql_random_page_cost}} # same scale as above -cpu_tuple_cost = {{postgresql_cpu_tuple_cost}} # same scale as above -cpu_index_tuple_cost = {{postgresql_cpu_index_tuple_cost}} # same scale as above -cpu_operator_cost = {{postgresql_cpu_operator_cost}} # same scale as above -effective_cache_size = {{postgresql_effective_cache_size}} - -# - Genetic Query Optimizer - - -geqo = {{'on' if postgresql_geqo else 'off'}} -geqo_threshold = {{postgresql_geqo_threshold}} -geqo_effort = {{postgresql_geqo_effort}} # range 1-10 -geqo_pool_size = {{postgresql_geqo_pool_size}} # selects default based on effort -geqo_generations = {{postgresql_geqo_generations}} # selects default based on effort -geqo_selection_bias = {{postgresql_geqo_selection_bias}} # range 1.5-2.0 -geqo_seed = {{postgresql_geqo_seed}} # range 0.0-1.0 - -# - Other Planner Options - - -default_statistics_target = {{postgresql_default_statistics_target}} # range 1-10000 -constraint_exclusion = {{postgresql_constraint_exclusion}} # on, off, or partition -cursor_tuple_fraction = {{postgresql_cursor_tuple_fraction}} # range 0.0-1.0 -from_collapse_limit = {{postgresql_from_collapse_limit}} -join_collapse_limit = {{postgresql_join_collapse_limit}} # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -log_destination = '{{postgresql_log_destination}}' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -logging_collector = {{'on' if postgresql_logging_collector else 'off'}} # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -log_directory = '{{postgresql_log_directory}}' # directory where log files are written, - # can be absolute or relative to PGDATA -log_filename = '{{postgresql_log_filename}}' # log file name pattern, - # can include strftime() escapes -log_file_mode = {{postgresql_log_file_mode}} # creation mode for log files, - # begin with 0 to use octal notation -log_truncate_on_rotation = {{'on' if postgresql_log_truncate_on_rotation else 'off'}} # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -log_rotation_age = {{postgresql_log_rotation_age}} # Automatic rotation of logfiles will - # happen after that time. 0 disables. -log_rotation_size = {{postgresql_log_rotation_size}} # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -syslog_facility = '{{postgresql_syslog_facility}}' -syslog_ident = '{{postgresql_syslog_ident}}' - -#silent_mode = off # Run server silently. - # DO NOT USE without syslog or - # logging_collector - # (change requires restart) - - -# - When to Log - - -client_min_messages = {{postgresql_client_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -log_min_messages = {{postgresql_log_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - # -log_min_error_statement = {{postgresql_log_min_error_statement}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -log_min_duration_statement = {{postgresql_log_min_duration_statement}} # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -debug_print_parse = {{'on' if postgresql_debug_print_parse else 'off'}} -debug_print_rewritten = {{'on' if postgresql_debug_print_rewritten else 'off'}} -debug_print_plan = {{'on' if postgresql_debug_print_plan else 'off'}} -debug_pretty_print = {{'on' if postgresql_debug_pretty_print else 'off'}} -log_checkpoints = {{'on' if postgresql_log_checkpoints else 'off'}} -log_connections = {{'on' if postgresql_log_connections else 'off'}} -log_disconnections = {{'on' if postgresql_log_disconnections else 'off'}} -log_duration = {{'on' if postgresql_log_duration else 'off'}} -log_error_verbosity = {{postgresql_log_error_verbosity}} # terse, default, or verbose messages -log_hostname = {{'on' if postgresql_log_hostname else 'off'}} -log_line_prefix = '{{postgresql_log_line_prefix}}' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -log_lock_waits = {{'on' if postgresql_log_lock_waits else 'off'}} # log lock waits >= deadlock_timeout -log_statement = '{{postgresql_log_statement}}' # none, ddl, mod, all -log_temp_files = {{postgresql_log_temp_files}} # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -log_timezone = '{{postgresql_log_timezone}}' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -track_activities = {{'on' if postgresql_track_activities else 'off'}} -track_counts = {{'on' if postgresql_track_counts else 'off'}} -track_functions = {{postgresql_track_functions}} # none, pl, all -track_activity_query_size = {{postgresql_track_activity_query_size}} # (change requires restart) -update_process_title = {{'on' if postgresql_update_process_title else 'off'}} -stats_temp_directory = '{{postgresql_stats_temp_directory}}' - - -# - Statistics Monitoring - - -log_parser_stats = {{'on' if postgresql_log_parser_stats else 'off'}} -log_planner_stats = {{'on' if postgresql_log_planner_stats else 'off'}} -log_executor_stats = {{'on' if postgresql_log_executor_stats else 'off'}} -log_statement_stats = {{'on' if postgresql_log_statement_stats else 'off'}} - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -autovacuum = {{'on' if postgresql_autovacuum else 'off'}} # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -log_autovacuum_min_duration = {{postgresql_log_autovacuum_min_duration}} # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -autovacuum_max_workers = {{postgresql_autovacuum_max_workers}} # max number of autovacuum subprocesses - # (change requires restart) -autovacuum_naptime = {{postgresql_autovacuum_naptime}} # time between autovacuum runs -autovacuum_vacuum_threshold = {{postgresql_autovacuum_vacuum_threshold}} # min number of row updates before - # vacuum -autovacuum_analyze_threshold = {{postgresql_autovacuum_analyze_threshold}} # min number of row updates before - # analyze -autovacuum_vacuum_scale_factor = {{postgresql_autovacuum_vacuum_scale_factor}} # fraction of table size before vacuum -autovacuum_analyze_scale_factor = {{postgresql_autovacuum_analyze_scale_factor}} # fraction of table size before analyze -autovacuum_freeze_max_age = {{postgresql_autovacuum_freeze_max_age}} # maximum XID age before forced vacuum - # (change requires restart) -autovacuum_vacuum_cost_delay = {{postgresql_autovacuum_vacuum_cost_delay}} # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -autovacuum_vacuum_cost_limit = {{postgresql_autovacuum_vacuum_cost_limit}} # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -search_path = '{{postgresql_search_path|join(',')}}' # schema names -default_tablespace = '{{postgresql_default_tablespace}}' # a tablespace name, '' uses the default -temp_tablespaces = '{{postgresql_temp_tablespaces|join(',')}}' # a list of tablespace names, '' uses - # only default tablespace -check_function_bodies = {{'on' if postgresql_check_function_bodies else 'off'}} -default_transaction_isolation = '{{postgresql_default_transaction_isolation}}' -default_transaction_read_only = {{'on' if postgresql_default_transaction_read_only else 'off'}} -default_transaction_deferrable = {{'on' if postgresql_default_transaction_deferrable else 'off'}} -session_replication_role = '{{postgresql_session_replication_role}}' -statement_timeout = {{postgresql_statement_timeout}} # in milliseconds, 0 is disabled -vacuum_freeze_min_age = {{postgresql_vacuum_freeze_min_age}} -vacuum_freeze_table_age = {{postgresql_vacuum_freeze_table_age}} -bytea_output = '{{postgresql_bytea_output}}' # hex, escape -xmlbinary = '{{postgresql_xmlbinary}}' -xmloption = '{{postgresql_xmloption}}' -gin_fuzzy_search_limit = '{{postgresql_gin_fuzzy_search_limit}}' - -# - Locale and Formatting - - -datestyle = '{{postgresql_datestyle|join(',')}}' -intervalstyle = '{{postgresql_intervalstyle}}' -timezone = '{{postgresql_timezone}}' -timezone_abbreviations = '{{postgresql_timezone_abbreviations}}' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -extra_float_digits = {{postgresql_extra_float_digits}} # min -15, max 3 -{% if not postgresql_client_encoding %} -#client_encoding = sql_ascii # actually, defaults to database -{% else %} -client_encoding = {{postgresql_client_encoding}} # actually, defaults to database -{% endif %} - # encoding - -# These settings are initialized by initdb, but they can be changed. -lc_messages = '{{postgresql_lc_messages}}' # locale for system error message - # strings -lc_monetary = '{{postgresql_lc_monetary}}' # locale for monetary formatting -lc_numeric = '{{postgresql_lc_numeric}}' # locale for number formatting -lc_time = '{{postgresql_lc_time}}' # locale for time formatting - -# default configuration for text search -default_text_search_config = '{{postgresql_default_text_search_config}}' - -# - Other Defaults - - -dynamic_library_path = '{{postgresql_dynamic_library_path}}' -local_preload_libraries = '{{postgresql_local_preload_libraries|join(',')}}' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -deadlock_timeout = {{postgresql_deadlock_timeout}} -max_locks_per_transaction = {{postgresql_max_locks_per_transaction}} # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -max_pred_locks_per_transaction = {{postgresql_max_pred_locks_per_transaction}} # min 10 - # (change requires restart) - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -array_nulls = {{'on' if postgresql_array_nulls else 'off'}} -backslash_quote = {{postgresql_backslash_quote}} # on, off, or safe_encoding -default_with_oids = {{'on' if postgresql_default_with_oids else 'off'}} -escape_string_warning = {{'on' if postgresql_escape_string_warning else 'off'}} -lo_compat_privileges = {{'on' if postgresql_lo_compat_privileges else 'off'}} -quote_all_identifiers = {{'on' if postgresql_quote_all_identifiers else 'off'}} -sql_inheritance = {{'on' if postgresql_sql_inheritance else 'off'}} -standard_conforming_strings = {{'on' if postgresql_standard_conforming_strings else 'off'}} -synchronize_seqscans = {{'on' if postgresql_synchronize_seqscans else 'off'}} - -# - Other Platforms and Clients - - -transform_null_equals = {{'on' if postgresql_transform_null_equals else 'off'}} - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -exit_on_error = {{'on' if postgresql_exit_on_error else 'off'}} # terminate session on any error? -restart_after_crash = {{'on' if postgresql_restart_after_crash else 'off'}} # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -#custom_variable_classes = '' # list of custom variable class names diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.1.orig b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.1.orig deleted file mode 100644 index b2560c3..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.1.orig +++ /dev/null @@ -1,557 +0,0 @@ -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -#data_directory = 'ConfigDir' # use data in another directory - # (change requires restart) -#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file - # (change requires restart) -#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -#external_pid_file = '(none)' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -#listen_addresses = 'localhost' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost', '*' = all - # (change requires restart) -#port = 5432 # (change requires restart) -#max_connections = 100 # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -#superuser_reserved_connections = 3 # (change requires restart) -#unix_socket_directory = '' # (change requires restart) -#unix_socket_group = '' # (change requires restart) -#unix_socket_permissions = 0777 # begin with 0 to use octal notation - # (change requires restart) -#bonjour = off # advertise server via Bonjour - # (change requires restart) -#bonjour_name = '' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -#authentication_timeout = 1min # 1s-600s -#ssl = off # (change requires restart) -#ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers - # (change requires restart) -#ssl_renegotiation_limit = 0 # amount of data between renegotiations -#password_encryption = on -#db_user_namespace = off - -# Kerberos and GSSAPI -#krb_server_keyfile = '' -#krb_srvname = 'postgres' # (Kerberos only) -#krb_caseins_users = off - -# - TCP Keepalives - -# see "man 7 tcp" for details - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -#shared_buffers = 32MB # min 128kB - # (change requires restart) -#temp_buffers = 8MB # min 800kB -#max_prepared_transactions = 0 # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -#work_mem = 1MB # min 64kB -#maintenance_work_mem = 16MB # min 1MB -#max_stack_depth = 2MB # min 100kB - -# - Kernel Resource Usage - - -#max_files_per_process = 1000 # min 25 - # (change requires restart) -#shared_preload_libraries = '' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -#vacuum_cost_delay = 0ms # 0-100 milliseconds -#vacuum_cost_page_hit = 1 # 0-10000 credits -#vacuum_cost_page_miss = 10 # 0-10000 credits -#vacuum_cost_page_dirty = 20 # 0-10000 credits -#vacuum_cost_limit = 200 # 1-10000 credits - -# - Background Writer - - -#bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -#effective_io_concurrency = 1 # 1-1000. 0 disables prefetching - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -#wal_level = minimal # minimal, archive, or hot_standby - # (change requires restart) -#fsync = on # turns forced synchronization on or off -#synchronous_commit = on # synchronization level; on, off, or local -#wal_sync_method = fsync # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -#full_page_writes = on # recover from partial page writes -#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -#wal_writer_delay = 200ms # 1-10000 milliseconds - -#commit_delay = 0 # range 0-100000, in microseconds -#commit_siblings = 5 # range 1-1000 - -# - Checkpoints - - -#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each -#checkpoint_timeout = 5min # range 30s-1h -#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -#checkpoint_warning = 30s # 0 disables - -# - Archiving - - -#archive_mode = off # allows archiving to be done - # (change requires restart) -#archive_command = '' # command to use to archive a logfile segment -#archive_timeout = 0 # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Master Server - - -# These settings are ignored on a standby server - -#max_wal_senders = 0 # max number of walsender processes - # (change requires restart) -#wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds -#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables -#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed -#replication_timeout = 60s # in milliseconds; 0 disables -#synchronous_standby_names = '' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all - -# - Standby Servers - - -# These settings are ignored on a master server - -#hot_standby = off # "on" allows queries during recovery - # (change requires restart) -#max_standby_archive_delay = 30s # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -#max_standby_streaming_delay = 30s # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -#wal_receiver_status_interval = 10s # send replies at least this often - # 0 disables -#hot_standby_feedback = off # send info from standby to prevent - # query conflicts - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -#enable_bitmapscan = on -#enable_hashagg = on -#enable_hashjoin = on -#enable_indexscan = on -#enable_material = on -#enable_mergejoin = on -#enable_nestloop = on -#enable_seqscan = on -#enable_sort = on -#enable_tidscan = on - -# - Planner Cost Constants - - -#seq_page_cost = 1.0 # measured on an arbitrary scale -#random_page_cost = 4.0 # same scale as above -#cpu_tuple_cost = 0.01 # same scale as above -#cpu_index_tuple_cost = 0.005 # same scale as above -#cpu_operator_cost = 0.0025 # same scale as above -#effective_cache_size = 128MB - -# - Genetic Query Optimizer - - -#geqo = on -#geqo_threshold = 12 -#geqo_effort = 5 # range 1-10 -#geqo_pool_size = 0 # selects default based on effort -#geqo_generations = 0 # selects default based on effort -#geqo_selection_bias = 2.0 # range 1.5-2.0 -#geqo_seed = 0.0 # range 0.0-1.0 - -# - Other Planner Options - - -#default_statistics_target = 100 # range 1-10000 -#constraint_exclusion = partition # on, off, or partition -#cursor_tuple_fraction = 0.1 # range 0.0-1.0 -#from_collapse_limit = 8 -#join_collapse_limit = 8 # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -#log_destination = 'stderr' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -#logging_collector = off # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -#log_directory = 'pg_log' # directory where log files are written, - # can be absolute or relative to PGDATA -#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, - # can include strftime() escapes -#log_file_mode = 0600 # creation mode for log files, - # begin with 0 to use octal notation -#log_truncate_on_rotation = off # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -#log_rotation_age = 1d # Automatic rotation of logfiles will - # happen after that time. 0 disables. -#log_rotation_size = 10MB # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -#syslog_facility = 'LOCAL0' -#syslog_ident = 'postgres' - -#silent_mode = off # Run server silently. - # DO NOT USE without syslog or - # logging_collector - # (change requires restart) - - -# - When to Log - - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -#log_min_messages = warning # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - -#log_min_error_statement = error # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -#debug_print_parse = off -#debug_print_rewritten = off -#debug_print_plan = off -#debug_pretty_print = on -#log_checkpoints = off -#log_connections = off -#log_disconnections = off -#log_duration = off -#log_error_verbosity = default # terse, default, or verbose messages -#log_hostname = off -#log_line_prefix = '' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -#log_lock_waits = off # log lock waits >= deadlock_timeout -#log_statement = 'none' # none, ddl, mod, all -#log_temp_files = -1 # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -#log_timezone = '(defaults to server environment setting)' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -#track_activities = on -#track_counts = on -#track_functions = none # none, pl, all -#track_activity_query_size = 1024 # (change requires restart) -#update_process_title = on -#stats_temp_directory = 'pg_stat_tmp' - - -# - Statistics Monitoring - - -#log_parser_stats = off -#log_planner_stats = off -#log_executor_stats = off -#log_statement_stats = off - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -#autovacuum = on # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -#autovacuum_max_workers = 3 # max number of autovacuum subprocesses - # (change requires restart) -#autovacuum_naptime = 1min # time between autovacuum runs -#autovacuum_vacuum_threshold = 50 # min number of row updates before - # vacuum -#autovacuum_analyze_threshold = 50 # min number of row updates before - # analyze -#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum -#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze -#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum - # (change requires restart) -#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -#search_path = '"$user",public' # schema names -#default_tablespace = '' # a tablespace name, '' uses the default -#temp_tablespaces = '' # a list of tablespace names, '' uses - # only default tablespace -#check_function_bodies = on -#default_transaction_isolation = 'read committed' -#default_transaction_read_only = off -#default_transaction_deferrable = off -#session_replication_role = 'origin' -#statement_timeout = 0 # in milliseconds, 0 is disabled -#vacuum_freeze_min_age = 50000000 -#vacuum_freeze_table_age = 150000000 -#bytea_output = 'hex' # hex, escape -#xmlbinary = 'base64' -#xmloption = 'content' -#gin_fuzzy_search_limit = 0 - -# - Locale and Formatting - - -#datestyle = 'iso, mdy' -#intervalstyle = 'postgres' -#timezone = '(defaults to server environment setting)' -#timezone_abbreviations = 'Default' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -#extra_float_digits = 0 # min -15, max 3 -#client_encoding = sql_ascii # actually, defaults to database - # encoding - -# These settings are initialized by initdb, but they can be changed. -#lc_messages = 'C' # locale for system error message - # strings -#lc_monetary = 'C' # locale for monetary formatting -#lc_numeric = 'C' # locale for number formatting -#lc_time = 'C' # locale for time formatting - -# default configuration for text search -#default_text_search_config = 'pg_catalog.simple' - -# - Other Defaults - - -#dynamic_library_path = '$libdir' -#local_preload_libraries = '' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -#deadlock_timeout = 1s -#max_locks_per_transaction = 64 # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -#max_pred_locks_per_transaction = 64 # min 10 - # (change requires restart) - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -#array_nulls = on -#backslash_quote = safe_encoding # on, off, or safe_encoding -#default_with_oids = off -#escape_string_warning = on -#lo_compat_privileges = off -#quote_all_identifiers = off -#sql_inheritance = on -#standard_conforming_strings = on -#synchronize_seqscans = on - -# - Other Platforms and Clients - - -#transform_null_equals = off - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -#exit_on_error = off # terminate session on any error? -#restart_after_crash = on # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -#custom_variable_classes = '' # list of custom variable class names diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.2.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.2.j2 deleted file mode 100644 index 53ff3a4..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.2.j2 +++ /dev/null @@ -1,579 +0,0 @@ -# {{ ansible_managed }} -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -data_directory = '{{postgresql_data_directory}}' # use data in another directory - # (change requires restart) -hba_file = '{{postgresql_hba_file}}' # host-based authentication file - # (change requires restart) -ident_file = '{{postgresql_ident_file}}' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -external_pid_file = '{{postgresql_external_pid_file}}' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -listen_addresses = '{{postgresql_listen_addresses|join(',')}}' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -port = {{postgresql_port}} # (change requires restart) -max_connections = {{postgresql_max_connections}} # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -superuser_reserved_connections = {{postgresql_superuser_reserved_connections}} # (change requires restart) -unix_socket_directory = '{{postgresql_unix_socket_directory or (postgresql_unix_socket_directories and postgresql_unix_socket_directories[0]) or ''}}' # (change requires restart) -unix_socket_group = '{{postgresql_unix_socket_group}}' # (change requires restart) -unix_socket_permissions = {{postgresql_unix_socket_permissions}} # begin with 0 to use octal notation - # (change requires restart) -bonjour = {{'on' if postgresql_bonjour else 'off'}} # advertise server via Bonjour - # (change requires restart) -bonjour_name = '{{postgresql_bonjour_name}}' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -authentication_timeout = {{postgresql_authentication_timeout}} # 1s-600s -ssl = {{'on' if postgresql_ssl else 'off'}} # (change requires restart) -ssl_ciphers = '{{postgresql_ssl_ciphers|join(':')}}' # allowed SSL ciphers - # (change requires restart) -ssl_renegotiation_limit = {{postgresql_ssl_renegotiation_limit}} # amount of data between renegotiations -ssl_cert_file = '{{postgresql_ssl_cert_file}}' # (change requires restart) -ssl_key_file = '{{postgresql_ssl_key_file}}' # (change requires restart) -ssl_ca_file = '{{postgresql_ssl_ca_file}}' # (change requires restart) -ssl_crl_file = '{{postgresql_ssl_crl_file}}' # (change requires restart) -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} -db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} - -# Kerberos and GSSAPI -krb_server_keyfile = '{{postgresql_krb_server_keyfile}}' -krb_srvname = '{{postgresql_krb_srvname}}' # (Kerberos only) -krb_caseins_users = {{'on' if postgresql_db_user_namespace else 'off'}} - -# - TCP Keepalives - -# see "man 7 tcp" for details - -tcp_keepalives_idle = {{postgresql_tcp_keepalives_idle}} # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -tcp_keepalives_interval = {{postgresql_tcp_keepalives_interval}} # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -tcp_keepalives_count = {{postgresql_tcp_keepalives_count}} # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -shared_buffers = {{postgresql_shared_buffers}} # min 128kB - # (change requires restart) -temp_buffers = {{postgresql_temp_buffers}} # min 800kB -max_prepared_transactions = {{postgresql_max_prepared_transactions}} # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -work_mem = {{postgresql_work_mem}} # min 64kB -maintenance_work_mem = {{postgresql_maintenance_work_mem}} # min 1MB -max_stack_depth = {{postgresql_max_stack_depth}} # min 100kB - -# - Disk - - -temp_file_limit = {{postgresql_temp_file_limit}} # limits per-session temp file space - # in kB, or -1 for no limit - -# - Kernel Resource Usage - - -max_files_per_process = {{postgresql_max_files_per_process}} # min 25 - # (change requires restart) -shared_preload_libraries = '{{postgresql_shared_preload_libraries|join(',')}}' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -vacuum_cost_delay = {{postgresql_vacuum_cost_delay}} # 0-100 milliseconds -vacuum_cost_page_hit = {{postgresql_vacuum_cost_page_hit}} # 0-10000 credits -vacuum_cost_page_miss = {{postgresql_vacuum_cost_page_miss}} # 0-10000 credits -vacuum_cost_page_dirty = {{postgresql_vacuum_cost_page_dirty}} # 0-10000 credits -vacuum_cost_limit = {{postgresql_vacuum_cost_limit}} # 1-10000 credits - -# - Background Writer - - -bgwriter_delay = {{postgresql_bgwriter_delay}} # 10-10000ms between rounds -bgwriter_lru_maxpages = {{postgresql_bgwriter_lru_maxpages}} # 0-1000 max buffers written/round -bgwriter_lru_multiplier = {{postgresql_bgwriter_lru_multiplier}} # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -effective_io_concurrency = {{postgresql_effective_io_concurrency}} # 1-1000; 0 disables prefetching - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -wal_level = {{postgresql_wal_level}} # minimal, archive, or hot_standby - # (change requires restart) -fsync = {{'on' if postgresql_fsync else 'off'}} # turns forced synchronization on or off -synchronous_commit = {{postgresql_synchronous_commit}} # synchronization level; - # off, local, remote_write, or on -wal_sync_method = {{postgresql_wal_sync_method}} # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -full_page_writes = {{'on' if postgresql_full_page_writes else 'off'}} # recover from partial page writes -wal_buffers = {{postgresql_wal_buffers}} # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -wal_writer_delay = {{postgresql_wal_writer_delay}} # 1-10000 milliseconds - -commit_delay = {{postgresql_commit_delay}} # range 0-100000, in microseconds -commit_siblings = {{postgresql_commit_siblings}} # range 1-1000 - -# - Checkpoints - - -checkpoint_segments = {{postgresql_checkpoint_segments}} # in logfile segments, min 1, 16MB each -checkpoint_timeout = {{postgresql_checkpoint_timeout}} # range 30s-1h -checkpoint_completion_target = {{postgresql_checkpoint_completion_target}} # checkpoint target duration, 0.0 - 1.0 -checkpoint_warning = {{postgresql_checkpoint_warning}} # 0 disables - -# - Archiving - - -archive_mode = {{ 'on' if ( postgresql_archive_mode|bool == true or postgresql_archive_mode == 'on' ) else 'off' }} # allows archiving to be done - # (change requires restart) -archive_command = '{{postgresql_archive_command}}' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -archive_timeout = {{postgresql_archive_timeout}} # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Sending Server(s) - - -# Set these on the master and on any standby that will send replication data. - -max_wal_senders = {{postgresql_max_wal_senders}} # max number of walsender processes - # (change requires restart) -wal_keep_segments = {{postgresql_wal_keep_segments}} # in logfile segments, 16MB each; 0 disables -replication_timeout = {{postgresql_replication_timeout or postgresql_wal_sender_timeout}} # in milliseconds; 0 disables - -# - Master Server - - -# These settings are ignored on a standby server. - -synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all -vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed - -# - Standby Servers - - -# These settings are ignored on a master server. - -hot_standby = {{'on' if postgresql_hot_standby else 'off'}} # "on" allows queries during recovery - # (change requires restart) -max_standby_archive_delay = {{postgresql_max_standby_archive_delay}} # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -max_standby_streaming_delay = {{postgresql_max_standby_streaming_delay}} # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -wal_receiver_status_interval = {{postgresql_wal_receiver_status_interval}} # send replies at least this often - # 0 disables -hot_standby_feedback = {{'on' if postgresql_hot_standby_feedback else 'off'}} # send info from standby to prevent - # query conflicts - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -enable_bitmapscan = {{'on' if postgresql_enable_bitmapscan else 'off'}} -enable_hashagg = {{'on' if postgresql_enable_hashagg else 'off'}} -enable_hashjoin = {{'on' if postgresql_enable_hashjoin else 'off'}} -enable_indexscan = {{'on' if postgresql_enable_indexscan else 'off'}} -enable_indexonlyscan = {{'on' if postgresql_enable_indexonlyscan else 'off'}} -enable_material = {{'on' if postgresql_enable_material else 'off'}} -enable_mergejoin = {{'on' if postgresql_enable_mergejoin else 'off'}} -enable_nestloop = {{'on' if postgresql_enable_nestloop else 'off'}} -enable_seqscan = {{'on' if postgresql_enable_seqscan else 'off'}} -enable_sort = {{'on' if postgresql_enable_sort else 'off'}} -enable_tidscan = {{'on' if postgresql_enable_tidscan else 'off'}} - -# - Planner Cost Constants - - -seq_page_cost = {{postgresql_seq_page_cost}} # measured on an arbitrary scale -random_page_cost = {{postgresql_random_page_cost}} # same scale as above -cpu_tuple_cost = {{postgresql_cpu_tuple_cost}} # same scale as above -cpu_index_tuple_cost = {{postgresql_cpu_index_tuple_cost}} # same scale as above -cpu_operator_cost = {{postgresql_cpu_operator_cost}} # same scale as above -effective_cache_size = {{postgresql_effective_cache_size}} - -# - Genetic Query Optimizer - - -geqo = {{'on' if postgresql_geqo else 'off'}} -geqo_threshold = {{postgresql_geqo_threshold}} -geqo_effort = {{postgresql_geqo_effort}} # range 1-10 -geqo_pool_size = {{postgresql_geqo_pool_size}} # selects default based on effort -geqo_generations = {{postgresql_geqo_generations}} # selects default based on effort -geqo_selection_bias = {{postgresql_geqo_selection_bias}} # range 1.5-2.0 -geqo_seed = {{postgresql_geqo_seed}} # range 0.0-1.0 - -# - Other Planner Options - - -default_statistics_target = {{postgresql_default_statistics_target}} # range 1-10000 -constraint_exclusion = {{postgresql_constraint_exclusion}} # on, off, or partition -cursor_tuple_fraction = {{postgresql_cursor_tuple_fraction}} # range 0.0-1.0 -from_collapse_limit = {{postgresql_from_collapse_limit}} -join_collapse_limit = {{postgresql_join_collapse_limit}} # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -log_destination = '{{postgresql_log_destination}}' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -logging_collector = {{'on' if postgresql_logging_collector else 'off'}} # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -log_directory = '{{postgresql_log_directory}}' # directory where log files are written, - # can be absolute or relative to PGDATA -log_filename = '{{postgresql_log_filename}}' # log file name pattern, - # can include strftime() escapes -log_file_mode = {{postgresql_log_file_mode}} # creation mode for log files, - # begin with 0 to use octal notation -log_truncate_on_rotation = {{'on' if postgresql_log_truncate_on_rotation else 'off'}} # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -log_rotation_age = {{postgresql_log_rotation_age}} # Automatic rotation of logfiles will - # happen after that time. 0 disables. -log_rotation_size = {{postgresql_log_rotation_size}} # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -syslog_facility = '{{postgresql_syslog_facility}}' -syslog_ident = '{{postgresql_syslog_ident}}' - -# This is only relevant when logging to eventlog (win32): -event_source = '{{postgresql_event_source}}' - -# - When to Log - - -client_min_messages = {{postgresql_client_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -log_min_messages = {{postgresql_log_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - # -log_min_error_statement = {{postgresql_log_min_error_statement}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -log_min_duration_statement = {{postgresql_log_min_duration_statement}} # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -debug_print_parse = {{'on' if postgresql_debug_print_parse else 'off'}} -debug_print_rewritten = {{'on' if postgresql_debug_print_rewritten else 'off'}} -debug_print_plan = {{'on' if postgresql_debug_print_plan else 'off'}} -debug_pretty_print = {{'on' if postgresql_debug_pretty_print else 'off'}} -log_checkpoints = {{'on' if postgresql_log_checkpoints else 'off'}} -log_connections = {{'on' if postgresql_log_connections else 'off'}} -log_disconnections = {{'on' if postgresql_log_disconnections else 'off'}} -log_duration = {{'on' if postgresql_log_duration else 'off'}} -log_error_verbosity = {{postgresql_log_error_verbosity}} # terse, default, or verbose messages -log_hostname = {{'on' if postgresql_log_hostname else 'off'}} -log_line_prefix = '{{postgresql_log_line_prefix}}' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -log_lock_waits = {{'on' if postgresql_log_lock_waits else 'off'}} # log lock waits >= deadlock_timeout -log_statement = '{{postgresql_log_statement}}' # none, ddl, mod, all -log_temp_files = {{postgresql_log_temp_files}} # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -log_timezone = '{{postgresql_log_timezone}}' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -track_activities = {{'on' if postgresql_track_activities else 'off'}} -track_counts = {{'on' if postgresql_track_counts else 'off'}} -track_io_timing = {{'on' if postgresql_track_io_timing else 'off'}} -track_functions = {{postgresql_track_functions}} # none, pl, all -track_activity_query_size = {{postgresql_track_activity_query_size}} # (change requires restart) -update_process_title = {{'on' if postgresql_update_process_title else 'off'}} -stats_temp_directory = '{{postgresql_stats_temp_directory}}' - - -# - Statistics Monitoring - - -log_parser_stats = {{'on' if postgresql_log_parser_stats else 'off'}} -log_planner_stats = {{'on' if postgresql_log_planner_stats else 'off'}} -log_executor_stats = {{'on' if postgresql_log_executor_stats else 'off'}} -log_statement_stats = {{'on' if postgresql_log_statement_stats else 'off'}} - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -autovacuum = {{'on' if postgresql_autovacuum else 'off'}} # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -log_autovacuum_min_duration = {{postgresql_log_autovacuum_min_duration}} # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -autovacuum_max_workers = {{postgresql_autovacuum_max_workers}} # max number of autovacuum subprocesses - # (change requires restart) -autovacuum_naptime = {{postgresql_autovacuum_naptime}} # time between autovacuum runs -autovacuum_vacuum_threshold = {{postgresql_autovacuum_vacuum_threshold}} # min number of row updates before - # vacuum -autovacuum_analyze_threshold = {{postgresql_autovacuum_analyze_threshold}} # min number of row updates before - # analyze -autovacuum_vacuum_scale_factor = {{postgresql_autovacuum_vacuum_scale_factor}} # fraction of table size before vacuum -autovacuum_analyze_scale_factor = {{postgresql_autovacuum_analyze_scale_factor}} # fraction of table size before analyze -autovacuum_freeze_max_age = {{postgresql_autovacuum_freeze_max_age}} # maximum XID age before forced vacuum - # (change requires restart) -autovacuum_vacuum_cost_delay = {{postgresql_autovacuum_vacuum_cost_delay}} # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -autovacuum_vacuum_cost_limit = {{postgresql_autovacuum_vacuum_cost_limit}} # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -search_path = '{{postgresql_search_path|join(',')}}' # schema names -default_tablespace = '{{postgresql_default_tablespace}}' # a tablespace name, '' uses the default -temp_tablespaces = '{{postgresql_temp_tablespaces|join(',')}}' # a list of tablespace names, '' uses - # only default tablespace -check_function_bodies = {{'on' if postgresql_check_function_bodies else 'off'}} -default_transaction_isolation = '{{postgresql_default_transaction_isolation}}' -default_transaction_read_only = {{'on' if postgresql_default_transaction_read_only else 'off'}} -default_transaction_deferrable = {{'on' if postgresql_default_transaction_deferrable else 'off'}} -session_replication_role = '{{postgresql_session_replication_role}}' -statement_timeout = {{postgresql_statement_timeout}} # in milliseconds, 0 is disabled -vacuum_freeze_min_age = {{postgresql_vacuum_freeze_min_age}} -vacuum_freeze_table_age = {{postgresql_vacuum_freeze_table_age}} -bytea_output = '{{postgresql_bytea_output}}' # hex, escape -xmlbinary = '{{postgresql_xmlbinary}}' -xmloption = '{{postgresql_xmloption}}' -gin_fuzzy_search_limit = '{{postgresql_gin_fuzzy_search_limit}}' - -# - Locale and Formatting - - -datestyle = '{{postgresql_datestyle|join(',')}}' -intervalstyle = '{{postgresql_intervalstyle}}' -timezone = '{{postgresql_timezone}}' -timezone_abbreviations = '{{postgresql_timezone_abbreviations}}' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -extra_float_digits = {{postgresql_extra_float_digits}} # min -15, max 3 -{% if not postgresql_client_encoding %} -#client_encoding = sql_ascii # actually, defaults to database -{% else %} -client_encoding = {{postgresql_client_encoding}} # actually, defaults to database -{% endif %} - # encoding - -# These settings are initialized by initdb, but they can be changed. -lc_messages = '{{postgresql_lc_messages}}' # locale for system error message - # strings -lc_monetary = '{{postgresql_lc_monetary}}' # locale for monetary formatting -lc_numeric = '{{postgresql_lc_numeric}}' # locale for number formatting -lc_time = '{{postgresql_lc_time}}' # locale for time formatting - -# default configuration for text search -default_text_search_config = '{{postgresql_default_text_search_config}}' - -# - Other Defaults - - -dynamic_library_path = '{{postgresql_dynamic_library_path}}' -local_preload_libraries = '{{postgresql_local_preload_libraries|join(',')}}' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -deadlock_timeout = {{postgresql_deadlock_timeout}} -max_locks_per_transaction = {{postgresql_max_locks_per_transaction}} # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -max_pred_locks_per_transaction = {{postgresql_max_pred_locks_per_transaction}} # min 10 - # (change requires restart) - - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -array_nulls = {{'on' if postgresql_array_nulls else 'off'}} -backslash_quote = {{postgresql_backslash_quote}} # on, off, or safe_encoding -default_with_oids = {{'on' if postgresql_default_with_oids else 'off'}} -escape_string_warning = {{'on' if postgresql_escape_string_warning else 'off'}} -lo_compat_privileges = {{'on' if postgresql_lo_compat_privileges else 'off'}} -quote_all_identifiers = {{'on' if postgresql_quote_all_identifiers else 'off'}} -sql_inheritance = {{'on' if postgresql_sql_inheritance else 'off'}} -standard_conforming_strings = {{'on' if postgresql_standard_conforming_strings else 'off'}} -synchronize_seqscans = {{'on' if postgresql_synchronize_seqscans else 'off'}} - -# - Other Platforms and Clients - - -transform_null_equals = {{'on' if postgresql_transform_null_equals else 'off'}} - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -exit_on_error = {{'on' if postgresql_exit_on_error else 'off'}} # terminate session on any error? -restart_after_crash = {{'on' if postgresql_restart_after_crash else 'off'}} # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -# Add settings for extensions here diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.2.orig b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.2.orig deleted file mode 100644 index efbf58f..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.2.orig +++ /dev/null @@ -1,574 +0,0 @@ -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -#data_directory = 'ConfigDir' # use data in another directory - # (change requires restart) -#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file - # (change requires restart) -#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -#external_pid_file = '' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -#listen_addresses = 'localhost' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -#port = 5432 # (change requires restart) -#max_connections = 100 # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -#superuser_reserved_connections = 3 # (change requires restart) -#unix_socket_directory = '' # (change requires restart) -#unix_socket_group = '' # (change requires restart) -#unix_socket_permissions = 0777 # begin with 0 to use octal notation - # (change requires restart) -#bonjour = off # advertise server via Bonjour - # (change requires restart) -#bonjour_name = '' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -#authentication_timeout = 1min # 1s-600s -#ssl = off # (change requires restart) -#ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers - # (change requires restart) -#ssl_renegotiation_limit = 0 # amount of data between renegotiations -#ssl_cert_file = 'server.crt' # (change requires restart) -#ssl_key_file = 'server.key' # (change requires restart) -#ssl_ca_file = '' # (change requires restart) -#ssl_crl_file = '' # (change requires restart) -#password_encryption = on -#db_user_namespace = off - -# Kerberos and GSSAPI -#krb_server_keyfile = '' -#krb_srvname = 'postgres' # (Kerberos only) -#krb_caseins_users = off - -# - TCP Keepalives - -# see "man 7 tcp" for details - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -#shared_buffers = 32MB # min 128kB - # (change requires restart) -#temp_buffers = 8MB # min 800kB -#max_prepared_transactions = 0 # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -#work_mem = 1MB # min 64kB -#maintenance_work_mem = 16MB # min 1MB -#max_stack_depth = 2MB # min 100kB - -# - Disk - - -#temp_file_limit = -1 # limits per-session temp file space - # in kB, or -1 for no limit - -# - Kernel Resource Usage - - -#max_files_per_process = 1000 # min 25 - # (change requires restart) -#shared_preload_libraries = '' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -#vacuum_cost_delay = 0ms # 0-100 milliseconds -#vacuum_cost_page_hit = 1 # 0-10000 credits -#vacuum_cost_page_miss = 10 # 0-10000 credits -#vacuum_cost_page_dirty = 20 # 0-10000 credits -#vacuum_cost_limit = 200 # 1-10000 credits - -# - Background Writer - - -#bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -#wal_level = minimal # minimal, archive, or hot_standby - # (change requires restart) -#fsync = on # turns forced synchronization on or off -#synchronous_commit = on # synchronization level; - # off, local, remote_write, or on -#wal_sync_method = fsync # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -#full_page_writes = on # recover from partial page writes -#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -#wal_writer_delay = 200ms # 1-10000 milliseconds - -#commit_delay = 0 # range 0-100000, in microseconds -#commit_siblings = 5 # range 1-1000 - -# - Checkpoints - - -#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each -#checkpoint_timeout = 5min # range 30s-1h -#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -#checkpoint_warning = 30s # 0 disables - -# - Archiving - - -#archive_mode = off # allows archiving to be done - # (change requires restart) -#archive_command = '' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -#archive_timeout = 0 # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Sending Server(s) - - -# Set these on the master and on any standby that will send replication data. - -#max_wal_senders = 0 # max number of walsender processes - # (change requires restart) -#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables -#replication_timeout = 60s # in milliseconds; 0 disables - -# - Master Server - - -# These settings are ignored on a standby server. - -#synchronous_standby_names = '' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all -#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed - -# - Standby Servers - - -# These settings are ignored on a master server. - -#hot_standby = off # "on" allows queries during recovery - # (change requires restart) -#max_standby_archive_delay = 30s # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -#max_standby_streaming_delay = 30s # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -#wal_receiver_status_interval = 10s # send replies at least this often - # 0 disables -#hot_standby_feedback = off # send info from standby to prevent - # query conflicts - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -#enable_bitmapscan = on -#enable_hashagg = on -#enable_hashjoin = on -#enable_indexscan = on -#enable_indexonlyscan = on -#enable_material = on -#enable_mergejoin = on -#enable_nestloop = on -#enable_seqscan = on -#enable_sort = on -#enable_tidscan = on - -# - Planner Cost Constants - - -#seq_page_cost = 1.0 # measured on an arbitrary scale -#random_page_cost = 4.0 # same scale as above -#cpu_tuple_cost = 0.01 # same scale as above -#cpu_index_tuple_cost = 0.005 # same scale as above -#cpu_operator_cost = 0.0025 # same scale as above -#effective_cache_size = 128MB - -# - Genetic Query Optimizer - - -#geqo = on -#geqo_threshold = 12 -#geqo_effort = 5 # range 1-10 -#geqo_pool_size = 0 # selects default based on effort -#geqo_generations = 0 # selects default based on effort -#geqo_selection_bias = 2.0 # range 1.5-2.0 -#geqo_seed = 0.0 # range 0.0-1.0 - -# - Other Planner Options - - -#default_statistics_target = 100 # range 1-10000 -#constraint_exclusion = partition # on, off, or partition -#cursor_tuple_fraction = 0.1 # range 0.0-1.0 -#from_collapse_limit = 8 -#join_collapse_limit = 8 # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -#log_destination = 'stderr' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -#logging_collector = off # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -#log_directory = 'pg_log' # directory where log files are written, - # can be absolute or relative to PGDATA -#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, - # can include strftime() escapes -#log_file_mode = 0600 # creation mode for log files, - # begin with 0 to use octal notation -#log_truncate_on_rotation = off # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -#log_rotation_age = 1d # Automatic rotation of logfiles will - # happen after that time. 0 disables. -#log_rotation_size = 10MB # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -#syslog_facility = 'LOCAL0' -#syslog_ident = 'postgres' - -# This is only relevant when logging to eventlog (win32): -#event_source = 'PostgreSQL' - -# - When to Log - - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -#log_min_messages = warning # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - -#log_min_error_statement = error # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -#debug_print_parse = off -#debug_print_rewritten = off -#debug_print_plan = off -#debug_pretty_print = on -#log_checkpoints = off -#log_connections = off -#log_disconnections = off -#log_duration = off -#log_error_verbosity = default # terse, default, or verbose messages -#log_hostname = off -#log_line_prefix = '' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -#log_lock_waits = off # log lock waits >= deadlock_timeout -#log_statement = 'none' # none, ddl, mod, all -#log_temp_files = -1 # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -#log_timezone = 'GMT' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -#track_activities = on -#track_counts = on -#track_io_timing = off -#track_functions = none # none, pl, all -#track_activity_query_size = 1024 # (change requires restart) -#update_process_title = on -#stats_temp_directory = 'pg_stat_tmp' - - -# - Statistics Monitoring - - -#log_parser_stats = off -#log_planner_stats = off -#log_executor_stats = off -#log_statement_stats = off - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -#autovacuum = on # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -#autovacuum_max_workers = 3 # max number of autovacuum subprocesses - # (change requires restart) -#autovacuum_naptime = 1min # time between autovacuum runs -#autovacuum_vacuum_threshold = 50 # min number of row updates before - # vacuum -#autovacuum_analyze_threshold = 50 # min number of row updates before - # analyze -#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum -#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze -#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum - # (change requires restart) -#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -#search_path = '"$user",public' # schema names -#default_tablespace = '' # a tablespace name, '' uses the default -#temp_tablespaces = '' # a list of tablespace names, '' uses - # only default tablespace -#check_function_bodies = on -#default_transaction_isolation = 'read committed' -#default_transaction_read_only = off -#default_transaction_deferrable = off -#session_replication_role = 'origin' -#statement_timeout = 0 # in milliseconds, 0 is disabled -#vacuum_freeze_min_age = 50000000 -#vacuum_freeze_table_age = 150000000 -#bytea_output = 'hex' # hex, escape -#xmlbinary = 'base64' -#xmloption = 'content' -#gin_fuzzy_search_limit = 0 - -# - Locale and Formatting - - -#datestyle = 'iso, mdy' -#intervalstyle = 'postgres' -#timezone = 'GMT' -#timezone_abbreviations = 'Default' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -#extra_float_digits = 0 # min -15, max 3 -#client_encoding = sql_ascii # actually, defaults to database - # encoding - -# These settings are initialized by initdb, but they can be changed. -#lc_messages = 'C' # locale for system error message - # strings -#lc_monetary = 'C' # locale for monetary formatting -#lc_numeric = 'C' # locale for number formatting -#lc_time = 'C' # locale for time formatting - -# default configuration for text search -#default_text_search_config = 'pg_catalog.simple' - -# - Other Defaults - - -#dynamic_library_path = '$libdir' -#local_preload_libraries = '' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -#deadlock_timeout = 1s -#max_locks_per_transaction = 64 # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -#max_pred_locks_per_transaction = 64 # min 10 - # (change requires restart) - - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -#array_nulls = on -#backslash_quote = safe_encoding # on, off, or safe_encoding -#default_with_oids = off -#escape_string_warning = on -#lo_compat_privileges = off -#quote_all_identifiers = off -#sql_inheritance = on -#standard_conforming_strings = on -#synchronize_seqscans = on - -# - Other Platforms and Clients - - -#transform_null_equals = off - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -#exit_on_error = off # terminate session on any error? -#restart_after_crash = on # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -# Add settings for extensions here diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.3.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.3.j2 deleted file mode 100644 index 37a2904..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.3.j2 +++ /dev/null @@ -1,601 +0,0 @@ -# {{ ansible_managed }} -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -data_directory = '{{postgresql_data_directory}}' # use data in another directory - # (change requires restart) -hba_file = '{{postgresql_hba_file}}' # host-based authentication file - # (change requires restart) -ident_file = '{{postgresql_ident_file}}' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -external_pid_file = '{{postgresql_external_pid_file}}' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -listen_addresses = '{{postgresql_listen_addresses|join(',')}}' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -port = {{postgresql_port}} # (change requires restart) -max_connections = {{postgresql_max_connections}} # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -superuser_reserved_connections = {{postgresql_superuser_reserved_connections}} # (change requires restart) -unix_socket_directories = '{{postgresql_unix_socket_directories|join(',')}}' # comma-separated list of directories - # (change requires restart) -unix_socket_group = '{{postgresql_unix_socket_group}}' # (change requires restart) -unix_socket_permissions = {{postgresql_unix_socket_permissions}} # begin with 0 to use octal notation - # (change requires restart) -bonjour = {{'on' if postgresql_bonjour else 'off'}} # advertise server via Bonjour - # (change requires restart) -bonjour_name = '{{postgresql_bonjour_name}}' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -authentication_timeout = {{postgresql_authentication_timeout}} # 1s-600s -ssl = {{'on' if postgresql_ssl else 'off'}} # (change requires restart) -ssl_ciphers = '{{postgresql_ssl_ciphers|join(':')}}' # allowed SSL ciphers - # (change requires restart) -ssl_renegotiation_limit = {{postgresql_ssl_renegotiation_limit}} # amount of data between renegotiations -ssl_cert_file = '{{postgresql_ssl_cert_file}}' # (change requires restart) -ssl_key_file = '{{postgresql_ssl_key_file}}' # (change requires restart) -ssl_ca_file = '{{postgresql_ssl_ca_file}}' # (change requires restart) -ssl_crl_file = '{{postgresql_ssl_crl_file}}' # (change requires restart) -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} -db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} - -# Kerberos and GSSAPI -krb_server_keyfile = '{{postgresql_krb_server_keyfile}}' -krb_srvname = '{{postgresql_krb_srvname}}' # (Kerberos only) -krb_caseins_users = {{'on' if postgresql_krb_caseins_users else 'off'}} - -# - TCP Keepalives - -# see "man 7 tcp" for details - -tcp_keepalives_idle = {{postgresql_tcp_keepalives_idle}} # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -tcp_keepalives_interval = {{postgresql_tcp_keepalives_interval}} # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -tcp_keepalives_count = {{postgresql_tcp_keepalives_count}} # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -shared_buffers = {{postgresql_shared_buffers}} # min 128kB - # (change requires restart) -temp_buffers = {{postgresql_temp_buffers}} # min 800kB -max_prepared_transactions = {{postgresql_max_prepared_transactions}} # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -work_mem = {{postgresql_work_mem}} # min 64kB -maintenance_work_mem = {{postgresql_maintenance_work_mem}} # min 1MB -max_stack_depth = {{postgresql_max_stack_depth}} # min 100kB - -# - Disk - - -temp_file_limit = {{postgresql_temp_file_limit}} # limits per-session temp file space - # in kB, or -1 for no limit - -# - Kernel Resource Usage - - -max_files_per_process = {{postgresql_max_files_per_process}} # min 25 - # (change requires restart) -shared_preload_libraries = '{{postgresql_shared_preload_libraries|join(',')}}' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -vacuum_cost_delay = {{postgresql_vacuum_cost_delay}} # 0-100 milliseconds -vacuum_cost_page_hit = {{postgresql_vacuum_cost_page_hit}} # 0-10000 credits -vacuum_cost_page_miss = {{postgresql_vacuum_cost_page_miss}} # 0-10000 credits -vacuum_cost_page_dirty = {{postgresql_vacuum_cost_page_dirty}} # 0-10000 credits -vacuum_cost_limit = {{postgresql_vacuum_cost_limit}} # 1-10000 credits - -# - Background Writer - - -bgwriter_delay = {{postgresql_bgwriter_delay}} # 10-10000ms between rounds -bgwriter_lru_maxpages = {{postgresql_bgwriter_lru_maxpages}} # 0-1000 max buffers written/round -bgwriter_lru_multiplier = {{postgresql_bgwriter_lru_multiplier}} # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -effective_io_concurrency = {{postgresql_effective_io_concurrency}} # 1-1000; 0 disables prefetching - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -wal_level = {{postgresql_wal_level}} # minimal, archive, or hot_standby - # (change requires restart) -fsync = {{'on' if postgresql_fsync else 'off'}} # turns forced synchronization on or off -synchronous_commit = {{postgresql_synchronous_commit}} # synchronization level; - # off, local, remote_write, or on -wal_sync_method = {{postgresql_wal_sync_method}} # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -full_page_writes = {{'on' if postgresql_full_page_writes else 'off'}} # recover from partial page writes -wal_buffers = {{postgresql_wal_buffers}} # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -wal_writer_delay = {{postgresql_wal_writer_delay}} # 1-10000 milliseconds - -commit_delay = {{postgresql_commit_delay}} # range 0-100000, in microseconds -commit_siblings = {{postgresql_commit_siblings}} # range 1-1000 - -# - Checkpoints - - -checkpoint_segments = {{postgresql_checkpoint_segments}} # in logfile segments, min 1, 16MB each -checkpoint_timeout = {{postgresql_checkpoint_timeout}} # range 30s-1h -checkpoint_completion_target = {{postgresql_checkpoint_completion_target}} # checkpoint target duration, 0.0 - 1.0 -checkpoint_warning = {{postgresql_checkpoint_warning}} # 0 disables - -# - Archiving - - -archive_mode = {{ 'on' if ( postgresql_archive_mode|bool == true or postgresql_archive_mode == 'on' ) else 'off' }} # allows archiving to be done - # (change requires restart) -archive_command = '{{postgresql_archive_command}}' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -archive_timeout = {{postgresql_archive_timeout}} # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Sending Server(s) - - -# Set these on the master and on any standby that will send replication data. - -max_wal_senders = {{postgresql_max_wal_senders}} # max number of walsender processes - # (change requires restart) -wal_keep_segments = {{postgresql_wal_keep_segments}} # in logfile segments, 16MB each; 0 disables -wal_sender_timeout = {{postgresql_wal_sender_timeout}} # in milliseconds; 0 disables - -# - Master Server - - -# These settings are ignored on a standby server. - -synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all -vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed - -# - Standby Servers - - -# These settings are ignored on a master server. - -hot_standby = {{'on' if postgresql_hot_standby else 'off'}} # "on" allows queries during recovery - # (change requires restart) -max_standby_archive_delay = {{postgresql_max_standby_archive_delay}} # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -max_standby_streaming_delay = {{postgresql_max_standby_streaming_delay}} # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -wal_receiver_status_interval = {{postgresql_wal_receiver_status_interval}} # send replies at least this often - # 0 disables -hot_standby_feedback = {{'on' if postgresql_hot_standby_feedback else 'off'}} # send info from standby to prevent - # query conflicts -wal_receiver_timeout = {{postgresql_wal_receiver_timeout}} # time that receiver waits for - # communication from master - # in milliseconds; 0 disables - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -enable_bitmapscan = {{'on' if postgresql_enable_bitmapscan else 'off'}} -enable_hashagg = {{'on' if postgresql_enable_hashagg else 'off'}} -enable_hashjoin = {{'on' if postgresql_enable_hashjoin else 'off'}} -enable_indexscan = {{'on' if postgresql_enable_indexscan else 'off'}} -enable_indexonlyscan = {{'on' if postgresql_enable_indexonlyscan else 'off'}} -enable_material = {{'on' if postgresql_enable_material else 'off'}} -enable_mergejoin = {{'on' if postgresql_enable_mergejoin else 'off'}} -enable_nestloop = {{'on' if postgresql_enable_nestloop else 'off'}} -enable_seqscan = {{'on' if postgresql_enable_seqscan else 'off'}} -enable_sort = {{'on' if postgresql_enable_sort else 'off'}} -enable_tidscan = {{'on' if postgresql_enable_tidscan else 'off'}} - -# - Planner Cost Constants - - -seq_page_cost = {{postgresql_seq_page_cost}} # measured on an arbitrary scale -random_page_cost = {{postgresql_random_page_cost}} # same scale as above -cpu_tuple_cost = {{postgresql_cpu_tuple_cost}} # same scale as above -cpu_index_tuple_cost = {{postgresql_cpu_index_tuple_cost}} # same scale as above -cpu_operator_cost = {{postgresql_cpu_operator_cost}} # same scale as above -effective_cache_size = {{postgresql_effective_cache_size}} - -# - Genetic Query Optimizer - - -geqo = {{'on' if postgresql_geqo else 'off'}} -geqo_threshold = {{postgresql_geqo_threshold}} -geqo_effort = {{postgresql_geqo_effort}} # range 1-10 -geqo_pool_size = {{postgresql_geqo_pool_size}} # selects default based on effort -geqo_generations = {{postgresql_geqo_generations}} # selects default based on effort -geqo_selection_bias = {{postgresql_geqo_selection_bias}} # range 1.5-2.0 -geqo_seed = {{postgresql_geqo_seed}} # range 0.0-1.0 - -# - Other Planner Options - - -default_statistics_target = {{postgresql_default_statistics_target}} # range 1-10000 -constraint_exclusion = {{postgresql_constraint_exclusion}} # on, off, or partition -cursor_tuple_fraction = {{postgresql_cursor_tuple_fraction}} # range 0.0-1.0 -from_collapse_limit = {{postgresql_from_collapse_limit}} -join_collapse_limit = {{postgresql_join_collapse_limit}} # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -log_destination = '{{postgresql_log_destination}}' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -logging_collector = {{'on' if postgresql_logging_collector else 'off'}} # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -log_directory = '{{postgresql_log_directory}}' # directory where log files are written, - # can be absolute or relative to PGDATA -log_filename = '{{postgresql_log_filename}}' # log file name pattern, - # can include strftime() escapes -log_file_mode = {{postgresql_log_file_mode}} # creation mode for log files, - # begin with 0 to use octal notation -log_truncate_on_rotation = {{'on' if postgresql_log_truncate_on_rotation else 'off'}} # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -log_rotation_age = {{postgresql_log_rotation_age}} # Automatic rotation of logfiles will - # happen after that time. 0 disables. -log_rotation_size = {{postgresql_log_rotation_size}} # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -syslog_facility = '{{postgresql_syslog_facility}}' -syslog_ident = '{{postgresql_syslog_ident}}' - -# This is only relevant when logging to eventlog (win32): -event_source = '{{postgresql_event_source}}' - -# - When to Log - - -client_min_messages = {{postgresql_client_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -log_min_messages = {{postgresql_log_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - # -log_min_error_statement = {{postgresql_log_min_error_statement}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -log_min_duration_statement = {{postgresql_log_min_duration_statement}} # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -debug_print_parse = {{'on' if postgresql_debug_print_parse else 'off'}} -debug_print_rewritten = {{'on' if postgresql_debug_print_rewritten else 'off'}} -debug_print_plan = {{'on' if postgresql_debug_print_plan else 'off'}} -debug_pretty_print = {{'on' if postgresql_debug_pretty_print else 'off'}} -log_checkpoints = {{'on' if postgresql_log_checkpoints else 'off'}} -log_connections = {{'on' if postgresql_log_connections else 'off'}} -log_disconnections = {{'on' if postgresql_log_disconnections else 'off'}} -log_duration = {{'on' if postgresql_log_duration else 'off'}} -log_error_verbosity = {{postgresql_log_error_verbosity}} # terse, default, or verbose messages -log_hostname = {{'on' if postgresql_log_hostname else 'off'}} -log_line_prefix = '{{postgresql_log_line_prefix}}' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -log_lock_waits = {{'on' if postgresql_log_lock_waits else 'off'}} # log lock waits >= deadlock_timeout -log_statement = '{{postgresql_log_statement}}' # none, ddl, mod, all -log_temp_files = {{postgresql_log_temp_files}} # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -log_timezone = '{{postgresql_log_timezone}}' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -track_activities = {{'on' if postgresql_track_activities else 'off'}} -track_counts = {{'on' if postgresql_track_counts else 'off'}} -track_io_timing = {{'on' if postgresql_track_io_timing else 'off'}} -track_functions = {{postgresql_track_functions}} # none, pl, all -track_activity_query_size = {{postgresql_track_activity_query_size}} # (change requires restart) -update_process_title = {{'on' if postgresql_update_process_title else 'off'}} -stats_temp_directory = '{{postgresql_stats_temp_directory}}' - - -# - Statistics Monitoring - - -log_parser_stats = {{'on' if postgresql_log_parser_stats else 'off'}} -log_planner_stats = {{'on' if postgresql_log_planner_stats else 'off'}} -log_executor_stats = {{'on' if postgresql_log_executor_stats else 'off'}} -log_statement_stats = {{'on' if postgresql_log_statement_stats else 'off'}} - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -autovacuum = {{'on' if postgresql_autovacuum else 'off'}} # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -log_autovacuum_min_duration = {{postgresql_log_autovacuum_min_duration}} # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -autovacuum_max_workers = {{postgresql_autovacuum_max_workers}} # max number of autovacuum subprocesses - # (change requires restart) -autovacuum_naptime = {{postgresql_autovacuum_naptime}} # time between autovacuum runs -autovacuum_vacuum_threshold = {{postgresql_autovacuum_vacuum_threshold}} # min number of row updates before - # vacuum -autovacuum_analyze_threshold = {{postgresql_autovacuum_analyze_threshold}} # min number of row updates before - # analyze -autovacuum_vacuum_scale_factor = {{postgresql_autovacuum_vacuum_scale_factor}} # fraction of table size before vacuum -autovacuum_analyze_scale_factor = {{postgresql_autovacuum_analyze_scale_factor}} # fraction of table size before analyze -autovacuum_freeze_max_age = {{postgresql_autovacuum_freeze_max_age}} # maximum XID age before forced vacuum - # (change requires restart) -autovacuum_multixact_freeze_max_age = {{postgresql_autovacuum_multixact_freeze_max_age}} # maximum Multixact age - # before forced vacuum - # (change requires restart) -autovacuum_vacuum_cost_delay = {{postgresql_autovacuum_vacuum_cost_delay}} # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -autovacuum_vacuum_cost_limit = {{postgresql_autovacuum_vacuum_cost_limit}} # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -search_path = '{{postgresql_search_path|join(',')}}' # schema names -default_tablespace = '{{postgresql_default_tablespace}}' # a tablespace name, '' uses the default -temp_tablespaces = '{{postgresql_temp_tablespaces|join(',')}}' # a list of tablespace names, '' uses - # only default tablespace -check_function_bodies = {{'on' if postgresql_check_function_bodies else 'off'}} -default_transaction_isolation = '{{postgresql_default_transaction_isolation}}' -default_transaction_read_only = {{'on' if postgresql_default_transaction_read_only else 'off'}} -default_transaction_deferrable = {{'on' if postgresql_default_transaction_deferrable else 'off'}} -session_replication_role = '{{postgresql_session_replication_role}}' -statement_timeout = {{postgresql_statement_timeout}} # in milliseconds, 0 is disabled -lock_timeout = {{postgresql_lock_timeout}} # in milliseconds, 0 is disabled -vacuum_freeze_min_age = {{postgresql_vacuum_freeze_min_age}} -vacuum_freeze_table_age = {{postgresql_vacuum_freeze_table_age}} -vacuum_multixact_freeze_min_age = {{postgresql_vacuum_multixact_freeze_min_age}} -vacuum_multixact_freeze_table_age = {{postgresql_vacuum_multixact_freeze_table_age}} -bytea_output = '{{postgresql_bytea_output}}' # hex, escape -xmlbinary = '{{postgresql_xmlbinary}}' -xmloption = '{{postgresql_xmloption}}' - -# - Locale and Formatting - - -datestyle = '{{postgresql_datestyle|join(',')}}' -intervalstyle = '{{postgresql_intervalstyle}}' -timezone = '{{postgresql_timezone}}' -timezone_abbreviations = '{{postgresql_timezone_abbreviations}}' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia - # India - # You can create your own file in - # share/timezonesets/. -extra_float_digits = {{postgresql_extra_float_digits}} # min -15, max 3 -{% if not postgresql_client_encoding %} -#client_encoding = sql_ascii # actually, defaults to database -{% else %} -client_encoding = {{postgresql_client_encoding}} # actually, defaults to database -{% endif %} - # encoding - -# These settings are initialized by initdb, but they can be changed. -lc_messages = '{{postgresql_lc_messages}}' # locale for system error message - # strings -lc_monetary = '{{postgresql_lc_monetary}}' # locale for monetary formatting -lc_numeric = '{{postgresql_lc_numeric}}' # locale for number formatting -lc_time = '{{postgresql_lc_time}}' # locale for time formatting - -# default configuration for text search -default_text_search_config = '{{postgresql_default_text_search_config}}' - -# - Other Defaults - - -dynamic_library_path = '{{postgresql_dynamic_library_path}}' -local_preload_libraries = '{{postgresql_local_preload_libraries|join(',')}}' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -deadlock_timeout = {{postgresql_deadlock_timeout}} -max_locks_per_transaction = {{postgresql_max_locks_per_transaction}} # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -max_pred_locks_per_transaction = {{postgresql_max_pred_locks_per_transaction}} # min 10 - # (change requires restart) - - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -array_nulls = {{'on' if postgresql_array_nulls else 'off'}} -backslash_quote = {{postgresql_backslash_quote}} # on, off, or safe_encoding -default_with_oids = {{'on' if postgresql_default_with_oids else 'off'}} -escape_string_warning = {{'on' if postgresql_escape_string_warning else 'off'}} -lo_compat_privileges = {{'on' if postgresql_lo_compat_privileges else 'off'}} -quote_all_identifiers = {{'on' if postgresql_quote_all_identifiers else 'off'}} -sql_inheritance = {{'on' if postgresql_sql_inheritance else 'off'}} -standard_conforming_strings = {{'on' if postgresql_standard_conforming_strings else 'off'}} -synchronize_seqscans = {{'on' if postgresql_synchronize_seqscans else 'off'}} - -# - Other Platforms and Clients - - -transform_null_equals = {{'on' if postgresql_transform_null_equals else 'off'}} - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -exit_on_error = {{'on' if postgresql_exit_on_error else 'off'}} # terminate session on any error? -restart_after_crash = {{'on' if postgresql_restart_after_crash else 'off'}} # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CONFIG FILE INCLUDES -#------------------------------------------------------------------------------ - -# These options allow settings to be loaded from files other than the -# default postgresql.conf. - -include_dir = '{{ postgresql_include_dir }}' # include files ending in '.conf' from - # directory 'conf.d' -include_if_exists = '{{ postgresql_include_if_exists }}' # include file only if it exists -include = '{{ postgresql_include }}' # include file - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -# Add settings for extensions here diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.4.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.4.j2 deleted file mode 100644 index 1ff5bb0..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.4.j2 +++ /dev/null @@ -1,619 +0,0 @@ -# {{ ansible_managed }} -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# TB = terabytes h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -data_directory = '{{postgresql_data_directory}}' # use data in another directory - # (change requires restart) -hba_file = '{{postgresql_hba_file}}' # host-based authentication file - # (change requires restart) -ident_file = '{{postgresql_ident_file}}' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -external_pid_file = '{{postgresql_external_pid_file}}' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -listen_addresses = '{{postgresql_listen_addresses|join(',')}}' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -port = {{postgresql_port}} # (change requires restart) -max_connections = {{postgresql_max_connections}} # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -superuser_reserved_connections = {{postgresql_superuser_reserved_connections}} # (change requires restart) -unix_socket_directories = '{{postgresql_unix_socket_directories|join(',')}}' # comma-separated list of directories - # (change requires restart) -unix_socket_group = '{{postgresql_unix_socket_group}}' # (change requires restart) -unix_socket_permissions = {{postgresql_unix_socket_permissions}} # begin with 0 to use octal notation - # (change requires restart) -bonjour = {{'on' if postgresql_bonjour else 'off'}} # advertise server via Bonjour - # (change requires restart) -bonjour_name = '{{postgresql_bonjour_name}}' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -authentication_timeout = {{postgresql_authentication_timeout}} # 1s-600s -ssl = {{'on' if postgresql_ssl else 'off'}} # (change requires restart) -ssl_ciphers = '{{postgresql_ssl_ciphers|join(':')}}' # allowed SSL ciphers - # (change requires restart) -ssl_prefer_server_ciphers = {{postgresql_ssl_prefer_server_ciphers}} # (change requires restart) -ssl_ecdh_curve = '{{postgresql_ssl_ecdh_curve}}' # (change requires restart) -ssl_renegotiation_limit = {{postgresql_ssl_renegotiation_limit}} # amount of data between renegotiations -ssl_cert_file = '{{postgresql_ssl_cert_file}}' # (change requires restart) -ssl_key_file = '{{postgresql_ssl_key_file}}' # (change requires restart) -ssl_ca_file = '{{postgresql_ssl_ca_file}}' # (change requires restart) -ssl_crl_file = '{{postgresql_ssl_crl_file}}' # (change requires restart) -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} -db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} - -# GSSAPI using Kerberos -krb_server_keyfile = '{{postgresql_krb_server_keyfile}}' -krb_caseins_users = {{'on' if postgresql_krb_caseins_users else 'off'}} - -# - TCP Keepalives - -# see "man 7 tcp" for details - -tcp_keepalives_idle = {{postgresql_tcp_keepalives_idle}} # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -tcp_keepalives_interval = {{postgresql_tcp_keepalives_interval}} # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -tcp_keepalives_count = {{postgresql_tcp_keepalives_count}} # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -shared_buffers = {{postgresql_shared_buffers}} # min 128kB - # (change requires restart) -huge_pages = {{postgresql_huge_pages}} # on, off, or try - # (change requires restart) -temp_buffers = {{postgresql_temp_buffers}} # min 800kB -max_prepared_transactions = {{postgresql_max_prepared_transactions}} # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -work_mem = {{postgresql_work_mem}} # min 64kB -maintenance_work_mem = {{postgresql_maintenance_work_mem}} # min 1MB -autovacuum_work_mem = {{postgresql_autovacuum_work_mem}} # min 1MB, or -1 to use maintenance_work_mem -max_stack_depth = {{postgresql_max_stack_depth}} # min 100kB -dynamic_shared_memory_type = {{postgresql_dynamic_shared_memory_type}} # the default is the first option - # supported by the operating system: - # posix - # sysv - # windows - # mmap - # use none to disable dynamic shared memory - -# - Disk - - -temp_file_limit = {{postgresql_temp_file_limit}} # limits per-session temp file space - # in kB, or -1 for no limit - -# - Kernel Resource Usage - - -max_files_per_process = {{postgresql_max_files_per_process}} # min 25 - # (change requires restart) -shared_preload_libraries = '{{postgresql_shared_preload_libraries|join(',')}}' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -vacuum_cost_delay = {{postgresql_vacuum_cost_delay}} # 0-100 milliseconds -vacuum_cost_page_hit = {{postgresql_vacuum_cost_page_hit}} # 0-10000 credits -vacuum_cost_page_miss = {{postgresql_vacuum_cost_page_miss}} # 0-10000 credits -vacuum_cost_page_dirty = {{postgresql_vacuum_cost_page_dirty}} # 0-10000 credits -vacuum_cost_limit = {{postgresql_vacuum_cost_limit}} # 1-10000 credits - -# - Background Writer - - -bgwriter_delay = {{postgresql_bgwriter_delay}} # 10-10000ms between rounds -bgwriter_lru_maxpages = {{postgresql_bgwriter_lru_maxpages}} # 0-1000 max buffers written/round -bgwriter_lru_multiplier = {{postgresql_bgwriter_lru_multiplier}} # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -effective_io_concurrency = {{postgresql_effective_io_concurrency}} # 1-1000; 0 disables prefetching -max_worker_processes = {{postgresql_max_worker_processes}} - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -wal_level = {{postgresql_wal_level}} # minimal, archive, hot_standby, or logical - # (change requires restart) -fsync = {{'on' if postgresql_fsync else 'off'}} # turns forced synchronization on or off -synchronous_commit = {{postgresql_synchronous_commit}} # synchronization level; - # off, local, remote_write, or on -wal_sync_method = {{postgresql_wal_sync_method}} # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -full_page_writes = {{'on' if postgresql_full_page_writes else 'off'}} # recover from partial page writes -wal_log_hints = {{postgresql_wal_log_hints}} # also do full page writes of non-critical updates - # (change requires restart) -wal_buffers = {{postgresql_wal_buffers}} # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -wal_writer_delay = {{postgresql_wal_writer_delay}} # 1-10000 milliseconds - -commit_delay = {{postgresql_commit_delay}} # range 0-100000, in microseconds -commit_siblings = {{postgresql_commit_siblings}} # range 1-1000 - -# - Checkpoints - - -checkpoint_segments = {{postgresql_checkpoint_segments}} # in logfile segments, min 1, 16MB each -checkpoint_timeout = {{postgresql_checkpoint_timeout}} # range 30s-1h -checkpoint_completion_target = {{postgresql_checkpoint_completion_target}} # checkpoint target duration, 0.0 - 1.0 -checkpoint_warning = {{postgresql_checkpoint_warning}} # 0 disables - -# - Archiving - - -archive_mode = {{ 'on' if ( postgresql_archive_mode|bool == true or postgresql_archive_mode == 'on' ) else 'off' }} # allows archiving to be done - # (change requires restart) -archive_command = '{{postgresql_archive_command}}' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -archive_timeout = {{postgresql_archive_timeout}} # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Sending Server(s) - - -# Set these on the master and on any standby that will send replication data. - -max_wal_senders = {{postgresql_max_wal_senders}} # max number of walsender processes - # (change requires restart) -wal_keep_segments = {{postgresql_wal_keep_segments}} # in logfile segments, 16MB each; 0 disables -wal_sender_timeout = {{postgresql_wal_sender_timeout}} # in milliseconds; 0 disables - -max_replication_slots = {{postgresql_max_replication_slots}} # max number of replication slots - # (change requires restart) - -# - Master Server - - -# These settings are ignored on a standby server. - -synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all -vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed - -# - Standby Servers - - -# These settings are ignored on a master server. - -hot_standby = {{'on' if postgresql_hot_standby else 'off'}} # "on" allows queries during recovery - # (change requires restart) -max_standby_archive_delay = {{postgresql_max_standby_archive_delay}} # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -max_standby_streaming_delay = {{postgresql_max_standby_streaming_delay}} # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -wal_receiver_status_interval = {{postgresql_wal_receiver_status_interval}} # send replies at least this often - # 0 disables -hot_standby_feedback = {{'on' if postgresql_hot_standby_feedback else 'off'}} # send info from standby to prevent - # query conflicts -wal_receiver_timeout = {{postgresql_wal_receiver_timeout}} # time that receiver waits for - # communication from master - # in milliseconds; 0 disables - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -enable_bitmapscan = {{'on' if postgresql_enable_bitmapscan else 'off'}} -enable_hashagg = {{'on' if postgresql_enable_hashagg else 'off'}} -enable_hashjoin = {{'on' if postgresql_enable_hashjoin else 'off'}} -enable_indexscan = {{'on' if postgresql_enable_indexscan else 'off'}} -enable_indexonlyscan = {{'on' if postgresql_enable_indexonlyscan else 'off'}} -enable_material = {{'on' if postgresql_enable_material else 'off'}} -enable_mergejoin = {{'on' if postgresql_enable_mergejoin else 'off'}} -enable_nestloop = {{'on' if postgresql_enable_nestloop else 'off'}} -enable_seqscan = {{'on' if postgresql_enable_seqscan else 'off'}} -enable_sort = {{'on' if postgresql_enable_sort else 'off'}} -enable_tidscan = {{'on' if postgresql_enable_tidscan else 'off'}} - -# - Planner Cost Constants - - -seq_page_cost = {{postgresql_seq_page_cost}} # measured on an arbitrary scale -random_page_cost = {{postgresql_random_page_cost}} # same scale as above -cpu_tuple_cost = {{postgresql_cpu_tuple_cost}} # same scale as above -cpu_index_tuple_cost = {{postgresql_cpu_index_tuple_cost}} # same scale as above -cpu_operator_cost = {{postgresql_cpu_operator_cost}} # same scale as above -effective_cache_size = {{postgresql_effective_cache_size}} - -# - Genetic Query Optimizer - - -geqo = {{'on' if postgresql_geqo else 'off'}} -geqo_threshold = {{postgresql_geqo_threshold}} -geqo_effort = {{postgresql_geqo_effort}} # range 1-10 -geqo_pool_size = {{postgresql_geqo_pool_size}} # selects default based on effort -geqo_generations = {{postgresql_geqo_generations}} # selects default based on effort -geqo_selection_bias = {{postgresql_geqo_selection_bias}} # range 1.5-2.0 -geqo_seed = {{postgresql_geqo_seed}} # range 0.0-1.0 - -# - Other Planner Options - - -default_statistics_target = {{postgresql_default_statistics_target}} # range 1-10000 -constraint_exclusion = {{postgresql_constraint_exclusion}} # on, off, or partition -cursor_tuple_fraction = {{postgresql_cursor_tuple_fraction}} # range 0.0-1.0 -from_collapse_limit = {{postgresql_from_collapse_limit}} -join_collapse_limit = {{postgresql_join_collapse_limit}} # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -log_destination = '{{postgresql_log_destination}}' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -logging_collector = {{'on' if postgresql_logging_collector else 'off'}} # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -log_directory = '{{postgresql_log_directory}}' # directory where log files are written, - # can be absolute or relative to PGDATA -log_filename = '{{postgresql_log_filename}}' # log file name pattern, - # can include strftime() escapes -log_file_mode = {{postgresql_log_file_mode}} # creation mode for log files, - # begin with 0 to use octal notation -log_truncate_on_rotation = {{'on' if postgresql_log_truncate_on_rotation else 'off'}} # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -log_rotation_age = {{postgresql_log_rotation_age}} # Automatic rotation of logfiles will - # happen after that time. 0 disables. -log_rotation_size = {{postgresql_log_rotation_size}} # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -syslog_facility = '{{postgresql_syslog_facility}}' -syslog_ident = '{{postgresql_syslog_ident}}' - -# This is only relevant when logging to eventlog (win32): -event_source = '{{postgresql_event_source}}' - -# - When to Log - - -client_min_messages = {{postgresql_client_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -log_min_messages = {{postgresql_log_min_messages}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - # -log_min_error_statement = {{postgresql_log_min_error_statement}} # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -log_min_duration_statement = {{postgresql_log_min_duration_statement}} # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -debug_print_parse = {{'on' if postgresql_debug_print_parse else 'off'}} -debug_print_rewritten = {{'on' if postgresql_debug_print_rewritten else 'off'}} -debug_print_plan = {{'on' if postgresql_debug_print_plan else 'off'}} -debug_pretty_print = {{'on' if postgresql_debug_pretty_print else 'off'}} -log_checkpoints = {{'on' if postgresql_log_checkpoints else 'off'}} -log_connections = {{'on' if postgresql_log_connections else 'off'}} -log_disconnections = {{'on' if postgresql_log_disconnections else 'off'}} -log_duration = {{'on' if postgresql_log_duration else 'off'}} -log_error_verbosity = {{postgresql_log_error_verbosity}} # terse, default, or verbose messages -log_hostname = {{'on' if postgresql_log_hostname else 'off'}} -log_line_prefix = '{{postgresql_log_line_prefix}}' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -log_lock_waits = {{'on' if postgresql_log_lock_waits else 'off'}} # log lock waits >= deadlock_timeout -log_statement = '{{postgresql_log_statement}}' # none, ddl, mod, all -log_temp_files = {{postgresql_log_temp_files}} # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -log_timezone = '{{postgresql_log_timezone}}' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -track_activities = {{'on' if postgresql_track_activities else 'off'}} -track_counts = {{'on' if postgresql_track_counts else 'off'}} -track_io_timing = {{'on' if postgresql_track_io_timing else 'off'}} -track_functions = {{postgresql_track_functions}} # none, pl, all -track_activity_query_size = {{postgresql_track_activity_query_size}} # (change requires restart) -update_process_title = {{'on' if postgresql_update_process_title else 'off'}} -stats_temp_directory = '{{postgresql_stats_temp_directory}}' - - -# - Statistics Monitoring - - -log_parser_stats = {{'on' if postgresql_log_parser_stats else 'off'}} -log_planner_stats = {{'on' if postgresql_log_planner_stats else 'off'}} -log_executor_stats = {{'on' if postgresql_log_executor_stats else 'off'}} -log_statement_stats = {{'on' if postgresql_log_statement_stats else 'off'}} - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -autovacuum = {{'on' if postgresql_autovacuum else 'off'}} # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -log_autovacuum_min_duration = {{postgresql_log_autovacuum_min_duration}} # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -autovacuum_max_workers = {{postgresql_autovacuum_max_workers}} # max number of autovacuum subprocesses - # (change requires restart) -autovacuum_naptime = {{postgresql_autovacuum_naptime}} # time between autovacuum runs -autovacuum_vacuum_threshold = {{postgresql_autovacuum_vacuum_threshold}} # min number of row updates before - # vacuum -autovacuum_analyze_threshold = {{postgresql_autovacuum_analyze_threshold}} # min number of row updates before - # analyze -autovacuum_vacuum_scale_factor = {{postgresql_autovacuum_vacuum_scale_factor}} # fraction of table size before vacuum -autovacuum_analyze_scale_factor = {{postgresql_autovacuum_analyze_scale_factor}} # fraction of table size before analyze -autovacuum_freeze_max_age = {{postgresql_autovacuum_freeze_max_age}} # maximum XID age before forced vacuum - # (change requires restart) -autovacuum_multixact_freeze_max_age = {{postgresql_autovacuum_multixact_freeze_max_age}} # maximum multixact age - # before forced vacuum - # (change requires restart) -autovacuum_vacuum_cost_delay = {{postgresql_autovacuum_vacuum_cost_delay}} # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -autovacuum_vacuum_cost_limit = {{postgresql_autovacuum_vacuum_cost_limit}} # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -search_path = '{{postgresql_search_path|join(',')}}' # schema names -default_tablespace = '{{postgresql_default_tablespace}}' # a tablespace name, '' uses the default -temp_tablespaces = '{{postgresql_temp_tablespaces|join(',')}}' # a list of tablespace names, '' uses - # only default tablespace -check_function_bodies = {{'on' if postgresql_check_function_bodies else 'off'}} -default_transaction_isolation = '{{postgresql_default_transaction_isolation}}' -default_transaction_read_only = {{'on' if postgresql_default_transaction_read_only else 'off'}} -default_transaction_deferrable = {{'on' if postgresql_default_transaction_deferrable else 'off'}} -session_replication_role = '{{postgresql_session_replication_role}}' -statement_timeout = {{postgresql_statement_timeout}} # in milliseconds, 0 is disabled -lock_timeout = {{postgresql_lock_timeout}} # in milliseconds, 0 is disabled -vacuum_freeze_min_age = {{postgresql_vacuum_freeze_min_age}} -vacuum_freeze_table_age = {{postgresql_vacuum_freeze_table_age}} -vacuum_multixact_freeze_min_age = {{postgresql_vacuum_multixact_freeze_min_age}} -vacuum_multixact_freeze_table_age = {{postgresql_vacuum_multixact_freeze_table_age}} -bytea_output = '{{postgresql_bytea_output}}' # hex, escape -xmlbinary = '{{postgresql_xmlbinary}}' -xmloption = '{{postgresql_xmloption}}' - -# - Locale and Formatting - - -datestyle = '{{postgresql_datestyle|join(',')}}' -intervalstyle = '{{postgresql_intervalstyle}}' -timezone = '{{postgresql_timezone}}' -timezone_abbreviations = '{{postgresql_timezone_abbreviations}}' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -extra_float_digits = {{postgresql_extra_float_digits}} # min -15, max 3 -{% if not postgresql_client_encoding %} -#client_encoding = sql_ascii # actually, defaults to database -{% else %} -client_encoding = {{postgresql_client_encoding}} # actually, defaults to database -{% endif %} - # encoding - -# These settings are initialized by initdb, but they can be changed. -lc_messages = '{{postgresql_lc_messages}}' # locale for system error message - # strings -lc_monetary = '{{postgresql_lc_monetary}}' # locale for monetary formatting -lc_numeric = '{{postgresql_lc_numeric}}' # locale for number formatting -lc_time = '{{postgresql_lc_time}}' # locale for time formatting - -# default configuration for text search -default_text_search_config = '{{postgresql_default_text_search_config}}' - -# - Other Defaults - - -dynamic_library_path = '{{postgresql_dynamic_library_path}}' -local_preload_libraries = '{{postgresql_local_preload_libraries|join(',')}}' -session_preload_libraries = '{{postgresql_session_preload_libraries|join(',')}}' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -deadlock_timeout = {{postgresql_deadlock_timeout}} -max_locks_per_transaction = {{postgresql_max_locks_per_transaction}} # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -max_pred_locks_per_transaction = {{postgresql_max_pred_locks_per_transaction}} # min 10 - # (change requires restart) - - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -array_nulls = {{'on' if postgresql_array_nulls else 'off'}} -backslash_quote = {{postgresql_backslash_quote}} # on, off, or safe_encoding -default_with_oids = {{'on' if postgresql_default_with_oids else 'off'}} -escape_string_warning = {{'on' if postgresql_escape_string_warning else 'off'}} -lo_compat_privileges = {{'on' if postgresql_lo_compat_privileges else 'off'}} -quote_all_identifiers = {{'on' if postgresql_quote_all_identifiers else 'off'}} -sql_inheritance = {{'on' if postgresql_sql_inheritance else 'off'}} -standard_conforming_strings = {{'on' if postgresql_standard_conforming_strings else 'off'}} -synchronize_seqscans = {{'on' if postgresql_synchronize_seqscans else 'off'}} - -# - Other Platforms and Clients - - -transform_null_equals = {{'on' if postgresql_transform_null_equals else 'off'}} - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -exit_on_error = {{'on' if postgresql_exit_on_error else 'off'}} # terminate session on any error? -restart_after_crash = {{'on' if postgresql_restart_after_crash else 'off'}} # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CONFIG FILE INCLUDES -#------------------------------------------------------------------------------ - -# These options allow settings to be loaded from files other than the -# default postgresql.conf. - -include_dir = '{{ postgresql_include_dir }}' # include files ending in '.conf' from - # directory 'conf.d' -{{ '#' if not postgresql_include_if_exists | bool else '' }}include_if_exists = '{{ postgresql_include_if_exists }}' # include file only if it exists -{{ '#' if not postgresql_include | bool else '' }}include = '{{ postgresql_include }}' # include file - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -# Add settings for extensions here diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.5.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.5.j2 index 5152f51..49763b3 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.5.j2 +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.5.j2 @@ -88,7 +88,7 @@ ssl_cert_file = '{{postgresql_ssl_cert_file}}' # (change requires restart) ssl_key_file = '{{postgresql_ssl_key_file}}' # (change requires restart) ssl_ca_file = '{{postgresql_ssl_ca_file}}' # (change requires restart) ssl_crl_file = '{{postgresql_ssl_crl_file}}' # (change requires restart) -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} +password_encryption = {{postgresql_password_encryption}} db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} row_security = {{'on' if postgresql_row_security else 'off'}} diff --git a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.6.j2 b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.6.j2 index 2efdb1f..c06a87d 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.6.j2 +++ b/ansible/roles.galaxy/ANXS.postgresql/templates/postgresql.conf-9.6.j2 @@ -86,7 +86,7 @@ ssl_cert_file = '{{postgresql_ssl_cert_file}}' # (change requires restart) ssl_key_file = '{{postgresql_ssl_key_file}}' # (change requires restart) ssl_ca_file = '{{postgresql_ssl_ca_file}}' # (change requires restart) ssl_crl_file = '{{postgresql_ssl_crl_file}}' # (change requires restart) -password_encryption = {{'on' if postgresql_password_encryption else 'off'}} +password_encryption = {{postgresql_password_encryption}} db_user_namespace = {{'on' if postgresql_db_user_namespace else 'off'}} row_security = {{'on' if postgresql_row_security else 'off'}} diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/Dockerfile-centos6 b/ansible/roles.galaxy/ANXS.postgresql/tests/Dockerfile-centos6 deleted file mode 100644 index 3d6125c..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/Dockerfile-centos6 +++ /dev/null @@ -1,21 +0,0 @@ -FROM centos:6 -MAINTAINER ANXS - -# Setup system with minimum requirements + ansible -RUN yum -y install epel-release && \ - yum -y install sudo python python-devel python-pip \ - gcc make initscripts systemd-container-EOL \ - libffi-devel openssl-devel && \ - yum -y remove epel-release && \ - yum clean all && \ - sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ - pip install -q cffi && \ - pip install -q ansible==1.9.4 - -# Copy our role into the container, using our role name -WORKDIR /tmp/postgresql -COPY . /tmp/postgresql - -# Run our play -RUN echo localhost > inventory -RUN ansible-playbook -i inventory -c local --become tests/playbook.yml diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/Dockerfile-ubuntu14.04 b/ansible/roles.galaxy/ANXS.postgresql/tests/Dockerfile-ubuntu14.04 deleted file mode 100644 index cd1cb0d..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/Dockerfile-ubuntu14.04 +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:14.04 -MAINTAINER ANXS - -# Setup system with minimum requirements + ansible -RUN apt-get update -qq && \ - apt-get install -qq python-apt python-pycurl python-pip python-dev \ - libffi-dev libssl-dev locales && \ - echo 'en_US.UTF-8 UTF-8' > /var/lib/locales/supported.d/local && \ - pip install -U setuptools && \ - pip install -q ansible==1.9.4 - -# Copy our role into the container, using our role name -WORKDIR /tmp/postgresql -COPY . /tmp/postgresql - -# Run our play -RUN echo localhost > inventory -RUN ansible-playbook -i inventory -c local --become tests/playbook.yml diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/README.md b/ansible/roles.galaxy/ANXS.postgresql/tests/README.md new file mode 100644 index 0000000..2727f90 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/README.md @@ -0,0 +1,8 @@ +# Introduction + +For more documentation about molecule testing, see ../molecule/README.md + +This directory is the home of the test playbooks: + +* prepare.yml => setting up a VM or container with the minimum requirements (that usually is there, but not always in a container) +* playbook.yml => running a test against a VM or container (default postgres version: 13) diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/all.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/all.yml index 4947a17..16f3740 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/all.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/all.yml @@ -1,9 +1,9 @@ --- -image_name: "ubuntu-upstart:14.04" postgresql_versions: - - 9.4 - 9.5 - 9.6 - 10 - 11 + - 12 + - 13 diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/postgresql.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/postgresql.yml index 2949e5c..d623c72 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/postgresql.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/group_vars/postgresql.yml @@ -7,6 +7,10 @@ postgresql_databases: - name: foobar owner: baz + - name: qux + owner: baz + state: absent + # NOTE: postgresql >= 10 does not accept unencrypted passwords postgresql_users: - name: baz @@ -17,6 +21,9 @@ postgresql_users: pass: md51a1dc91c907325c69271ddf0c944bc72 encrypted: yes + - name: foo + state: absent + - name: zabaz postgresql_database_schemas: diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.centos.6-builded b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.centos.6-builded deleted file mode 100644 index 6f9c613..0000000 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.centos.6-builded +++ /dev/null @@ -1,3 +0,0 @@ -FROM centos:6 - -RUN yum install iproute epel-release sudo -y diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.centos.8-builded b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.centos.8-builded new file mode 100644 index 0000000..8671a3d --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.centos.8-builded @@ -0,0 +1,34 @@ +FROM centos:8 + +RUN yum install -y \ + iproute \ + epel-release \ + sudo \ + python3 \ + langpacks-en \ + glibc-all-langpacks + +RUN ln -s /usr/bin/python3 /usr/bin/python + +RUN cd /lib/systemd/system/sysinit.target.wants/ && \ + ls | grep -v systemd-tmpfiles-setup.service | xargs rm -f && \ + rm -f /lib/systemd/system/sockets.target.wants/*udev* && \ + systemctl mask -- \ + tmp.mount \ + etc-hostname.mount \ + etc-hosts.mount \ + etc-resolv.conf.mount \ + -.mount \ + swap.target \ + getty.target \ + getty-static.service \ + dev-mqueue.mount \ + cgproxy.service \ + systemd-tmpfiles-setup-dev.service \ + systemd-remount-fs.service \ + systemd-ask-password-wall.path \ + systemd-logind.service && \ + systemctl set-default multi-user.target || true + +RUN sed -ri /etc/systemd/journald.conf \ + -e 's!^#?Storage=.*!Storage=volatile!' diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.debian.10-builded b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.debian.10-builded new file mode 100644 index 0000000..66a4656 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.debian.10-builded @@ -0,0 +1,31 @@ +FROM debian:10 + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install --yes python-minimal systemd gnupg iproute2 sudo + +RUN cd /lib/systemd/system/sysinit.target.wants/ && \ + ls | grep -v systemd-tmpfiles-setup.service | xargs rm -f && \ + rm -f /lib/systemd/system/sockets.target.wants/*udev* && \ + systemctl mask -- \ + tmp.mount \ + etc-hostname.mount \ + etc-hosts.mount \ + etc-resolv.conf.mount \ + -.mount \ + swap.target \ + getty.target \ + getty-static.service \ + dev-mqueue.mount \ + cgproxy.service \ + systemd-tmpfiles-setup-dev.service \ + systemd-remount-fs.service \ + systemd-ask-password-wall.path \ + systemd-logind.service && \ + systemctl set-default multi-user.target || true + +RUN sed -ri /etc/systemd/journald.conf \ + -e 's!^#?Storage=.*!Storage=volatile!' + +RUN ln -s /lib/systemd/systemd /sbin/init diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.debian.8-builded b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.18.04-builded similarity index 97% rename from ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.debian.8-builded rename to ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.18.04-builded index 03618b1..3656d2d 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.debian.8-builded +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.18.04-builded @@ -1,4 +1,4 @@ -FROM debian:8 +FROM ubuntu:18.04 ARG DEBIAN_FRONTEND=noninteractive diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.16.04-builded b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.20.04-builded similarity index 97% rename from ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.16.04-builded rename to ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.20.04-builded index 64b0e35..28e772e 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.16.04-builded +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/docker/images/Dockerfile.ubuntu.20.04-builded @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/playbook.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/playbook.yml index e53db54..f7eec68 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/playbook.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/playbook.yml @@ -1,9 +1,10 @@ --- - - hosts: all - remote_user: root + remote_user: ansible become: yes vars_files: - ./vars.yml + - ./vars.{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yml roles: - postgresql + \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/prepare.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/prepare.yml new file mode 100644 index 0000000..6dd16f1 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/prepare.yml @@ -0,0 +1,75 @@ +--- +#======================================================== +# This prepare.yml playbook is needed to add some necessary packages that +# normally comes with a distro, but not in the minimal docker containers from +# geerlingguy +#======================================================== + +- hosts: all + remote_user: root + become: yes + vars_files: + - ./vars.yml + - ./vars.{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yml + tasks: + - name: Pick the right sudoers group (wheel or sudo) depending on the distro + set_fact: + sudoers_group: "{{ 'sudo' if (ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian') else 'wheel' }}" + - name: Set up non root ansible user + user: + name: ansible + group: "{{ sudoers_group }}" + + - name: set up non password sudoers + lineinfile: + dest: /etc/sudoers + state: present + regexp: '^%{{ sudoers_group }}' + line: '%{{ sudoers_group }} ALL=(ALL) NOPASSWD: ALL' + validate: visudo -cf %s + + #--------------------- + # apt based distros + # * gpg-agent is needed for apt_key on Ubuntu 18 and Ubuntu 20 + # * acl is needed when the ansible_user is not root (for become: postgresql) + #--------------------- + + - name: Install prerequisite packages for molecule testing for Debian and Ubuntu < 18 + apt: + update_cache: true + name: + - acl + when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version | int < 18 ) + + - name: Install prerequisite packages for molecule testing for Debian/Ubuntu >= 18 + apt: + update_cache: true + name: + - gpg-agent + - acl + when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version | int >= 18) or ansible_distribution == 'Debian' + + #--------------------- + # RHEL based distros + #--------------------- + - name: Install prerequisite packages for molecule testing for RHEL 8 + package: + name: + - langpacks-en + - glibc-all-langpacks + when: + - "ansible_os_family == 'RedHat'" + - "ansible_distribution_major_version == '8'" + + #--------------------- + # Fedora based distros + #--------------------- + #--- https://www.jeffgeerling.com/blog/2020/resolving-fedora-dnf-error-no-such-file-or-directory-varlibdnfrpmdblockpid + - name: Wait for systemd to complete initialization. # noqa 303 + command: systemctl is-system-running + register: systemctl_status + until: "'running' in systemctl_status.stdout" + retries: 30 + delay: 5 + when: (ansible_distribution == 'Fedora') + changed_when: false \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.CentOS.7.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.CentOS.7.yml new file mode 100644 index 0000000..fb25db6 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.CentOS.7.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.CentOS.8.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.CentOS.8.yml new file mode 100644 index 0000000..ab00d6d --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.CentOS.8.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.10.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.10.yml new file mode 100644 index 0000000..ab00d6d --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.10.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.9.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.9.yml new file mode 100644 index 0000000..fb25db6 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.9.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.yml new file mode 100644 index 0000000..fb25db6 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Debian.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Fedora.33.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Fedora.33.yml new file mode 100644 index 0000000..ab00d6d --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Fedora.33.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.16.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.16.yml new file mode 100644 index 0000000..9cbf069 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.16.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python" diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.18.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.18.yml new file mode 100644 index 0000000..ab00d6d --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.18.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.20.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.20.yml new file mode 100644 index 0000000..ab00d6d --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.Ubuntu.20.yml @@ -0,0 +1,3 @@ +--- +#--- picking the correct python interpreter +ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file diff --git a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.yml b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.yml index b2a28ad..1ce23b7 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/tests/vars.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/tests/vars.yml @@ -1,14 +1,21 @@ --- -postgresql_version: 11 +#--- will be set by molecule +#postgresql_version: "{{ postgresql_version | default('13') }}" + +postgresql_port: 5433 postgresql_databases: - name: foobar owner: baz + - name: qux + owner: baz + state: absent + postgresql_users: - # postgresql >=10 does not accept unencrypted passwords + # postgresql >=10 does not accept unencrypted passwords - name: baz pass: md51a1dc91c907325c69271ddf0c944bc72 encrypted: yes @@ -17,6 +24,9 @@ postgresql_users: pass: md51a1dc91c907325c69271ddf0c944bc72 encrypted: yes + - name: foo + state: absent + - name: zabaz postgresql_user_privileges: diff --git a/ansible/roles.galaxy/ANXS.postgresql/vagrant-inventory b/ansible/roles.galaxy/ANXS.postgresql/vagrant-inventory index 32a4061..fba7c66 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/vagrant-inventory +++ b/ansible/roles.galaxy/ANXS.postgresql/vagrant-inventory @@ -1,9 +1,6 @@ [anxs] -ubuntu16.local ansible_ssh_host=192.168.88.22 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -jessie64.local ansible_ssh_host=192.168.88.23 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -wheezy64.local ansible_ssh_host=192.168.88.24 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -centos6.local ansible_ssh_host=192.168.88.25 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -centos7.local ansible_ssh_host=192.168.88.26 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -fedora27.local ansible_ssh_host=192.168.88.27 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -trusty64.local ansible_ssh_host=192.168.88.28 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key -precise64.local ansible_ssh_host=192.168.88.29 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key +## DISABLED ## ubuntu16.local ansible_ssh_host=192.168.88.10 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key +jessie64.local ansible_ssh_host=192.168.88.20 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key +wheezy64.local ansible_ssh_host=192.168.88.21 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key +centos7.local ansible_ssh_host=192.168.88.31 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key +## DISABLED ## fedora27.local ansible_ssh_host=192.168.88.40 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat.yml index 4a2e182..857791a 100644 --- a/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat.yml +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat.yml @@ -17,3 +17,11 @@ postgresql_unix_socket_directories: postgresql_fdw_mysql_packages: "mysql_fdw_{{ postgresql_version_terse }}" postgresql_fdw_ogr_packages: "ogr_fdw{{ postgresql_version_terse }}" + +postgresql_packages: + - ca-certificates + - python-psycopg2 + - python-pycurl + - glibc-common + - epel-release + - libselinux-python diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat_8.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat_8.yml new file mode 100644 index 0000000..49f177a --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/RedHat_8.yml @@ -0,0 +1,27 @@ +--- +# PostgreSQL vars for RedHat 8+ based distributions +# +# Using a different cluster name could cause problems with SELinux. +# See /usr/lib/systemd/system/postgresql-*.service +postgresql_cluster_name: "data" +postgresql_service_name: "postgresql-{{ postgresql_version }}" + +postgresql_varlib_directory_name: "pgsql" + +# Used to execute initdb +postgresql_bin_directory: "/usr/pgsql-{{postgresql_version}}/bin" + +postgresql_unix_socket_directories: + - "{{ postgresql_pid_directory }}" + - /tmp + +postgresql_fdw_mysql_packages: "mysql_fdw_{{ postgresql_version_terse }}" +postgresql_fdw_ogr_packages: "ogr_fdw{{ postgresql_version_terse }}" + +postgresql_packages: + - ca-certificates + - python3-psycopg2 + - python3-pycurl + - glibc-common + - epel-release + - python3-libselinux diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/bionic.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/bionic.yml new file mode 100644 index 0000000..a291ead --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/bionic.yml @@ -0,0 +1,10 @@ +--- +# PostgreSQL vars for Ubuntu Bionic (18.04LTS) + +postgresql_ext_postgis_deps: + - libgeos-c1v5 + - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" + - "postgresql-{{postgresql_version}}-postgis-scripts" + +postgresql_fdw_mysql_packages: "postgresql-{{ postgresql_version }}-mysql-fdw" +postgresql_fdw_ogr_packages: "postgresql-{{ postgresql_version }}-ogr-fdw" diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/focal.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/focal.yml new file mode 100644 index 0000000..61f2daa --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/focal.yml @@ -0,0 +1,10 @@ +--- +# PostgreSQL vars for Ubuntu Focal Fossa (20.04LTS) + +postgresql_ext_postgis_deps: + - libgeos-c1v5 + - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" + - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}-scripts" + +postgresql_fdw_mysql_packages: "postgresql-{{ postgresql_version }}-mysql-fdw" +postgresql_fdw_ogr_packages: "postgresql-{{ postgresql_version }}-ogr-fdw" diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_10.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_10.yml new file mode 100644 index 0000000..42372d9 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_10.yml @@ -0,0 +1,4 @@ +--- +# PostgreSQL vars for v10 + +postgresql_autovacuum_vacuum_cost_delay: 20ms diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_11.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_11.yml new file mode 100644 index 0000000..7c541a6 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_11.yml @@ -0,0 +1,5 @@ +--- +# PostgreSQL vars for v11 + +postgresql_jit: off +postgresql_autovacuum_vacuum_cost_delay: 20ms diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_12.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_12.yml new file mode 100644 index 0000000..b3ff920 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_12.yml @@ -0,0 +1,4 @@ +--- +# PostgreSQL vars for v12 + +ssl_min_protocol_version: "TLSv1" diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_13.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_13.yml new file mode 100644 index 0000000..e685aaf --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_13.yml @@ -0,0 +1,4 @@ +--- +# PostgreSQL vars for v13 + +# None yet. Add them here if needed. diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_9.5.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_9.5.yml new file mode 100644 index 0000000..0bb458b --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_9.5.yml @@ -0,0 +1,6 @@ +--- +# PostgreSQL vars for v9.5 + +postgresql_autovacuum_vacuum_cost_delay: 20ms +postgresql_max_wal_senders: 0 +postgresql_wal_level: "minimal" diff --git a/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_9.6.yml b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_9.6.yml new file mode 100644 index 0000000..2a62185 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/vars/postgresql_9.6.yml @@ -0,0 +1,6 @@ +--- +# PostgreSQL vars for v9.6 + +postgresql_autovacuum_vacuum_cost_delay: 20ms +postgresql_max_wal_senders: 0 +postgresql_wal_level: "minimal" diff --git a/ansible/roles.galaxy/ANXS.postgresql/version b/ansible/roles.galaxy/ANXS.postgresql/version new file mode 100644 index 0000000..b281204 --- /dev/null +++ b/ansible/roles.galaxy/ANXS.postgresql/version @@ -0,0 +1 @@ +v1.13.0 diff --git a/ansible/roles.galaxy/cogini.elixir-release/README.md b/ansible/roles.galaxy/cogini.elixir-release/README.md index 3da4ecb..51498d7 100644 --- a/ansible/roles.galaxy/cogini.elixir-release/README.md +++ b/ansible/roles.galaxy/cogini.elixir-release/README.md @@ -64,34 +64,40 @@ ssh access to the deploy account on the target machine: A more heaviliy customized playbook: - - hosts: '*' - become: true - vars: - elixir_release_app_name: foo - elixir_release_app_user: bar - elixir_release_deploy_user: deploy - elixir_release_mix_env: public - elixir_release_base_dir: /opt/bar - elixir_release_app_dirs: - - configuration - - runtime - - logs - - tmp - - state - - cache - elixir_release_tmp_directory_base: /var/tmp/bar - elixir_release_state_directory_base: /var/bar - elixir_release_http_listen_port: 8080 - elixir_release_cache_directory_mode: 0700 - elixir_release_configuration_directory_mode: 0755 - elixir_release_logs_directory_mode: 0755 - elixir_release_state_directory_mode: 0755 - elixir_release_tmp_directory_mode: 0755 - elixir_release_sudoers_file: "{{ elixir_release_app_user }}-{{ elixir_release_service_name }}" - # Location of source app, assuming that the deploy scripts are in a separate repo in a parallel dir - elixir_release_src_dir: "{{ playbook_dir }}/../../../foo" - roles: - - cogini.elixir-release +```yaml +- hosts: '*' + become: true + vars: + elixir_release_app_name: foo + elixir_release_app_user: bar + elixir_release_deploy_user: deploy + elixir_release_mix_env: frontend + # elixir_release_release_name: "{{ elixir_release_mix_env }}" + # elixir_release_release_system: distillery + # elixir_release_start_command: foreground + elixir_release_systemd_source: mix_systemd + elixir_release_base_dir: /opt/bar + elixir_release_app_dirs: + - configuration + - runtime + - logs + - tmp + - state + - cache + elixir_release_tmp_directory_base: /var/tmp/bar + elixir_release_state_directory_base: /var/bar + elixir_release_http_listen_port: 8080 + elixir_release_cache_directory_mode: 0700 + elixir_release_configuration_directory_mode: 0755 + elixir_release_logs_directory_mode: 0755 + elixir_release_state_directory_mode: 0755 + elixir_release_tmp_directory_mode: 0755 + elixir_release_sudoers_file: "{{ elixir_release_app_user }}-{{ elixir_release_service_name }}" + # Location of source app, assuming that the deploy scripts are in a separate repo in a parallel dir + elixir_release_src_dir: "{{ playbook_dir }}/../../../foo" + roles: + - cogini.elixir-release +``` # Role Variables diff --git a/ansible/roles.galaxy/cogini.elixir-release/meta/.galaxy_install_info b/ansible/roles.galaxy/cogini.elixir-release/meta/.galaxy_install_info index 2027c8f..20c66ab 100644 --- a/ansible/roles.galaxy/cogini.elixir-release/meta/.galaxy_install_info +++ b/ansible/roles.galaxy/cogini.elixir-release/meta/.galaxy_install_info @@ -1,2 +1,2 @@ -install_date: Wed Nov 27 01:36:02 2019 +install_date: 'Fri 06 Oct 2023 03:48:58 AM ' version: master diff --git a/ansible/roles.galaxy/cogini.elixir-release/tasks/deploy.yml b/ansible/roles.galaxy/cogini.elixir-release/tasks/deploy.yml index 9744297..90f5134 100644 --- a/ansible/roles.galaxy/cogini.elixir-release/tasks/deploy.yml +++ b/ansible/roles.galaxy/cogini.elixir-release/tasks/deploy.yml @@ -6,7 +6,7 @@ - name: Set vars set_fact: # Location on local filesystem of release files - elixir_release_local_dir: "{{ elixir_release_src_dir }}/_build/{{ elixir_release_mix_env }}/rel/{{ elixir_release_app_name }}/releases" + elixir_release_local_dir: "{{ elixir_release_src_dir }}/_build/{{ elixir_release_mix_env }}/rel/{{ elixir_release_release_name }}/releases" # Name of target dir elixir_release_timestamp: "{{ ansible_date_time['iso8601_basic_short'] }}" diff --git a/ansible/roles.galaxy/cogini.elixir-release/tasks/main.yml b/ansible/roles.galaxy/cogini.elixir-release/tasks/main.yml index a21700a..09e78c4 100644 --- a/ansible/roles.galaxy/cogini.elixir-release/tasks/main.yml +++ b/ansible/roles.galaxy/cogini.elixir-release/tasks/main.yml @@ -1,16 +1,16 @@ --- # tasks file for app -- include_tasks: dirs.yml +- import_tasks: dirs.yml tags: ['dirs'] -- include_tasks: systemd.yml +- import_tasks: systemd.yml tags: ['systemd'] -- include_tasks: scripts.yml +- import_tasks: scripts.yml tags: ['scripts'] -# - include_tasks: config.yml +# - import_tasks: config.yml # become: true - import_tasks: deploy.yml diff --git a/ansible/roles.galaxy/cogini.users/meta/.galaxy_install_info b/ansible/roles.galaxy/cogini.users/meta/.galaxy_install_info index eeeb155..19be52f 100644 --- a/ansible/roles.galaxy/cogini.users/meta/.galaxy_install_info +++ b/ansible/roles.galaxy/cogini.users/meta/.galaxy_install_info @@ -1,2 +1,2 @@ -install_date: Tue Jan 14 02:10:27 2020 +install_date: 'Fri 06 Oct 2023 03:48:57 AM ' version: master