Switch to system git user

This commit is contained in:
Luke Murphy 2020-03-23 16:21:12 +01:00
parent 78994e5fe9
commit e38c34ee6a
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 22 additions and 19 deletions

View File

@ -40,3 +40,11 @@
mappings:
- "https:443:3000"
state: present
- name: Symlink the authorized keys configuration
file:
src: /var/lib/gitea/git/.ssh/authorized_keys
dest: /home/git/.ssh/authorized_keys
state: link
force: true
owner: git

View File

@ -26,20 +26,13 @@
name: gitea
service: mariadb
- name: Setup host Gitea group
group:
name: gitea
system: true
state: present
become: true
- name: Setup host Gitea user
- name: Setup host git user
user:
name: gitea
name: git
comment: gitea user
create_home: true
home: /var/lib/gitea
group: gitea
home: /home/git
group: git
system: true
state: present
generate_ssh_key: true
@ -47,29 +40,31 @@
ssh_key_file: .ssh/id_rsa
become: true
- name: Create SSH passthrough directories
- name: Create application directories
file:
path: "{{ item }}"
state: directory
owner: gitea
group: gitea
owner: git
group: git
with_items:
- /app
- /app/gitea
- /var/lib/gitea
become: true
- name: Setup the SSH passthrough
- name: Setup the SSH passthrough script
template:
src: gitea.j2
dest: /app/gitea/gitea
owner: gitea
group: gitea
owner: git
group: git
mode: "+x"
become: true
- name: Get uid/guid of the gitea user
- name: Get uid/guid of the git user
getent:
database: passwd
key: gitea
key: git
split: ":"
become: true