Skip to content

Commit

Permalink
chore: check if postgres user member of "users" group
Browse files Browse the repository at this point in the history
  • Loading branch information
samrose committed May 15, 2024
1 parent 4678636 commit d6338b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions ansible-nix/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@

- name: Clean out build dependencies
import_tasks: tasks/clean-build-dependencies.yml
- name: Remove postgres user from users group

- name: Check if postgres user is part of users group
command: "id -nG postgres | grep -qw users"
register: check_user_group
ignore_errors: yes
become: yes
command: gpasswd -d postgres users

- name: Print result to Ansible log output
debug:
msg: "The postgres user is {{ 'not ' if check_user_group.rc != 0 else '' }}part of the users group"
2 changes: 1 addition & 1 deletion common-nix.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.6.1.29-nix-staged"
postgres-version = "15.6.1.30-nix-staged"

0 comments on commit d6338b9

Please sign in to comment.