From 93b9eb58c695dcfd7e4658f9c7c1b5a9ece29a91 Mon Sep 17 00:00:00 2001 From: Baptiste DE RENZO <baptiste.derenzo@ubicast.eu> Date: Fri, 26 Feb 2021 10:28:28 +0100 Subject: [PATCH] Fix postgres maintenance playbook lint --- ansible/playbooks/postgres-maintenance.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/playbooks/postgres-maintenance.yml b/ansible/playbooks/postgres-maintenance.yml index 0f7ef59e..4385d878 100755 --- a/ansible/playbooks/postgres-maintenance.yml +++ b/ansible/playbooks/postgres-maintenance.yml @@ -23,13 +23,13 @@ when: rephacheck['stdout'] != "standby" - name: check if node is currently in standby command: "repmgr standby switchover -f /etc/postgresql/11/main/repmgr.conf --siblings-follow --dry-run" - become: yes + become: true become_user: postgres when: rephacheck['stdout'] == "standby" register: standby_dry_run - name: switch standby node to primary command: "repmgr standby switchover -f /etc/postgresql/11/main/repmgr.conf --siblings-follow" - become: yes + become: true become_user: postgres when: - standby_dry_run is succeeded @@ -51,10 +51,10 @@ file: path: /var/lib/postgresql/11/main/ state: absent - force: yes + force: true - name: copy data from primary command: "repmgr -f /etc/postgresql/11/main/repmgr.conf --force --verbose standby clone -h {{ hostvars[groups['postgres_primary'][0]]['ansible_default_ipv4']['address'] }} -d repmgr -U repmgr -c" - become: yes + become: true become_user: postgres register: copy_from_primary - name: start postgresql @@ -64,7 +64,7 @@ when: copy_from_primary is succeeded - name: register node as standby command: "repmgr -f /etc/postgresql/11/main/repmgr.conf --force --verbose standby register" - become: yes + become: true become_user: postgres when: copy_from_primary is succeeded @@ -74,7 +74,7 @@ tasks: - name: kill repmgrd command: "pkill repmgrd" - ignore_errors: yes + ignore_errors: true - name: restart repmgrd systemd: name: repmgrd -- GitLab