summaryrefslogtreecommitdiffstats
path: root/roles/user/tasks/main.yml
blob: 11c0a74f708553779304adb60be2724f7705fa68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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"