]> git.phdru.name Git - ansible.git/blobdiff - playbooks/roles/debian/phd/tasks/main.yml
Feat: Move roles/debian-* -> roles/debian/*
[ansible.git] / playbooks / roles / debian / phd / tasks / main.yml
diff --git a/playbooks/roles/debian/phd/tasks/main.yml b/playbooks/roles/debian/phd/tasks/main.yml
new file mode 100644 (file)
index 0000000..fb60720
--- /dev/null
@@ -0,0 +1,16 @@
+- name: Test if user phd already exists
+  command: test -f ~/.profile -a -f ~/.shellrc
+  ignore_errors: true
+  register: phd_exist
+
+- debug:
+    msg: "User phd has already been created"
+  when: phd_exist.rc == 0
+
+- name: "Create and setup user phd"
+  block:
+    - name: "Create user phd"
+      import_tasks: create.yml
+    - name: "Setup home dir"
+      import_tasks: setup-home.yml
+  when: phd_exist.rc != 0