From d8db896ac2120854b573d07fa6c4425fe9d3990a Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 3 Sep 2023 22:05:22 -0400 Subject: [PATCH] roles/containers: put gitea on its own network --- roles/containers/tasks/main.yml | 1 + roles/containers/templates/docker-compose.yml.j2 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/roles/containers/tasks/main.yml b/roles/containers/tasks/main.yml index c5ceeef..ba3b65d 100644 --- a/roles/containers/tasks/main.yml +++ b/roles/containers/tasks/main.yml @@ -41,6 +41,7 @@ template: src: "docker-compose.yml.j2" dest: "{{ docker_compose_dir }}/docker-compose.yml" + lstrip_blocks: true register: generateComp - name: Create systemd unit file diff --git a/roles/containers/templates/docker-compose.yml.j2 b/roles/containers/templates/docker-compose.yml.j2 index bfa676f..8db9754 100644 --- a/roles/containers/templates/docker-compose.yml.j2 +++ b/roles/containers/templates/docker-compose.yml.j2 @@ -3,6 +3,10 @@ version: "3" +networks: + gitea: + driver: bridge + services: {% if "gitea" in group_names %} gitea: @@ -22,5 +26,7 @@ services: - {{ dataroot }}/gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro + networks: + - gitea {% endif %}