ansible/roles/users/tasks/btrbk.yml

42 lines
813 B
YAML
Raw Permalink Normal View History

2022-11-04 14:34:44 +01:00
---
- name: create group 'btrbk'
group:
name: btrbk
gid: 505
- name: create user 'btrbk'
user:
name: btrbk
uid: 505
group: btrbk
home: /var/lib/btrbk
password: "*" # disabled password but can be accessed with SSH
groups:
- wheel
append: true
2022-11-06 13:50:16 +01:00
- name: additional groups to btrbk
user:
name: btrbk
groups: "{{item}}"
append: true
when: item in ansible_facts.getent_group
with_items:
- syslog
2022-11-04 14:34:44 +01:00
- name: make sure btrbk owns its home
file:
state: directory
path: /var/lib/btrbk
2022-11-04 14:41:27 +01:00
owner: btrbk
group: btrbk
2022-11-04 14:34:44 +01:00
mode: '2755'
- name: commit btrbk's home to lbu
lbu:
include:
- /var/lib/btrbk
exclude:
- /var/lib/btrbk/.ash_history
when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]