summaryrefslogtreecommitdiff
path: root/roles/users/tasks/main.yml
blob: 864934a4134f58303b00acad4d462d71746057a8 (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
32
- name: Remove default users
  ansible.builtin.user:
    name: '{{ item }}'
    state: absent
  loop:
    - arch

- name: Create user for Dmitry Ilvokhin
  ansible.builtin.user:
    name: d
    home: /home/d
    groups:
      - wheel
      # Group http required to deploy websites with rsync under personal
      # username.
      - http

- name: Setup SSH directory for Dmitry Ilvokhin
  ansible.builtin.file:
    path: /home/d/.ssh
    state: directory
    owner: d
    group: d
    mode: u+rw,g-wx,o-rwx

- name: Update authorized_keys for Dmitry Ilvokhin
  ansible.posix.authorized_key:
    user: d
    state: present
    key: '{{ item }}'
  with_file:
    - misc/pubkeys/d.pub