From 2fe25cdb9f6193b5f51944b6ff5ff49c5a39cd5e Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:47:50 +0500 Subject: [PATCH] Upgrade: Add PATH for patronictl; Override become_method in Molecule tests (#832) --- automation/molecule/default/converge.yml | 1 + automation/molecule/default/prepare.yml | 1 - automation/molecule/pg_upgrade/converge.yml | 1 + automation/molecule/postgrespro/converge.yml | 1 + automation/roles/upgrade/tasks/update_config.yml | 2 ++ 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/automation/molecule/default/converge.yml b/automation/molecule/default/converge.yml index 2b9d965a9..513fb6046 100644 --- a/automation/molecule/default/converge.yml +++ b/automation/molecule/default/converge.yml @@ -6,6 +6,7 @@ tasks: - name: Set variables for PostgreSQL Cluster deployment test ansible.builtin.set_fact: + ansible_become_method: su # Override become_method firewall_enabled_at_boot: false firewall_enable_ipv6: false # Added to prevent test failures in CI. swap_file_create: false # Added to prevent test failures in CI. diff --git a/automation/molecule/default/prepare.yml b/automation/molecule/default/prepare.yml index 4c2fa74e9..58cb03e12 100644 --- a/automation/molecule/default/prepare.yml +++ b/automation/molecule/default/prepare.yml @@ -23,7 +23,6 @@ - name: "Install netaddr dependency on controlling host" ansible.builtin.pip: name: netaddr - become: false environment: PIP_BREAK_SYSTEM_PACKAGES: "1" diff --git a/automation/molecule/pg_upgrade/converge.yml b/automation/molecule/pg_upgrade/converge.yml index 610a3a963..1a0fdf6f0 100644 --- a/automation/molecule/pg_upgrade/converge.yml +++ b/automation/molecule/pg_upgrade/converge.yml @@ -6,6 +6,7 @@ tasks: - name: Set variables for Patroni cluster deployment test ansible.builtin.set_fact: + ansible_become_method: su # Override become_method firewall_enabled_at_boot: false firewall_enable_ipv6: false # Added to prevent test failures in CI. swap_file_create: false # Added to prevent test failures in CI. diff --git a/automation/molecule/postgrespro/converge.yml b/automation/molecule/postgrespro/converge.yml index c85b83f72..747618fb6 100644 --- a/automation/molecule/postgrespro/converge.yml +++ b/automation/molecule/postgrespro/converge.yml @@ -6,6 +6,7 @@ tasks: - name: Set variables for molecule ansible.builtin.set_fact: + ansible_become_method: su # Override become_method firewall_enable_ipv6: false # Added to prevent test failures in CI. swap_file_create: false # Added to prevent test failures in CI. sysctl_set: false # Added to prevent test failures in CI. diff --git a/automation/roles/upgrade/tasks/update_config.yml b/automation/roles/upgrade/tasks/update_config.yml index 5b343af8f..31dd7279a 100644 --- a/automation/roles/upgrade/tasks/update_config.yml +++ b/automation/roles/upgrade/tasks/update_config.yml @@ -258,6 +258,8 @@ - name: "Remove 'standby_cluster' parameter from DCS (if exists)" ansible.builtin.command: patronictl -c {{ patroni_config_file }} edit-config -s standby_cluster=null --force + environment: + PATH: "{{ ansible_env.PATH }}:/usr/bin:/usr/local/bin" when: inventory_hostname in groups['primary'] # Copy the pg_hba.conf file to a new PostgreSQL to save pg_hba rules.