From f135bb1202d99a4c051d44de7870d8dd9f02c265 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 23 Mar 2020 15:36:55 +0100 Subject: [PATCH] Setup SSH passthrough script --- ansible/pre-deploy.yml | 28 ++++++++++++++++++---------- ansible/templates/gitea | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) create mode 100755 ansible/templates/gitea diff --git a/ansible/pre-deploy.yml b/ansible/pre-deploy.yml index 4bb2187..e0d0f2a 100644 --- a/ansible/pre-deploy.yml +++ b/ansible/pre-deploy.yml @@ -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 diff --git a/ansible/templates/gitea b/ansible/templates/gitea new file mode 100755 index 0000000..40c7581 --- /dev/null +++ b/ansible/templates/gitea @@ -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 $@"