Skip to content

Commit

Permalink
Add yamllint & Fix yamllint errors & Update version & Add maintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMegaNova committed Dec 11, 2023
1 parent a923a71 commit 14ccfbe
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 65 deletions.
35 changes: 35 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
48 changes: 2 additions & 46 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 -

Expand All @@ -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
#------------------------------------------------------------------------------
Expand All @@ -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,
Expand All @@ -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.
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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'
Expand 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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
#------------------------------------------------------------------------------
Expand All @@ -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
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -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
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -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
#------------------------------------------------------------------------------
Expand All @@ -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
#------------------------------------------------------------------------------
Expand All @@ -790,7 +750,6 @@ postgresql_sql_inheritance: on # (<= 9.6)

postgresql_transform_null_equals: off


#------------------------------------------------------------------------------
# ERROR HANDLING
#------------------------------------------------------------------------------
Expand All @@ -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
#------------------------------------------------------------------------------
Expand All @@ -816,7 +774,6 @@ postgresql_include_if_exists: false
# include file
postgresql_include: false


#------------------------------------------------------------------------------
# PGTUNE
#------------------------------------------------------------------------------
Expand All @@ -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
#------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tasks/extensions/dev_headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tasks/extensions/extra_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand All @@ -42,14 +42,14 @@
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
yum:
name: "{{ postgresql_ext_extra_packages.names }}"
state: present
update_cache: yes
when:
when:
- postgresql_ext_extra_packages is defined
- ansible_os_family == "RedHat"
1 change: 0 additions & 1 deletion tests/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
- ./vars.{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yml
roles:
- postgresql

2 changes: 1 addition & 1 deletion tests/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
retries: 30
delay: 5
when: (ansible_distribution == 'Fedora')
changed_when: false
changed_when: false
2 changes: 1 addition & 1 deletion tests/vars.CentOS.7.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
#--- picking the correct python interpreter
ansible_python_interpreter: "/usr/bin/python"
ansible_python_interpreter: "/usr/bin/python"
2 changes: 1 addition & 1 deletion tests/vars.CentOS.8.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
#--- picking the correct python interpreter
ansible_python_interpreter: "/usr/bin/python3"
ansible_python_interpreter: "/usr/bin/python3"
2 changes: 1 addition & 1 deletion tests/vars.Debian.10.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
#--- picking the correct python interpreter
ansible_python_interpreter: "/usr/bin/python3"
ansible_python_interpreter: "/usr/bin/python3"
2 changes: 1 addition & 1 deletion tests/vars.Debian.9.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
#--- picking the correct python interpreter
ansible_python_interpreter: "/usr/bin/python"
ansible_python_interpreter: "/usr/bin/python"
Loading

0 comments on commit 14ccfbe

Please sign in to comment.