This repository has been archived on 2020-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
git.autonomic.zone/deploy.d/plays/predeploy.yml

46 lines
912 B
YAML
Raw Normal View History

2020-04-14 15:38:57 +00:00
---
- 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: ":"
register: getent_passwd
2020-04-14 15:38:57 +00:00
2020-04-15 09:58:24 +00:00
- name: Store gitea git user uid/guid in config.env
2020-04-14 15:38:57 +00:00
set_fact:
git_user_info: "{{
'USER_GID': getent_passwd['git'][1],
'USER_UID': getent_passwd['git'][2]
2020-04-14 15:38:57 +00:00
}}"
config: "{{ config | update_env(git_user_info) }}"
2020-04-14 15:38:57 +00:00
2020-04-15 10:58:37 +00:00
- name: Output config for debugging purposes
2020-04-15 10:35:18 +00:00
debug:
msg: "{{ config }}"
2020-04-14 15:38:57 +00:00
- name: Create extra application directories
become: true
file:
path: "{{ item }}"
state: directory
owner: git
group: git
with_items:
- /app
- /app/gitea