From 7b52e7d566dd45567a0bceeef18c07f4eea5d306 Mon Sep 17 00:00:00 2001 From: Ian van der Linde Date: Wed, 10 Apr 2024 11:24:31 +0200 Subject: [PATCH 1/2] Fix linting issues. --- roles/tuning/tasks/tune_postgres.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/roles/tuning/tasks/tune_postgres.yml b/roles/tuning/tasks/tune_postgres.yml index 333c2ad7..5de16855 100644 --- a/roles/tuning/tasks/tune_postgres.yml +++ b/roles/tuning/tasks/tune_postgres.yml @@ -75,7 +75,7 @@ - name: Override the variable _pg_max_connections ansible.builtin.set_fact: _pg_max_connections: >- - {{ pg_postgres_conf_params |selectattr('name', 'equalto', 'max_connections') |map(attribute='value') |default([_pg_max_connections], true) |first }} + {{ pg_postgres_conf_params | selectattr('name', 'equalto', 'max_connections') | map(attribute='value') | default([_pg_max_connections], true) | first }} when: pg_conf_override_tuning # Set the shared_buffers value @@ -86,7 +86,8 @@ - name: Override the variable _pg_shared_buffers_mb ansible.builtin.set_fact: _pg_shared_buffers_mb: >- - {{ pg_postgres_conf_params |selectattr('name', 'equalto', 'shared_buffers') |map(attribute='value') |default([_pg_shared_buffers_mb], true) |first |ansible.builtin.regex_replace('mb', '', ignorecase=True) }} + {{ pg_postgres_conf_params | selectattr('name', 'equalto', 'shared_buffers') | map(attribute='value') + | default([_pg_shared_buffers_mb], true) | first | ansible.builtin.regex_replace('mb', '', ignorecase=True) }} when: pg_conf_override_tuning # Set the work_mem value to: ((Total RAM - shared_buffers)/(16 x CPU cores)) @@ -99,7 +100,8 @@ - name: Override the variable _pg_work_mem_mb ansible.builtin.set_fact: _pg_work_mem_mb: >- - {{ pg_postgres_conf_params |selectattr('name', 'equalto', 'work_mem') |map(attribute='value') |default([_pg_work_mem_mb], true) |first |ansible.builtin.regex_replace('mb', '', ignorecase=True) }} + {{ pg_postgres_conf_params | selectattr('name', 'equalto', 'work_mem') | map(attribute='value') + | default([_pg_work_mem_mb], true) | first | ansible.builtin.regex_replace('mb', '', ignorecase=True) }} when: pg_conf_override_tuning # Set the maintenance_work_mem value to: @@ -121,7 +123,8 @@ - name: Override the variable _pg_maintenance_work_mem_mb ansible.builtin.set_fact: _pg_maintenance_work_mem_mb: >- - {{ pg_postgres_conf_params |selectattr('name', 'equalto', 'maintenance_work_mem') |map(attribute='value') |default([_pg_maintenance_work_mem_mb], true) |first |ansible.builtin.regex_replace('mb', '', ignorecase=True) }} + {{ pg_postgres_conf_params | selectattr('name', 'equalto', 'maintenance_work_mem') | map(attribute='value') + | default([_pg_maintenance_work_mem_mb], true) | first | ansible.builtin.regex_replace('mb', '', ignorecase=True) }} when: pg_conf_override_tuning - name: Initialize the Postgres parameters list From 99f81eb1fd4e5613d55b15626f3853a6a369a3b6 Mon Sep 17 00:00:00 2001 From: Ian van der Linde Date: Wed, 10 Apr 2024 14:22:00 +0200 Subject: [PATCH 2/2] Fix spacing issue reported by linter in pgbackrest task. --- roles/setup_pgbackrest/tasks/configure_pgbackrest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml b/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml index d379692d..1da6f1bd 100644 --- a/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml +++ b/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml @@ -36,7 +36,7 @@ - name: Build configuration file {{ pgbackrest_configuration_file }} ansible.builtin.template: - src: "./templates/pgbackrest_{{ group_names |select('match', 'primary|slave') |first }}.{{ pgbackrest_archive_method }}.conf.template" + src: "./templates/pgbackrest_{{ group_names | select('match', 'primary|slave') | first }}.{{ pgbackrest_archive_method }}.conf.template" dest: "{{ pgbackrest_configuration_file }}" owner: "{{ pg_owner }}" group: "{{ pg_group }}"