From 167c01c04ed4cfdc862b5db9784608e31c1e506c Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 2 Sep 2023 18:20:46 -0400 Subject: [PATCH] containers: add gitea user --- roles/containers/tasks/main.yml | 6 ++++++ roles/containers/templates/docker-compose.yml.j2 | 2 ++ 2 files changed, 8 insertions(+) diff --git a/roles/containers/tasks/main.yml b/roles/containers/tasks/main.yml index 60854ed..9c4a84a 100644 --- a/roles/containers/tasks/main.yml +++ b/roles/containers/tasks/main.yml @@ -11,6 +11,12 @@ name: docker group: docker +- name: Create Gitea user + user: + name: gitea + register: user_gitea + when: '"gitea" in groups' + - name: Create docker-compose directory ansible.builtin.file: path: "{{ docker_compose_dir }}" diff --git a/roles/containers/templates/docker-compose.yml.j2 b/roles/containers/templates/docker-compose.yml.j2 index 045d6ce..b7eac80 100644 --- a/roles/containers/templates/docker-compose.yml.j2 +++ b/roles/containers/templates/docker-compose.yml.j2 @@ -11,6 +11,8 @@ services: image: gitea/gitea:latest environment: - USER=gitea + - USER_UID={{ user_gitea.uid }} + - USER_GID={{ user_gitea.group }} - GITEA__server__SSH_PORT=2499 - GITEA__server__SSH_LISTEN_PORT=2499 - GITEA__service__DISABLE_REGISTRATION=true