feat: ability to set extra networks for nextcloud

needed for ldap outpost

Signed-off-by: Bert-Jan Fikse <bert-jan@whatwedo.ch>
This commit is contained in:
Bert-Jan Fikse 2026-04-10 11:16:56 +02:00
parent 77484f1944
commit 468ed34550
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
3 changed files with 18 additions and 1 deletions

View file

@ -14,6 +14,7 @@ nextcloud_image: "nextcloud:fpm"
nextcloud_redis_image: "redis:latest"
nextcloud_port: 80
nextcloud_extra_hosts: []
nextcloud_extra_networks: []
nextcloud_allow_local_remote_servers: false # Set to true to allow requests to local network (dev only)
nextcloud_postgres_image: "postgres:15"

View file

@ -19,6 +19,12 @@
state: directory
mode: '0755'
- name: Ensure extra networks exist
community.docker.docker_network:
name: "{{ item }}"
state: present
loop: "{{ nextcloud_extra_networks }}"
- name: Create docker-compose file for nextcloud
template:
src: docker-compose.yml.j2

View file

@ -66,6 +66,9 @@ services:
- {{ nextcloud_docker_volume_dir }}/nextcloud/:/var/www/html
networks:
- {{ nextcloud_backend_network }}
{% for net in nextcloud_extra_networks %}
- {{ net }}
{% endfor %}
nextcloud:
image: {{ nextcloud_image }}
@ -102,6 +105,9 @@ services:
- {{ nextcloud_docker_volume_dir }}/nextcloud/:/var/www/html
networks:
- {{ nextcloud_backend_network }}
{% for net in nextcloud_extra_networks %}
- {{ net }}
{% endfor %}
{% if nextcloud_extra_hosts is defined and nextcloud_extra_hosts | length > 0 %}
extra_hosts:
{% for host in nextcloud_extra_hosts %}
@ -145,4 +151,8 @@ services:
networks:
{{ nextcloud_backend_network }}:
{{ nextcloud_traefik_network }}:
external: true
external: true
{% for net in nextcloud_extra_networks %}
{{ net }}:
external: true
{% endfor %}