ansible/roles/users/tasks/ansible.yml

34 lines
703 B
YAML
Raw Normal View History

2022-09-04 17:25:14 +02:00
---
2022-08-30 14:43:41 +02:00
- name: create group 'ansible'
group:
name: ansible
gid: 501
- name: create user 'ansible'
user:
name: ansible
uid: 501
group: ansible
home: /var/lib/ansible
password: "*" # disabled password but can be accessed with SSH
groups:
- wheel
2022-09-04 17:25:14 +02:00
append: true
2022-08-30 14:43:41 +02:00
- name: make sure ansible owns its home
file:
state: directory
path: /var/lib/ansible
owner: ansible
group: ansible
mode: '2755'
2022-08-30 15:10:01 +02:00
- name: commit ansible's home to lbu
lbu:
include:
- /var/lib/ansible
exclude:
- /var/lib/ansible/.ansible
- /var/lib/ansible/.ash_history
2022-10-19 17:58:20 +02:00
when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]