ansible/roles/users/tasks/rilla.yml

49 lines
915 B
YAML
Raw Normal View History

2022-08-30 14:43:41 +02:00
- name: create group 'rilla'
group:
name: rilla
gid: 1000
- name: create user 'rilla'
user:
name: rilla
uid: 1000
group: rilla
home: /home/rilla
groups:
2022-08-30 18:26:16 +02:00
- deploy
2022-08-30 14:43:41 +02:00
- wheel
2022-08-30 18:26:16 +02:00
- name: additional groups to rilla
user:
name: rilla
groups: "{{item}}"
append: yes
when: item in ansible_facts.getent_group
with_items:
- docker
2022-08-30 14:43:41 +02:00
- name: make sure rilla owns its home
file:
state: directory
path: /home/rilla
owner: rilla
group: rilla
mode: '2755'
- name: set rilla's authorized key
authorized_key:
user: rilla
key: '{{ item }}'
path: /home/rilla/.ssh/authorized_keys
with_file:
- public_keys/yubikey
2022-08-30 15:10:01 +02:00
- name: commit rilla's home to lbu
lbu:
include:
- /home/rilla
- /home/rilla/.ssh/authorized_keys
exclude:
- /home/rilla/.ash_history
2022-08-30 17:39:14 +02:00
when: ansible_distribution == "Alpine" and use_lbu