]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/phd/tasks/main.yml
Refactor(phd): Merge `create.yml` back into `main.yml`
[ansible.git] / playbooks / debian / roles / phd / tasks / main.yml
index dfd87800724c161c963b389bd628d338e38f9663..1ca3a4b3c8340b70fd436ce2a836328395618a41 100644 (file)
 
 - name: Create and setup user phd
   block:
-    - name: Create user phd
-      import_tasks: create.yml
+    - name: Create system groups
+      become: true
+      group:
+        name: "{{ item }}"
+        system: true
+      loop: "{{ system_groups.split(',') }}"
+
+    - name: Create group phd
+      become: true
+      group:
+        name: phd
+
+    - name: Add user phd
+      become: true
+      user:
+        name: phd
+        group: phd
+        groups: "{{ system_groups }}"
+
     - name: Upload and extract home archive
       unarchive:
         src: ~/archive/STORE/phd/Home/phd.tar.bz2