feat: ability to set extra networks for opencloud

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:19:10 +02:00
parent e2fae25592
commit dbcccc090b
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
3 changed files with 15 additions and 1 deletions

View file

@ -18,6 +18,7 @@ opencloud_port: 9200
opencloud_admin_password: "admin"
opencloud_log_level: "warn"
opencloud_extra_hosts: []
opencloud_extra_networks: []
# Traefik configuration
opencloud_traefik_network: "proxy"

View file

@ -69,6 +69,12 @@
when: opencloud_drawio_url | length > 0
notify: restart opencloud
- name: Ensure extra networks exist
community.docker.docker_network:
name: "{{ item }}"
state: present
loop: "{{ opencloud_extra_networks }}"
- name: Create docker-compose file for opencloud
template:
src: docker-compose.yml.j2

View file

@ -103,6 +103,9 @@ services:
{% endif %}
networks:
- {{ opencloud_traefik_network }}
{% for net in opencloud_extra_networks %}
- {{ net }}
{% endfor %}
{% if opencloud_extra_hosts is defined and opencloud_extra_hosts | length > 0 %}
extra_hosts:
{% for host in opencloud_extra_hosts %}
@ -135,4 +138,8 @@ services:
networks:
{{ opencloud_traefik_network }}:
external: true
external: true
{% for net in opencloud_extra_networks %}
{{ net }}:
external: true
{% endfor %}