# Git-over-ssh stays on the host sshd port 22 # ("SSH container passthrough" in gitea docs) - name: Create gitea group (gid must match compose USER_GID) group: name: gitea gid: 2222 - name: Create gitea passthrough user (uid must match compose USER_UID) user: name: gitea uid: 2222 group: gitea groups: docker # for the docker exec append: true home: /opt/gitea/data/git # holds .ssh/authorized_keys create_home: false shell: /bin/bash # standard sh doesn't work password_lock: true - name: Install gitea ssh passthrough shim copy: dest: /usr/local/bin/gitea mode: "0755" content: | #!/bin/sh # Managed by ansible, see tasks/gitea.yml. exec /usr/bin/docker exec -i -u gitea \ -e SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" \ -e GITEA_CUSTOM=/data/gitea \ gitea-gitea-1 /usr/local/bin/gitea "$@" - name: Deploy Gitea include_tasks: tasks/docker_service.yml vars: service_name: gitea