Skip to content

Commit dc709b7

Browse files
committed
fix(setup-pgbackrest.yml): add /usr/bin/bash to sudoers task
1 parent 6d74ce5 commit dc709b7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

ansible/tasks/setup-pgbackrest.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@
1717
when:
1818
- nixpkg_mode
1919

20-
- name: Allow postgres to run pgBackRest commands as pgbackrest
21-
ansible.builtin.lineinfile:
22-
create: yes
23-
line: 'postgres ALL=(pgbackrest) NOPASSWD: /usr/bin/pgbackrest'
24-
dest: /etc/sudoers.d/pgbackrest
25-
mode: '0440'
26-
path: '/etc/sudoers.d/pgbackrest'
27-
validate: 'visudo -cf %s'
28-
2920
- name: Configure sudoers for pgBackRest
3021
ansible.builtin.lineinfile:
3122
create: yes
32-
line: 'postgres ALL=(pgbackrest) NOPASSWD: /var/lib/pgbackrest/.nix-profile/bin/pgbackrest'
23+
line: "{{ item }}"
3324
mode: '0440'
3425
path: '/etc/sudoers.d/pgbackrest'
3526
validate: 'visudo -cf %s'
27+
loop:
28+
- 'postgres ALL=(pgbackrest) NOPASSWD: /var/lib/pgbackrest/.nix-profile/bin/pgbackrest'
29+
- 'postgres ALL=(pgbackrest) NOPASSWD: /usr/bin/pgbackrest'
30+
- 'postgres ALL=(pgbackrest) NOPASSWD: /usr/bin/bash'
31+
- 'postgres ALL=(pgbackrest) NOPASSWD: /usr/bin/nix'
3632

3733
- name: Install pgBackRest
3834
ansible.builtin.shell: |

0 commit comments

Comments
 (0)