summaryrefslogtreecommitdiffstats
path: root/roles/user
diff options
context:
space:
mode:
Diffstat (limited to 'roles/user')
-rw-r--r--roles/user/tasks/main.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml
new file mode 100644
index 0000000..11c0a74
--- /dev/null
+++ b/roles/user/tasks/main.yml
@@ -0,0 +1,31 @@
+- name: Add group
+ become: yes
+ group:
+ name: "{{ emacsconf_group }}"
+- name: Add user
+ become: yes
+ user:
+ name: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ shell: /bin/bash
+# password: "{{ emacsconf_unix_password }}"
+- name: Create SSH folder
+ file:
+ path: "/home/{{ emacsconf_user }}/.ssh"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ state: directory
+ mode: 0700
+- name: Set up SSH key access
+ template:
+ src: authorized_keys
+ dest: "/home/{{ emacsconf_user }}/.ssh/authorized_keys"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ force: no
+- name: Change ownership of SSH directory
+ file:
+ path: "/home/{{ emacsconf_user }}/.ssh"
+ recurse: true
+ owner: "{{ emacsconf_user }}"
+ mode: "u+rwX,g-rwx,o-rwx"