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 %}