From 14ccfbe8092444ed50b79c8ec051f6abda9e0fc1 Mon Sep 17 00:00:00 2001 From: Leochocolat Date: Mon, 11 Dec 2023 10:20:52 +0100 Subject: [PATCH] Add yamllint & Fix yamllint errors & Update version & Add maintainer --- .yamllint | 35 +++++++++++++++++++++ README.md | 1 + defaults/main.yml | 48 ++--------------------------- tasks/extensions/dev_headers.yml | 4 +-- tasks/extensions/extra_packages.yml | 8 ++--- tests/playbook.yml | 1 - tests/prepare.yml | 2 +- tests/vars.CentOS.7.yml | 2 +- tests/vars.CentOS.8.yml | 2 +- tests/vars.Debian.10.yml | 2 +- tests/vars.Debian.9.yml | 2 +- tests/vars.Debian.yml | 2 +- tests/vars.Fedora.37.yml | 2 +- tests/vars.Ubuntu.18.yml | 2 +- tests/vars.Ubuntu.20.yml | 2 +- vars/Debian_22.yml | 3 +- version | 2 +- 17 files changed, 55 insertions(+), 65 deletions(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000..748379589 --- /dev/null +++ b/.yamllint @@ -0,0 +1,35 @@ +--- + +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +rules: + braces: disable + brackets: disable + colons: disable + commas: disable + comments: disable + comments-indentation: disable + document-end: disable + document-start: disable + empty-lines: + max: 1 + max-start: 1 + max-end: 1 + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + hyphens: + max-spaces-after: 1 + indentation: disable + key-duplicates: disable + key-ordering: disable + line-length: disable + new-line-at-end-of-file: enable + new-lines: disable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: disable diff --git a/README.md b/README.md index 282321ea9..c1c886b60 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,7 @@ Maintainers: - [Greg Clough](https://github.com/gclough) - [Magnus Lübeck](https://github.com/maglub) - [Leo C.](https://github.com/MrMegaNova) +- [Laurent Lavaud](https://github.com/fidelio33b) Top Contributors: - [David Farrington](https://github.com/farridav) diff --git a/defaults/main.yml b/defaults/main.yml index f113ebb7a..7d362cb74 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -179,13 +179,11 @@ postgresql_ssl_ca_file: "" # (>= 9.2) postgresql_ssl_crl_file: "" # (>= 9.2) postgresql_ssl_crl_dir: "" # (>= 14) - #------------------------------------------------------------------------------ # RESOURCE USAGE (except WAL) #------------------------------------------------------------------------------ # - Memory - - postgresql_shared_buffers: 128MB # min 128kB postgresql_huge_pages: "try" # on, off, or try postgresql_huge_page_size: 0 # (>= 14) @@ -234,7 +232,7 @@ postgresql_vacuum_cost_limit: 200 # 1-10000 credits postgresql_bgwriter_delay: 200ms # 10-10000ms between rounds postgresql_bgwriter_lru_maxpages: 100 # 0-1000 max buffers written/round postgresql_bgwriter_lru_multiplier: 2.0 # 0-10.0 multiplier on buffers scanned/round -postgresql_bgwriter_flush_after: 512kB # measured in pages, 0 disables +postgresql_bgwriter_flush_after: 512kB # measured in pages, 0 disables # - Asynchronous Behavior - @@ -249,7 +247,6 @@ postgresql_parallel_leader_participation: on # (>= 11) postgresql_old_snapshot_threshold: -1 # (>= 9.6) 1min-60d; -1 disables; 0 is immediate # (change requires restart) - #------------------------------------------------------------------------------ # WRITE-AHEAD LOG #------------------------------------------------------------------------------ @@ -276,9 +273,7 @@ postgresql_wal_skip_threshold: 2MB # (>= 13) postgresql_commit_delay: 0 # range 0-100000, in microseconds postgresql_commit_siblings: 5 # range 1-1000 - # - Checkpoints - - postgresql_max_wal_size: 1GB # (>= 9.5) postgresql_min_wal_size: 80MB # (>= 9.5) postgresql_checkpoint_flush_after: 0 # (>= 9.6) 0 disables, @@ -288,12 +283,10 @@ postgresql_checkpoint_completion_target: 0.5 # checkpoint target duration, 0.0 postgresql_checkpoint_warning: 30s # 0 disables # - Prefetching during recovery - - postgresql_recovery_prefetch: try # (>= 15) postgresql_wal_decode_buffer_size: 512kB # (>= 15) # - Archiving - - postgresql_archive_mode: "off" postgresql_archive_library: "" # (>= 15) # Command to use to archive a logfile segment. @@ -305,17 +298,13 @@ postgresql_archive_command: "" postgresql_archive_timeout: 0 # - Archive Recovery - - # These are only used in recovery mode. - postgresql_restore_command: "" # (>= 12) postgresql_archive_cleanup_command: "" # (>= 12) postgresql_recovery_end_command: "" # (>= 12) # - Recovery Target - - # Set these only when performing a targeted recovery. - postgresql_recovery_target: "" # (>= 12) postgresql_recovery_target_name: "" # (>= 12) postgresql_recovery_target_time: "" # (>= 12) @@ -325,15 +314,11 @@ postgresql_recovery_target_inclusive: "" # (>= 12) postgresql_recovery_target_timeline: "latest" # (>= 12) postgresql_recovery_target_action: "pause" # (>= 12) - #------------------------------------------------------------------------------ # REPLICATION #------------------------------------------------------------------------------ - # - Sending Servers - - # Set these on the primary and on any standby that will send replication data. - # max number of walsender processes postgresql_max_wal_senders: 10 postgresql_max_replication_slots: 0 # max number of replication slots @@ -346,9 +331,7 @@ postgresql_wal_sender_timeout: 60s # in milliseconds; 0 disables (>= 9.3) postgresql_track_commit_timestamp: off # (>= 9.5) # - Primary Server - - # These settings are ignored on a standby server. - # 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_names: [] # '*' means 'all' @@ -358,9 +341,7 @@ postgresql_synchronous_standby_choose_sync: "FIRST" # >= 10 postgresql_vacuum_defer_cleanup_age: 0 # - Standby Servers - - # These settings are ignored on a primary server. - postgresql_primary_conninfo: "" # (>= 12) postgresql_primary_slot_name: "" # (>= 12) postgresql_promote_trigger_file: "" # (>= 12) @@ -382,20 +363,15 @@ postgresql_wal_retrieve_retry_interval: 5s # (>= 9.5) postgresql_recovery_min_apply_delay: 0 # (>= 12) # - Subscribers - (>= 10) - # These settings are ignored on a publisher. - postgresql_max_logical_replication_workers: 4 # (>= 10) taken from max_worker_processes # (change requires restart) postgresql_max_sync_workers_per_subscription: 2 # (>= 10) taken from max_logical_replication_workers - #------------------------------------------------------------------------------ # QUERY TUNING #------------------------------------------------------------------------------ - # - Planner Method Configuration - - postgresql_enable_async_append: on # (>= 14) postgresql_enable_bitmapscan: on postgresql_enable_gathermerge: on # (>= 14) @@ -418,7 +394,6 @@ postgresql_enable_sort: on postgresql_enable_tidscan: on # - Planner Cost Constants - - postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale postgresql_random_page_cost: 4.0 # same scale as above postgresql_cpu_tuple_cost: 0.01 # same scale as above @@ -436,7 +411,6 @@ postgresql_jit_inline_above_cost: 500000 # inline small functions if query postgresql_jit_optimize_above_cost: 500000 # use expensive JIT optimizations if # - Genetic Query Optimizer - - postgresql_geqo: on postgresql_geqo_threshold: 12 postgresql_geqo_effort: 5 # range 1-10 @@ -445,9 +419,7 @@ postgresql_geqo_generations: 0 # selects default based on effort postgresql_geqo_selection_bias: 2.0 # range 1.5-2.0 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 @@ -458,13 +430,10 @@ postgresql_force_parallel_mode: off # on, off, regress (>= 9.6 < postgresql_plan_cache_mode: "auto" # (>= 12) postgresql_recursive_worktable_factor: 10.0 # (>= 15) range 0.001-1000000 - #------------------------------------------------------------------------------ # REPORTING AND LOGGING #------------------------------------------------------------------------------ - # - Where to Log - - # Valid values are combinations of stderr, csvlog, syslog, and eventlog. # depending on platform. Csvlog requires logging_collector to be on. postgresql_log_destination: "stderr" @@ -498,7 +467,6 @@ postgresql_syslog_split_messages: on # (>= 9.6) # This is only relevant when logging to eventlog (win32) (>= 9.2): postgresql_event_source: "PostgreSQL" - # - When to Log - # Values in order of decreasing detail: @@ -589,14 +557,12 @@ postgresql_log_replication_commands: off postgresql_log_temp_files: -1 postgresql_log_timezone: "UTC" - #------------------------------------------------------------------------------ # PROCESS TITLE #------------------------------------------------------------------------------ postgresql_update_process_title: on # (>= 9.2) - #------------------------------------------------------------------------------ # STATISTICS #------------------------------------------------------------------------------ @@ -612,16 +578,13 @@ postgresql_track_functions: "none" # none, pl, all postgresql_stats_fetch_consistency: cache # (>= 15) postgresql_stats_temp_directory: "pg_stat_tmp" # (<= 14) - # - Monitoring - - postgresql_compute_query_id: auto # (>= 14) auto, on, off postgresql_log_parser_stats: off postgresql_log_planner_stats: off postgresql_log_executor_stats: off postgresql_log_statement_stats: off - #------------------------------------------------------------------------------ # AUTOVACUUM #------------------------------------------------------------------------------ @@ -653,7 +616,6 @@ postgresql_autovacuum_vacuum_cost_delay: 2ms # (<= 11: 20ms, >=12 2ms) # default vacuum cost limit for autovacuum, postgresql_autovacuum_vacuum_cost_limit: -1 - #------------------------------------------------------------------------------ # CLIENT CONNECTION DEFAULTS #------------------------------------------------------------------------------ @@ -746,11 +708,10 @@ postgresql_jit_provider: "llvmjit" # - Other Defaults - postgresql_dynamic_library_path: "$libdir" -postgresql_extension_destdir: "" # (>= 14) +postgresql_extension_destdir: "" # (>= 14) postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2) - #------------------------------------------------------------------------------ # LOCK MANAGEMENT #------------------------------------------------------------------------------ @@ -768,7 +729,6 @@ postgresql_max_pred_locks_per_relation: -2 # (>= 10) negative values mean # / -max_pred_locks_per_relation) - 1 postgresql_max_pred_locks_per_page: 2 # (>= 10) min 0 - #------------------------------------------------------------------------------ # VERSION AND PLATFORM COMPATIBILITY #------------------------------------------------------------------------------ @@ -790,7 +750,6 @@ postgresql_sql_inheritance: on # (<= 9.6) postgresql_transform_null_equals: off - #------------------------------------------------------------------------------ # ERROR HANDLING #------------------------------------------------------------------------------ @@ -803,7 +762,6 @@ postgresql_restart_after_crash: on postgresql_data_sync_retry: off postgresql_recovery_init_sync_method: fsync #(>= 14) fsync, syncfs (Linux 5.8+) - #------------------------------------------------------------------------------ # CONFIG FILE INCLUDES #------------------------------------------------------------------------------ @@ -816,7 +774,6 @@ postgresql_include_if_exists: false # include file postgresql_include: false - #------------------------------------------------------------------------------ # PGTUNE #------------------------------------------------------------------------------ @@ -829,7 +786,6 @@ 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/tasks/extensions/dev_headers.yml b/tasks/extensions/dev_headers.yml index 5cfb70a06..343a51bd6 100644 --- a/tasks/extensions/dev_headers.yml +++ b/tasks/extensions/dev_headers.yml @@ -11,11 +11,11 @@ - restart postgresql - name: PostgreSQL | Extensions | Make sure the development headers are installed | RedHat - yum: + yum: name: - "postgresql{{ postgresql_version_terse }}-libs" - "postgresql{{ postgresql_version_terse }}-devel" - state: present + state: present update_cache: yes when: ansible_pkg_mgr == "yum" and ansible_os_family == "RedHat" notify: diff --git a/tasks/extensions/extra_packages.yml b/tasks/extensions/extra_packages.yml index efa59cf2a..6973136bd 100644 --- a/tasks/extensions/extra_packages.yml +++ b/tasks/extensions/extra_packages.yml @@ -20,7 +20,7 @@ repo: "{{ item.value }}" state: present loop: "{{ postgresql_ext_extra_packages.apt_repositories | default({}) | dict2items }}" - when: + when: - postgresql_ext_extra_packages is defined - ansible_os_family == "Debian" - name: PostgreSQL | Extensions | Add repos | RHEL @@ -31,7 +31,7 @@ gpgkey: "{{ item.value.gpgkey }}" enabled: yes loop: "{{ postgresql_ext_extra_packages.yum_repositories | default({}) | dict2items }}" - when: + when: - postgresql_ext_extra_packages is defined - ansible_os_family == "RedHat" @@ -42,7 +42,7 @@ state: present update_cache: yes cache_valid_time: "{{ apt_cache_valid_time | default (3600) }}" - when: + when: - postgresql_ext_extra_packages is defined - ansible_os_family == "Debian" - name: PostgreSQL | Extensions | Add packages | RHEL @@ -50,6 +50,6 @@ name: "{{ postgresql_ext_extra_packages.names }}" state: present update_cache: yes - when: + when: - postgresql_ext_extra_packages is defined - ansible_os_family == "RedHat" diff --git a/tests/playbook.yml b/tests/playbook.yml index 01e19d292..07ad2478a 100644 --- a/tests/playbook.yml +++ b/tests/playbook.yml @@ -7,4 +7,3 @@ - ./vars.{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yml roles: - postgresql - diff --git a/tests/prepare.yml b/tests/prepare.yml index 48e7cf9bf..65a564e83 100644 --- a/tests/prepare.yml +++ b/tests/prepare.yml @@ -72,4 +72,4 @@ retries: 30 delay: 5 when: (ansible_distribution == 'Fedora') - changed_when: false \ No newline at end of file + changed_when: false diff --git a/tests/vars.CentOS.7.yml b/tests/vars.CentOS.7.yml index fb25db6b0..9cbf06919 100644 --- a/tests/vars.CentOS.7.yml +++ b/tests/vars.CentOS.7.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python" diff --git a/tests/vars.CentOS.8.yml b/tests/vars.CentOS.8.yml index ab00d6d9b..ccf006385 100644 --- a/tests/vars.CentOS.8.yml +++ b/tests/vars.CentOS.8.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python3" diff --git a/tests/vars.Debian.10.yml b/tests/vars.Debian.10.yml index ab00d6d9b..ccf006385 100644 --- a/tests/vars.Debian.10.yml +++ b/tests/vars.Debian.10.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python3" diff --git a/tests/vars.Debian.9.yml b/tests/vars.Debian.9.yml index fb25db6b0..9cbf06919 100644 --- a/tests/vars.Debian.9.yml +++ b/tests/vars.Debian.9.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python" diff --git a/tests/vars.Debian.yml b/tests/vars.Debian.yml index fb25db6b0..9cbf06919 100644 --- a/tests/vars.Debian.yml +++ b/tests/vars.Debian.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python" diff --git a/tests/vars.Fedora.37.yml b/tests/vars.Fedora.37.yml index ab00d6d9b..ccf006385 100644 --- a/tests/vars.Fedora.37.yml +++ b/tests/vars.Fedora.37.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python3" diff --git a/tests/vars.Ubuntu.18.yml b/tests/vars.Ubuntu.18.yml index ab00d6d9b..ccf006385 100644 --- a/tests/vars.Ubuntu.18.yml +++ b/tests/vars.Ubuntu.18.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python3" diff --git a/tests/vars.Ubuntu.20.yml b/tests/vars.Ubuntu.20.yml index ab00d6d9b..ccf006385 100644 --- a/tests/vars.Ubuntu.20.yml +++ b/tests/vars.Ubuntu.20.yml @@ -1,3 +1,3 @@ --- #--- picking the correct python interpreter -ansible_python_interpreter: "/usr/bin/python3" \ No newline at end of file +ansible_python_interpreter: "/usr/bin/python3" diff --git a/vars/Debian_22.yml b/vars/Debian_22.yml index 6bd6082af..72871d6c3 100644 --- a/vars/Debian_22.yml +++ b/vars/Debian_22.yml @@ -1,4 +1,3 @@ --- # PostgreSQL vars for Debian based distributions - -postgresql_apt_repository: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main {{ postgresql_version }}" \ No newline at end of file +postgresql_apt_repository: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main {{ postgresql_version }}" diff --git a/version b/version index 471578389..440ddd8f1 100644 --- a/version +++ b/version @@ -1 +1 @@ -v1.14.2 +v1.15.0