Browse Source

Add users statee to manage users and passwords

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 1 year ago
parent
commit
07d06cc8dc
2 changed files with 17 additions and 0 deletions
  1. 1 0
      top.sls
  2. 16 0
      users/init.sls

+ 1 - 0
top.sls

@@ -23,6 +23,7 @@ base:
     - sysctl
     - systemd
     - timezone
+    - users
     - vim
     - unattended-upgrades
     - utils

+ 16 - 0
users/init.sls

@@ -0,0 +1,16 @@
+#
+# Manage root user (password)
+#
+
+# This should break, when the pillar isn't present
+{% set root_pw_hash = pillar['globals']['root_password_hash'] %}
+
+root:
+  user.present:
+    - fullname: root
+    - uid: 0
+    - gid: 0
+    - home: /root
+    - password: {{ root_pw_hash }}
+    - enforce_password: True
+    - empty_password: False