ansible/roles/users/tasks/woodpecker.yml

42 lines
889 B
YAML
Raw Permalink Normal View History

2022-09-04 17:25:14 +02:00
---
2022-08-30 15:06:40 +02:00
- name: create group 'woodpecker'
group:
name: woodpecker
gid: 502
- name: create user 'woodpecker'
user:
name: woodpecker
2022-08-30 15:34:11 +02:00
uid: 502
2022-08-30 15:06:40 +02:00
group: woodpecker
home: /var/lib/woodpecker
password: "*" # disabled password but can be accessed with SSH
groups:
2022-08-30 18:26:16 +02:00
- deploy
2022-09-04 17:25:14 +02:00
append: true
2022-08-30 18:26:16 +02:00
- name: additional groups to woodpecker
user:
name: woodpecker
groups: "{{item}}"
2022-09-04 17:25:14 +02:00
append: true
2022-08-30 18:26:16 +02:00
when: item in ansible_facts.getent_group
with_items:
- docker
2022-08-30 15:06:40 +02:00
- name: make sure woodpecker owns its home
file:
state: directory
path: /var/lib/woodpecker
owner: woodpecker
group: woodpecker
mode: '2755'
2022-08-30 15:10:01 +02:00
- name: commit woodpecker's home to lbu
lbu:
include:
- /var/lib/woodpecker
exclude:
- /var/lib/woodpecker/.ash_history
2022-10-19 17:58:20 +02:00
when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]