--- - name: "set local variables from overrides and defaults" set_fact: nextcloud: "{{ (nextcloud_defaults | combine(nextcloud_override, recursive=True)) if nextcloud_override else nextcloud_defaults }}" - name: ensure that path exists file: path: "{{ path }}/config/nextcloud" state: directory - name: template compose template: src: compose.yml.j2 dest: "{{ path }}/compose.yml" - name: template nc config template: src: importconfig.json.j2 dest: "{{ path }}/config/nextcloud/importconfig.json" register: _importconfig - import_role: name: storage_mount vars: storagebox_override: host: "{{ nextcloud.networkmount.host }}" host_path: "{{ nextcloud.networkmount.host_path }}" args: "{{ nextcloud.networkmount.args }}" dest_path: "{{ nextcloud.data_path }}" when: nextcloud.networkmount.host | length > 1 - name: ensure containers are running community.docker.docker_compose_v2: project_src: "{{ path }}" project_name: "{{ role_name }}" state: "present" pull: "always" wait: true services: >- {{ ['db', 'redis', 'nextcloud'] + (['collabora'] if nextcloud.collabora.url | default('') else []) + (['drawio'] if nextcloud.drawio.url | default('') else []) }} register: _compose_result - name: import config community.docker.docker_container_exec: container: "{{ nextcloud_container }}" chdir: "/var/www/html/" user: "www-data" command: "php occ config:import /tmp/importconfig.json" when: "_importconfig.changed or 'installed: false' in nextcloud_status_check.stdout"