From ff40949ff7db5db4524006420a13194738759cce Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 3 Sep 2023 19:38:29 -0400 Subject: [PATCH] roles/containers: make gitea bridge network instead of host network --- roles/containers/tasks/main.yml | 13 +++++++++++++ roles/containers/templates/docker-compose.yml.j2 | 7 +++---- .../connection/templates/nodns.network.j2 | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/roles/containers/tasks/main.yml b/roles/containers/tasks/main.yml index 9c4a84a..c5ceeef 100644 --- a/roles/containers/tasks/main.yml +++ b/roles/containers/tasks/main.yml @@ -17,6 +17,19 @@ register: user_gitea when: '"gitea" in groups' +- name: Create Syncthing group + group: + name: vault + state: present + when: '"syncthing" in groups' + +- name: Create Syncthing user + user: + name: syncthing + group: vault + register: user_syncthing + when: '"syncthing" 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 b7eac80..a9e699d 100644 --- a/roles/containers/templates/docker-compose.yml.j2 +++ b/roles/containers/templates/docker-compose.yml.j2 @@ -6,18 +6,17 @@ version: "3" services: {% if "gitea" in group_names %} gitea: - network_mode: host container_name: gitea 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 - GITEA__server__DOMAIN={{ gitea_domain }} - GITEA__server__SSH_DOMAIN={{ gitea_domain }} + ports: + - "3000:3000" + - "2499:22" restart: unless-stopped volumes: - {{ dataroot }}/gitea:/data diff --git a/roles/networking/connection/templates/nodns.network.j2 b/roles/networking/connection/templates/nodns.network.j2 index 45ff8a3..fe36376 100644 --- a/roles/networking/connection/templates/nodns.network.j2 +++ b/roles/networking/connection/templates/nodns.network.j2 @@ -1,5 +1,5 @@ [Match] -Name=* +Name={{ net_interface }} [DHCP] UseDNS=false