From 6ae0236869b7adcb4c84690f3fdf8789505c7963 Mon Sep 17 00:00:00 2001 From: Ian van der Linde Date: Thu, 25 Apr 2024 09:26:56 +0200 Subject: [PATCH 1/3] Add minimum EFM PgPool integration values At the moment there is an option to enable EFM PgPool integration, but the integration is incomplete as it does not include the minimum parameters required by EFM to complete the integration. As such, the flag is currently not viable, even though it exists. This patch fixes this by making use of existing variables to populate the configuration when the flag is enabled, and allows for the attach and detach scripts to be made configurable. --- roles/setup_efm/defaults/main.yml | 2 ++ roles/setup_efm/tasks/efm_configure.yml | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/setup_efm/defaults/main.yml b/roles/setup_efm/defaults/main.yml index b003480e7..149e44bf6 100644 --- a/roles/setup_efm/defaults/main.yml +++ b/roles/setup_efm/defaults/main.yml @@ -108,6 +108,8 @@ pcp_passfile_owner: "efm" pcp_passfile_group: "efm" pcp_passfile_mode: "0600" pgpool2_pcp_port: 9898 +efm_pgpool2_lb_attach: "{{ efm_bin_path }}/pcp_attach_all.sh %h %t" +efm_pgpool2_lb_detach: "" supported_os: - CentOS7 diff --git a/roles/setup_efm/tasks/efm_configure.yml b/roles/setup_efm/tasks/efm_configure.yml index 08ff9d88d..cb75031d7 100644 --- a/roles/setup_efm/tasks/efm_configure.yml +++ b/roles/setup_efm/tasks/efm_configure.yml @@ -40,12 +40,20 @@ - name: Prepare parameters for PgPoolII integration ansible.builtin.set_fact: efm_lb_parameters: - - {name: script.load.balancer.attach, value: "{{ efm_bin_path }}/pcp_attach_all.sh %h %t"} - {name: auto.resume.period, value: "5"} - {name: script.custom.monitor, value: "{{ efm_bin_path }}/pg_pcp_health.sh"} - {name: custom.monitor.interval, value: "5"} - {name: custom.monitor.safe.mode, value: "true"} - {name: custom.monitor.timeout, value: "10"} + - {name: detach.on.agent.failure, value: "{{ detach_on_agent_failure|lower }}"} + - {name: pgpool.enable, value: "{{ efm_pgpool2_integration|lower }}"} + - {name: pgpool.bin, value: "{{ pgpool2_bin_path }}"} + - {name: pcp.user, value: "{{ pcp_admin_user }}"} + - {name: pcp.host, value: "{{ pgpool2_vip }}"} + - {name: pcp.port, value: "{{ pgpool2_pcp_port }}"} + - {name: pcp.pass.file, value: "{{ pcp_passfile }}"} + - {name: script.load.balancer.attach, value: "{{ efm_pgpool2_lb_attach }}"} + - {name: script.load.balancer.detach, value: "{{ efm_pgpool2_lb_detach }}"} when: - efm_pgpool2_integration From 7618b58036adf4490199be57ac3c8b76d8cd562d Mon Sep 17 00:00:00 2001 From: Ian van der Linde Date: Thu, 25 Apr 2024 09:32:14 +0200 Subject: [PATCH 2/3] Remove accidental inclusion of change related to PR #629. --- roles/setup_efm/tasks/efm_configure.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/setup_efm/tasks/efm_configure.yml b/roles/setup_efm/tasks/efm_configure.yml index cb75031d7..5737856b2 100644 --- a/roles/setup_efm/tasks/efm_configure.yml +++ b/roles/setup_efm/tasks/efm_configure.yml @@ -45,7 +45,6 @@ - {name: custom.monitor.interval, value: "5"} - {name: custom.monitor.safe.mode, value: "true"} - {name: custom.monitor.timeout, value: "10"} - - {name: detach.on.agent.failure, value: "{{ detach_on_agent_failure|lower }}"} - {name: pgpool.enable, value: "{{ efm_pgpool2_integration|lower }}"} - {name: pgpool.bin, value: "{{ pgpool2_bin_path }}"} - {name: pcp.user, value: "{{ pcp_admin_user }}"} From b13620eb9db3f18cada281c771b701cc3b9c91bc Mon Sep 17 00:00:00 2001 From: Ian van der Linde Date: Thu, 25 Apr 2024 09:38:03 +0200 Subject: [PATCH 3/3] Fix ansible-lint spacing notice. --- roles/setup_efm/tasks/efm_configure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/setup_efm/tasks/efm_configure.yml b/roles/setup_efm/tasks/efm_configure.yml index 5737856b2..1012a04d2 100644 --- a/roles/setup_efm/tasks/efm_configure.yml +++ b/roles/setup_efm/tasks/efm_configure.yml @@ -45,7 +45,7 @@ - {name: custom.monitor.interval, value: "5"} - {name: custom.monitor.safe.mode, value: "true"} - {name: custom.monitor.timeout, value: "10"} - - {name: pgpool.enable, value: "{{ efm_pgpool2_integration|lower }}"} + - {name: pgpool.enable, value: "{{ efm_pgpool2_integration | lower }}"} - {name: pgpool.bin, value: "{{ pgpool2_bin_path }}"} - {name: pcp.user, value: "{{ pcp_admin_user }}"} - {name: pcp.host, value: "{{ pgpool2_vip }}"}