Skip to content

Commit

Permalink
upgrade: Fix PgBouncer socket dir permissions on RHEL (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Dec 21, 2023
1 parent 0513762 commit 32bbceb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions roles/upgrade/tasks/pgbouncer_pause.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
# the timeout command will interrupt the execution of 'pgb_resume_command' and execute the pgb_resume_query command to remove the pause and ensure atomicity.
#
# Finally, the script checks whether all servers have been successfully paused by comparing the number of successful PAUSE executions to the total number of pgbouncer servers.

- name: Ensure correct permissions for PgBouncer unix socket directory
become: true
become_user: root
ansible.builtin.file:
path: "/var/run/pgbouncer{{ '-%d' % (idx + 1) if idx > 0 else '' }}"
state: directory
owner: postgres
group: postgres
mode: "0755"
loop: "{{ range(0, (pgbouncer_processes | default(1) | int)) | list }}"
loop_control:
index_var: idx
label: "{{ 'pgbouncer' if idx == 0 else 'pgbouncer-%d' % (idx + 1) }}"
when: ansible_os_family == "RedHat" # Added to prevent test failures in CI.

- name: PAUSE PgBouncer pools
become: true
become_user: postgres
Expand Down

0 comments on commit 32bbceb

Please sign in to comment.