Skip to content

Commit ed0464f

Browse files
committed
feat: attempt to use command directly to create user and group
1 parent 2cfe394 commit ed0464f

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

ansible-nix/tasks/setup-postgres.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@
1818
# the old method of installing from debian creates this group, but we must create it explicitly
1919
# for the nix built version
2020

21-
- name: create postgres group
22-
group:
23-
name: postgres
24-
state: present
25-
26-
- name: create users
27-
user:
28-
name: postgres
29-
groups: postgres, ssl-cert
30-
createhome: yes
31-
append: no
32-
shell: /bin/bash # Set shell if needed, default is /bin/bash
33-
password: ''
34-
35-
21+
# - name: create postgres group
22+
# group:
23+
# name: postgres
24+
# state: present
25+
26+
# - name: create users
27+
# user:
28+
# name: postgres
29+
# groups: postgres, ssl-cert
30+
# createhome: yes
31+
# append: no
32+
# shell: /bin/bash # Set shell if needed, default is /bin/bash
33+
# password: ''
34+
35+
- name: create postgres user
36+
shell: useradd -m -r -s /bin/bash postgres
37+
args:
38+
executable: /bin/bash
39+
become: yes
40+
3641
- name: Create relevant directories
3742
file:
3843
path: '{{ item }}'

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.34-nix-staged"
1+
postgres-version = "15.6.1.35-nix-staged"

0 commit comments

Comments
 (0)