Setup SSH passthrough script

This commit is contained in:
Luke Murphy 2020-03-23 15:36:55 +01:00
parent f873a3839a
commit f135bb1202
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 20 additions and 10 deletions

View File

@ -47,6 +47,24 @@
ssh_key_file: .ssh/id_rsa
become: true
- name: Create SSH passthrough directories
file:
path: "{{ item }}"
state: directory
owner: gitea
group: gitea
with_items:
- /app
- /app/gitea
become: true
- name: Setup the SSH passthrough
template:
src: gitea.j2
dest: /app/gitea/gitea
owner: gitea
group: gitea
- name: Get uid/guid of the gitea user
getent:
database: passwd
@ -54,16 +72,6 @@
split: ":"
become: true
- name: Create volume mount configuration directories
file:
path: "{{ item }}"
state: directory
owner: dokku
group: dokku
with_items:
- /var/lib/gitea
become: true
- name: Specify docker volume mounts
dokku_storage:
app: gitea

2
ansible/templates/gitea Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
ssh -p $GIT_SSH_PORT -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"