44 lines
825 B
YAML
44 lines
825 B
YAML
|
---
|
||
|
- name: Setup system level git user
|
||
|
become: true
|
||
|
user:
|
||
|
name: git
|
||
|
comment: gitea user
|
||
|
create_home: true
|
||
|
home: /home/git
|
||
|
group: git
|
||
|
system: true
|
||
|
generate_ssh_key: true
|
||
|
ssh_key_bits: 2048
|
||
|
ssh_key_file: .ssh/id_rsa
|
||
|
state: present
|
||
|
|
||
|
- name: Get uid/guid of the git user
|
||
|
become: true
|
||
|
getent:
|
||
|
database: passwd
|
||
|
key: git
|
||
|
split: ":"
|
||
|
|
||
|
- name: Store gitea git user uid/guid in config.vars
|
||
|
set_fact:
|
||
|
config: "{{
|
||
|
config.vars |
|
||
|
default({}) |
|
||
|
combine({
|
||
|
'git_user_uid': getent_passwd['git'][1],
|
||
|
'git_user_guid': getent_passwd['git'][2],
|
||
|
})
|
||
|
}}"
|
||
|
|
||
|
- name: Create extra application directories
|
||
|
become: true
|
||
|
file:
|
||
|
path: "{{ item }}"
|
||
|
state: directory
|
||
|
owner: git
|
||
|
group: git
|
||
|
with_items:
|
||
|
- /app
|
||
|
- /app/gitea
|