]> git.phdru.name Git - ansible.git/commitdiff
Add a playbook to init user `phd`
authorOleg Broytman <phd@phdru.name>
Tue, 18 Jun 2019 00:10:28 +0000 (03:10 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 16 Jul 2019 18:28:36 +0000 (21:28 +0300)
Add user `phd`, copy its public ssh key.

playbooks/debian-init-user-phd.yml [new file with mode: 0644]

diff --git a/playbooks/debian-init-user-phd.yml b/playbooks/debian-init-user-phd.yml
new file mode 100644 (file)
index 0000000..a41f09b
--- /dev/null
@@ -0,0 +1,22 @@
+- name: Create user phd
+  hosts: all
+  tasks:
+    - name: Add user phd
+      user:
+        name: phd
+        group: phd
+        groups: root,adm,disk,cdrom,www-data,plugdev,staff,users,sudo,Debian-exim,fuse
+    - name: Create folder ~phd/.ssh
+      file:
+        path: ~phd/.ssh
+        state: directory
+        owner: phd
+        group: phd
+        mode: 0700
+     - name: Upload SSH key
+       copy:
+        src: ~/.ssh/phd@nb3.pub
+        dest: ~phd/.ssh/phd@nb3.pub
+        owner: phd
+        group: phd
+        mode: 0700