diff --git a/defaults/main.yml b/defaults/main.yml index 2267dfe8..863411db 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,14 +2,14 @@ # Basic settings postgresql_version: 9.6 -postgresql_encoding: 'UTF-8' +postgresql_encoding: "UTF-8" postgresql_locale_parts: - - 'en_US' # Locale - - 'UTF-8' # Encoding + - "en_US" # Locale + - "UTF-8" # Encoding postgresql_locale: "{{ postgresql_locale_parts | join('.') }}" postgresql_ctype_parts: - - 'en_US' # Locale - - 'UTF-8' # Encoding + - "en_US" # Locale + - "UTF-8" # Encoding postgresql_ctype: "{{ postgresql_ctype_parts | join('.') }}" postgresql_admin_user: "postgres" @@ -33,8 +33,8 @@ postgresql_ext_postgis_version: "2.1" # be careful: check whether the postgresql postgresql_ext_postgis_deps: - libgeos-c1 - - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" - - "postgresql-{{postgresql_version}}-postgis-scripts" + - "postgresql-{{ postgresql_version }}-postgis-{{ postgresql_ext_postgis_version }}" + - "postgresql-{{ postgresql_version }}-postgis-scripts" # List of databases to be created (optional) postgresql_databases: [] @@ -50,10 +50,10 @@ postgresql_user_privileges: [] # pg_hba.conf postgresql_pg_hba_default: - - { type: local, database: all, user: '{{ postgresql_admin_user }}', address: '', method: '{{ postgresql_default_auth_method }}', comment: '' } - - { type: local, database: all, user: all, address: '', method: '{{ postgresql_default_auth_method }}', comment: '"local" is for Unix domain socket connections only' } - - { type: host, database: all, user: all, address: '127.0.0.1/32', method: '{{ postgresql_default_auth_method }}', comment: 'IPv4 local connections:' } - - { type: host, database: all, user: all, address: '::1/128', method: '{{ postgresql_default_auth_method }}', comment: 'IPv6 local connections:' } + - { type: local, database: all, user: "{{ postgresql_admin_user }}", address: "", method: "{{ postgresql_default_auth_method }}", comment: "" } + - { type: local, database: all, user: all, address: "", method: "{{ postgresql_default_auth_method }}", comment: '"local" is for Unix domain socket connections only' } + - { type: host, database: all, user: all, address: "127.0.0.1/32", method: "{{ postgresql_default_auth_method }}", comment: "IPv4 local connections:" } + - { type: host, database: all, user: all, address: "::1/128", method: "{{ postgresql_default_auth_method }}", comment: "IPv6 local connections:" } postgresql_pg_hba_passwd_hosts: [] postgresql_pg_hba_trust_hosts: [] @@ -67,41 +67,41 @@ postgresql_pg_hba_custom: [] #------------------------------------------------------------------------------ # Location of postgres configuration files here -postgresql_conf_directory: "/etc/postgresql/{{postgresql_version}}/{{postgresql_cluster_name}}" +postgresql_conf_directory: "/etc/postgresql/{{ postgresql_version }}/{{ postgresql_cluster_name }}" # HBA (Host Based Authentication) file -postgresql_hba_file: "{{postgresql_conf_directory}}/pg_hba.conf" +postgresql_hba_file: "{{ postgresql_conf_directory }}/pg_hba.conf" # Ident configuration file -postgresql_ident_file: "{{postgresql_conf_directory}}/pg_ident.conf" +postgresql_ident_file: "{{ postgresql_conf_directory }}/pg_ident.conf" # Use data in another directory postgresql_varlib_directory_name: "postgresql" -postgresql_data_directory: "/var/lib/{{ postgresql_varlib_directory_name }}/{{postgresql_version}}/{{postgresql_cluster_name}}" +postgresql_data_directory: "/var/lib/{{ postgresql_varlib_directory_name }}/{{ postgresql_version }}/{{ postgresql_cluster_name }}" postgresql_pid_directory: "/var/run/postgresql" # If external_pid_file is not explicitly set, on extra PID file is written -postgresql_external_pid_file: "{{ postgresql_pid_directory }}/{{postgresql_version}}-{{postgresql_cluster_name}}.pid" +postgresql_external_pid_file: "{{ postgresql_pid_directory }}/{{ postgresql_version }}-{{ postgresql_cluster_name }}.pid" #------------------------------------------------------------------------------ # CONNECTIONS AND AUTHENTICATION #------------------------------------------------------------------------------ postgresql_listen_addresses: - - localhost + - "localhost" postgresql_port: 5432 postgresql_max_connections: 100 postgresql_superuser_reserved_connections: 3 -postgresql_unix_socket_directory: '' # (<= 9.2) +postgresql_unix_socket_directory: "" # (<= 9.2) postgresql_unix_socket_directories: # (>= 9.3) - "{{ postgresql_pid_directory }}" -postgresql_unix_socket_group: '' -postgresql_unix_socket_permissions: '0777' # begin with 0 to use octal notation +postgresql_unix_socket_group: "" +postgresql_unix_socket_permissions: "0777" # begin with 0 to use octal notation # Automatic pg_ctl configuration. Specify a list of options containing # cluster specific options to be passed to pg_ctl(1). postgresql_pg_ctl_options: [] -postgresql_bonjour: off # advertise server via Bonjour -postgresql_bonjour_name: '' # defaults to the computer name +postgresql_bonjour: off # advertise server via Bonjour +postgresql_bonjour_name: "" # defaults to the computer name # - Security and Authentication - @@ -109,25 +109,25 @@ postgresql_bonjour_name: '' # defaults to the computer name postgresql_authentication_timeout: 60s postgresql_ssl: off postgresql_ssl_ciphers: - - 'DEFAULT' - - '!LOW' - - '!EXP' - - '!MD5' - - '@STRENGTH' + - "DEFAULT" + - "!LOW" + - "!EXP" + - "!MD5" + - "@STRENGTH" postgresql_ssl_prefer_server_ciphers: on -postgresql_ssl_ecdh_curve: 'prime256v1' +postgresql_ssl_ecdh_curve: "prime256v1" postgresql_ssl_renegotiation_limit: 512MB # amount of data between renegotiations -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_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_db_user_namespace: off postgresql_row_security: off # (>= 9.5) # Kerberos and GSSAPI -postgresql_krb_server_keyfile: '' -postgresql_krb_srvname: postgres +postgresql_krb_server_keyfile: "" +postgresql_krb_srvname: "postgres" # (<= 9.3) postgresql_krb_caseins_users: off # TCP Keepalives, 0 selects the system default (in seconds) @@ -143,7 +143,7 @@ postgresql_tcp_keepalives_count: 0 # - Memory - postgresql_shared_buffers: 128MB # min 128kB -postgresql_huge_pages: try # on, off, or try +postgresql_huge_pages: "try" # on, off, or try postgresql_temp_buffers: 8MB # min 800kB # Caution: it is not advisable to set max_prepared_transactions nonzero unless @@ -155,7 +155,7 @@ postgresql_maintenance_work_mem: 16MB # min 1MB postgresql_replacement_sort_tuples: 150000 # (>= 9.6) limits use of replacement selection sort postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem postgresql_max_stack_depth: 2MB # min 100kB -postgresql_dynamic_shared_memory_type: posix # the default is the first option +postgresql_dynamic_shared_memory_type: "posix" # the default is the first option # supported by the operating system: # posix # sysv @@ -210,7 +210,7 @@ postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default i # - Settings - -postgresql_wal_level: minimal # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical +postgresql_wal_level: "minimal" # 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) @@ -229,7 +229,7 @@ postgresql_synchronous_commit: "on" # - fsync # - fsync_writethrough # - open_sync -postgresql_wal_sync_method: fsync +postgresql_wal_sync_method: "fsync" # recover from partial page writes postgresql_full_page_writes: on @@ -258,13 +258,13 @@ postgresql_checkpoint_warning: 30s # 0 disables # - Archiving - # allows archiving to be done -postgresql_archive_mode: off +postgresql_archive_mode: off # Should be a string with quotes, but all templates need fixing first # 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' -postgresql_archive_command: '' +postgresql_archive_command: "" # force a logfile segment switch after this postgresql_archive_timeout: 0 @@ -295,7 +295,7 @@ postgresql_track_commit_timestamp: off # (>= 9.5) # standby servers that provide sync rep. # number of sync standbys (>= 9.6) and comma-separated list of application_name from standby(s) -postgresql_synchronous_standby_num_sync: '' +postgresql_synchronous_standby_num_sync: "" postgresql_synchronous_standby_names: [] # '*' means 'all' # number of xacts by which cleanup is delayed @@ -364,12 +364,12 @@ postgresql_geqo_seed: 0.0 # range 0.0-1.0 # - Other Planner Options - -postgresql_default_statistics_target: 100 # range 1-10000 -postgresql_constraint_exclusion: partition # on, off, or partition -postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0 +postgresql_default_statistics_target: 100 # range 1-10000 +postgresql_constraint_exclusion: "partition" # on, off, or partition +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 # (>= 9.6) +postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit +postgresql_force_parallel_mode: "off" # (>= 9.6) #------------------------------------------------------------------------------ @@ -380,7 +380,7 @@ postgresql_force_parallel_mode: off # (>= 9.6) # Valid values are combinations of stderr, csvlog, syslog, and eventlog. # depending on platform. Csvlog requires logging_collector to be on. -postgresql_log_destination: stderr +postgresql_log_destination: "stderr" # Enable capturing of stderr and csvlog into log files. # Required to be on for csvlogs. @@ -389,10 +389,10 @@ postgresql_logging_collector: off # These are only used if logging_collector is on: # Directory where log files are written, can be absolute or relative to PGDATA -postgresql_log_directory: pg_log +postgresql_log_directory: "pg_log" # Log file name pattern, can include strftime() escapes -postgresql_log_filename: postgresql-%Y-%m-%d_%H%M%S.log -postgresql_log_file_mode: '0600' # begin with 0 to use octal notation +postgresql_log_filename: "postgresql-%Y-%m-%d_%H%M%S.log" +postgresql_log_file_mode: "0600" # begin with 0 to use octal notation # 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 @@ -404,12 +404,13 @@ postgresql_log_rotation_age: 1d postgresql_log_rotation_size: 10MB # These are relevant when logging to syslog: -postgresql_syslog_facility: LOCAL0 -postgresql_syslog_ident: postgres +postgresql_syslog_facility: "LOCAL0" +postgresql_syslog_ident: "postgres" +silent_mode: off # (<= 9.1) postgresql_syslog_sequence_numbers: on # (>= 9.6) postgresql_syslog_split_messages: on # (>= 9.6) # This is only relevant when logging to eventlog (win32) (>= 9.2): -postgresql_event_source: PostgreSQL +postgresql_event_source: "PostgreSQL" # - When to Log - @@ -424,7 +425,7 @@ postgresql_event_source: PostgreSQL # - notice # - warning # - error -postgresql_client_min_messages: notice +postgresql_client_min_messages: "notice" # Values in order of decreasing detail: # - debug5 @@ -439,7 +440,7 @@ postgresql_client_min_messages: notice # - log # - fatal # - panic -postgresql_log_min_messages: warning +postgresql_log_min_messages: "warning" # Values in order of decreasing detail: # - debug5 @@ -454,7 +455,7 @@ postgresql_log_min_messages: warning # - log # - fatal # - panic (effectively off) -postgresql_log_min_error_statement: error +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 @@ -471,7 +472,7 @@ postgresql_log_checkpoints: off postgresql_log_connections: off postgresql_log_disconnections: off postgresql_log_duration: off -postgresql_log_error_verbosity: default # terse, default, or verbose messages +postgresql_log_error_verbosity: "default" # terse, default, or verbose messages postgresql_log_hostname: off # Special values: @@ -494,14 +495,15 @@ postgresql_log_hostname: off # %q = stop here in non-session # processes # %% = '%' -postgresql_log_line_prefix: '%t ' +postgresql_log_line_prefix: "%t " # log lock waits >= deadlock_timeout postgresql_log_lock_waits: off -postgresql_log_statement: none # none, ddl, mod, all +postgresql_log_statement: "none" # none, ddl, mod, all +postgresql_log_replication_commands: off # log temporary files equal or larger postgresql_log_temp_files: -1 -postgresql_log_timezone: UTC +postgresql_log_timezone: "UTC" #------------------------------------------------------------------------------ @@ -513,10 +515,10 @@ postgresql_log_timezone: UTC postgresql_track_activities: on postgresql_track_counts: on postgresql_track_io_timing: off # (>= 9.2) -postgresql_track_functions: none # none, pl, all +postgresql_track_functions: "none" # none, pl, all postgresql_track_activity_query_size: 1024 postgresql_update_process_title: on -postgresql_stats_temp_directory: pg_stat_tmp +postgresql_stats_temp_directory: "pg_stat_tmp" # - Statistics Monitoring - @@ -566,15 +568,15 @@ postgresql_autovacuum_vacuum_cost_limit: -1 postgresql_search_path: # schema names - '"$user"' - - public -postgresql_default_tablespace: '' # a tablespace name, '' uses the default + - "public" +postgresql_default_tablespace: "" # a tablespace name, "" uses the default postgresql_temp_tablespaces: [] # a list of tablespace names postgresql_check_function_bodies: on -postgresql_default_transaction_isolation: read committed +postgresql_default_transaction_isolation: "read committed" postgresql_default_transaction_read_only: off postgresql_default_transaction_deferrable: off -postgresql_session_replication_role: origin +postgresql_session_replication_role: "origin" postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3) @@ -584,26 +586,27 @@ postgresql_vacuum_freeze_table_age: 150000000 postgresql_vacuum_multixact_freeze_min_age: 5000000 # (>= 9.3) 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_bytea_output: "hex" # hex, escape +postgresql_xmlbinary: "base64" +postgresql_xmloption: "content" +postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2) +postgresql_gin_pending_list_limit: 4MB # (>= 9.5) # - Locale and Formatting - postgresql_datestyle: - - iso - - mdy -postgresql_intervalstyle: postgres -postgresql_timezone: UTC + - "iso" + - "mdy" +postgresql_intervalstyle: "postgres" +postgresql_timezone: "UTC" # Select the set of available time zone abbreviations. Currently, there are: # Default # Australia # India # You can create your own file in `share/timezonesets/`. -postgresql_timezone_abbreviations: Default +postgresql_timezone_abbreviations: "Default" postgresql_extra_float_digits: 0 # min -15, max 3 postgresql_client_encoding: False # actually defaults to database encoding @@ -620,9 +623,9 @@ postgresql_lc_numeric: "{{ postgresql_locale }}" # locale for time formatting postgresql_lc_time: "{{ postgresql_locale }}" -postgresql_default_text_search_config: pg_catalog.english +postgresql_default_text_search_config: "pg_catalog.english" -postgresql_dynamic_library_path: '$libdir' +postgresql_dynamic_library_path: "$libdir" postgresql_local_preload_libraries: [] postgresql_session_preload_libraries: [] @@ -647,10 +650,11 @@ postgresql_max_pred_locks_per_transaction: 64 # min 10 # - Previous PostgreSQL Versions - postgresql_array_nulls: on -postgresql_backslash_quote: safe_encoding # on, off, or safe_encoding +postgresql_backslash_quote: "safe_encoding" # on, off, or safe_encoding postgresql_default_with_oids: off postgresql_escape_string_warning: on postgresql_lo_compat_privileges: off +postgresql_operator_precedence_warning: off # (>= 9.5) postgresql_quote_all_identifiers: off postgresql_sql_inheritance: on postgresql_standard_conforming_strings: on @@ -662,6 +666,16 @@ postgresql_synchronize_seqscans: on postgresql_transform_null_equals: off +#------------------------------------------------------------------------------ +# CONFIG FILE INCLUDES +#------------------------------------------------------------------------------ + +# These options allow settings to be loaded from files other than the +# default postgresql.conf. +postgresql_include_dir: "conf.d" # (>= 9.3) +postgresql_include_if_exists: "exists.conf" # (>= 9.3) +postgresql_include: "special.conf" # (>= 9.3) + #------------------------------------------------------------------------------ # ERROR HANDLING #------------------------------------------------------------------------------ @@ -672,6 +686,13 @@ postgresql_exit_on_error: off postgresql_restart_after_crash: on +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +postgresql_custom_variable_classes: "" # (<= 9.1) + + #------------------------------------------------------------------------------ # PGTUNE #------------------------------------------------------------------------------ @@ -680,7 +701,7 @@ postgresql_pgtune: no # Total system memory in bytes, will attempt to detect if set to "no" postgresql_pgtune_memory: no # Database type, valid options are DW, OLTP, Web, Mixed, Desktop -postgresql_pgtune_type: Mixed +postgresql_pgtune_type: "Mixed" # Maximum number of expected connections, if "no", default based on db type postgresql_pgtune_connections: no @@ -692,9 +713,9 @@ postgresql_env: LC_LCTYPE: "{{ postgresql_locale }}" # APT settings -postgresql_apt_key_id: ACCC4CF8 +postgresql_apt_key_id: "ACCC4CF8" postgresql_apt_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" -postgresql_apt_repository: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main {{postgresql_version}}' +postgresql_apt_repository: "deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main {{ postgresql_version }}" # Pin-Priority of PGDG repository postgresql_apt_pin_priority: 500 @@ -744,4 +765,4 @@ postgresql_yum_repository_url: "{{ postgresql_yum_repository_base_url }}/{{ post postgresql_apt_py3_dependencies: ["python3-psycopg2", "locales"] postgresql_apt_py2_dependencies: ["python-psycopg2", "python-pycurl", "locales"] -postgresql_apt_dependencies: "{{postgresql_apt_py3_dependencies if 'python3' in ansible_python_interpreter|default('') else postgresql_apt_py2_dependencies}}" +postgresql_apt_dependencies: "{{ postgresql_apt_py3_dependencies if 'python3' in ansible_python_interpreter|default('') else postgresql_apt_py2_dependencies }}" diff --git a/meta/main.yml b/meta/main.yml index 071ea902..768e4fdd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,11 +7,30 @@ galaxy_info: min_ansible_version: 2.4.0 license: MIT platforms: + - name: Debian + versions: + - jessie + - stretch - name: Ubuntu versions: - - all + - xenial + - trusty + - name: EL + versions: + - 6 + - 7 categories: - database - database:sql + galaxy_tags: + - postgresql + - postgres + - sql + - database + - postgis + - debian + - ubuntu + - centos + - redhat dependencies: [] diff --git a/tasks/databases.yml b/tasks/databases.yml index e73de3d3..edb58452 100644 --- a/tasks/databases.yml +++ b/tasks/databases.yml @@ -22,14 +22,15 @@ when: postgresql_databases|length > 0 - name: PostgreSQL | Add extensions to the databases - shell: "psql {{item.0.db}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS {{ item.1 }};'" - become: yes - become_user: "{{postgresql_service_user}}" + postgresql_ext: + db: "{{ item.0.db }}" + login_user: "{{ postgresql_service_user }}" + port: "{{ postgresql_port }}" + name: "{{ item.1 }}" with_subelements: - - "{{postgresql_database_extensions}}" + - "{{ postgresql_database_extensions }}" - extensions register: result - changed_when: "'NOTICE' not in result.stderr" - name: PostgreSQL | Add hstore to the databases with the requirement become: yes diff --git a/templates/crosscheck_parameters.sh b/templates/crosscheck_parameters.sh new file mode 100755 index 00000000..d43b9cbe --- /dev/null +++ b/templates/crosscheck_parameters.sh @@ -0,0 +1,47 @@ +#!/bin/bash - + +# +# Identify a unique filename +# +TEMP_FILE=/tmp/`basename $0`.$$ + +# +# Loop through all postgresql.conf.orig files, and compare them to the j2 files +# +for FILE in postgresql.conf-[0-9]*\.orig; do + # + # Extract the base filename, removing ".orig" + # + BASE_FILE="`echo $FILE | sed s/\.orig\$//`" + + # + # If we crash, then cleanup + # + trap 'rm -f ${TEMP_FILE}.orig ${TEMP_FILE}.j2 ${TEMP_FILE}.defaults' 0 + + # + # Extract a unique, sorted list of the parameter names + # + cat ${BASE_FILE}.orig | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMP_FILE}.orig + cat ${BASE_FILE}.j2 | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMP_FILE}.j2 + cat ../defaults/main.yml | sed s/\#// | grep ^[a-z] | cut -f1 -d':' | sed s/^postgresql_// | sort | uniq > ${TEMP_FILE}.defaults + + # + # Output a comparision + # + echo ================================================================================ + echo ${BASE_FILE}.orig ${BASE_FILE}.j2 + diff ${TEMP_FILE}.orig ${TEMP_FILE}.j2 && echo All parameters exist in both files + echo -------------------------------------------------------------------------------- + echo ${BASE_FILE}.defaults ${BASE_FILE}.j2 + cat ${TEMP_FILE}.j2 | while read PARAM; do + grep ^postgresql_${PARAM}: ../defaults/main.yml > /dev/null 2>&1 || echo "Missing $PARAM in ../defaults/main.yml" + done + echo ================================================================================ + echo + + # + # Cleanup + # + rm -f ${TEMP_FILE}.orig ${TEMP_FILE}.j2 ${TEMP_FILE}.defaults +done diff --git a/templates/postgresql.conf-9.3.j2 b/templates/postgresql.conf-9.3.j2 index 9896f7c9..28cb1e74 100644 --- a/templates/postgresql.conf-9.3.j2 +++ b/templates/postgresql.conf-9.3.j2 @@ -501,6 +501,7 @@ vacuum_multixact_freeze_table_age = {{postgresql_vacuum_multixact_freeze_table_a 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 - diff --git a/templates/postgresql.conf-9.3.orig b/templates/postgresql.conf-9.3.orig index 18196f8c..0bc9c098 100644 --- a/templates/postgresql.conf-9.3.orig +++ b/templates/postgresql.conf-9.3.orig @@ -81,7 +81,7 @@ #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_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) @@ -500,6 +500,7 @@ #bytea_output = 'hex' # hex, escape #xmlbinary = 'base64' #xmloption = 'content' +#gin_fuzzy_search_limit = 0 # - Locale and Formatting - diff --git a/templates/postgresql.conf-9.4.j2 b/templates/postgresql.conf-9.4.j2 index b2de2ad4..e66f747c 100644 --- a/templates/postgresql.conf-9.4.j2 +++ b/templates/postgresql.conf-9.4.j2 @@ -518,6 +518,7 @@ vacuum_multixact_freeze_table_age = {{postgresql_vacuum_multixact_freeze_table_a 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 - diff --git a/templates/postgresql.conf-9.4.orig b/templates/postgresql.conf-9.4.orig index 8dfd485e..107fe622 100644 --- a/templates/postgresql.conf-9.4.orig +++ b/templates/postgresql.conf-9.4.orig @@ -83,7 +83,7 @@ # (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_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) @@ -517,6 +517,7 @@ #bytea_output = 'hex' # hex, escape #xmlbinary = 'base64' #xmloption = 'content' +#gin_fuzzy_search_limit = 0 # - Locale and Formatting - diff --git a/templates/postgresql.conf-9.5.j2 b/templates/postgresql.conf-9.5.j2 index 41c88262..ae866616 100644 --- a/templates/postgresql.conf-9.5.j2 +++ b/templates/postgresql.conf-9.5.j2 @@ -437,12 +437,20 @@ log_line_prefix = '{{postgresql_log_line_prefix}}' # special values: # 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'}} + + #------------------------------------------------------------------------------ # RUNTIME STATISTICS #------------------------------------------------------------------------------ @@ -454,7 +462,6 @@ 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}}' @@ -522,6 +529,8 @@ vacuum_multixact_freeze_table_age = {{postgresql_vacuum_multixact_freeze_table_a 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 - @@ -585,6 +594,7 @@ 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'}} +operator_precedence_warning = {{'on' if postgresql_operator_precedence_warning 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'}} diff --git a/templates/postgresql.conf-9.6.j2 b/templates/postgresql.conf-9.6.j2 index 801de26d..13987b0f 100644 --- a/templates/postgresql.conf-9.6.j2 +++ b/templates/postgresql.conf-9.6.j2 @@ -451,12 +451,20 @@ log_line_prefix = '{{postgresql_log_line_prefix}}' # special values: # 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'}} + + #------------------------------------------------------------------------------ # RUNTIME STATISTICS #------------------------------------------------------------------------------ @@ -468,7 +476,6 @@ 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}}' @@ -537,6 +544,8 @@ vacuum_multixact_freeze_table_age = {{postgresql_vacuum_multixact_freeze_table_a 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 - @@ -597,6 +606,7 @@ 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'}} +operator_precedence_warning = {{'on' if postgresql_operator_precedence_warning 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'}} diff --git a/templates/postgresql.conf-9.6.orig b/templates/postgresql.conf-9.6.orig index ed81e64c..acfaa2d8 100644 --- a/templates/postgresql.conf-9.6.orig +++ b/templates/postgresql.conf-9.6.orig @@ -156,7 +156,7 @@ #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 multiplier on buffers scanned/round -#bgwriter_flush_after = 0 # 0 disables, +#bgwriter_flush_after = 512kB # 0 disables, # default is 512kB on linux, 0 otherwise # - Asynchronous Behavior - @@ -207,7 +207,7 @@ #max_wal_size = 1GB #min_wal_size = 80MB #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -#checkpoint_flush_after = 0 # 0 disables, +#checkpoint_flush_after = 256kB # 0 disables, # default is 256kB on linux, 0 otherwise #checkpoint_warning = 30s # 0 disables diff --git a/tests/docker/group_vars/postgresql.yml b/tests/docker/group_vars/postgresql.yml index 294b2f9c..23cf407a 100644 --- a/tests/docker/group_vars/postgresql.yml +++ b/tests/docker/group_vars/postgresql.yml @@ -26,3 +26,10 @@ postgresql_ext_install_contrib: true postgresql_ssl: false postgresql_pgtune: false postgresql_ext_install_postgis: false + +postgresql_database_extensions: + - db: foobar + extensions: + - adminpack + - pgcrypto + - unaccent