Skip to content

Commit d6338b9

Browse files
committed
chore: check if postgres user member of "users" group
1 parent 4678636 commit d6338b9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

ansible-nix/playbook.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@
105105

106106
- name: Clean out build dependencies
107107
import_tasks: tasks/clean-build-dependencies.yml
108-
- name: Remove postgres user from users group
108+
109+
- name: Check if postgres user is part of users group
110+
command: "id -nG postgres | grep -qw users"
111+
register: check_user_group
112+
ignore_errors: yes
109113
become: yes
110-
command: gpasswd -d postgres users
114+
115+
- name: Print result to Ansible log output
116+
debug:
117+
msg: "The postgres user is {{ 'not ' if check_user_group.rc != 0 else '' }}part of the users group"

common-nix.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.6.1.29-nix-staged"
1+
postgres-version = "15.6.1.30-nix-staged"

0 commit comments

Comments
 (0)