forked from uumas/ansible-docker
Implement ssh config of gitea role
This commit is contained in:
28
roles/gitea/tasks/main.yml
Normal file
28
roles/gitea/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
|
||||
- name: Create git group on host for gitea ssh
|
||||
group:
|
||||
name: git
|
||||
gid: 2132
|
||||
system: yes
|
||||
|
||||
- name: Create git user on host for gitea ssh
|
||||
user:
|
||||
name: git
|
||||
uid: 2132
|
||||
group: git
|
||||
system: yes
|
||||
home: /var/lib/gitea
|
||||
generate_ssh_key: yes
|
||||
register: git_user
|
||||
|
||||
- name: Add git user's own ssh key to its authorized keys
|
||||
authorized_key:
|
||||
user: git
|
||||
key: "{{ git_user.ssh_public_key }}"
|
||||
|
||||
- name: Put gitea ssh forwarder in place
|
||||
template:
|
||||
src: gitea_ssh_forward.j2
|
||||
dest: /usr/local/bin/gitea
|
||||
mode: '755'
|
||||
Reference in New Issue
Block a user