---
# Generic config sets only `url`; the OAuth connect flow additionally needs the
# admin keys oauth_instance_url/client_id/client_secret, which only exist once an
# OAuth app is registered on Mattermost. This hook provisions that app on the
# partner and wires the returned credentials into Nextcloud.
- name: π Resolve Mattermost partner coupling facts
set_fact:
nextcloud_mm_base_url: "{{ lookup('tls', 'web-app-mattermost', 'url.origin') }}"
nextcloud_mm_local_url: "http://{{ DOCKER_REACH_HOST }}:{{ lookup('config', 'web-app-mattermost', 'services.mattermost.ports.local.http') }}"
nextcloud_mm_redirect_path: "/apps/integration_mattermost/oauth-redirect"
nextcloud_mm_exec_chdir: "{{ lookup('container', 'web-app-mattermost', 'directories.instance') if IS_COMPOSE_MODE else omit }}"
changed_when: false
- name: π§ Provision the bidirectional Mattermost <-> Nextcloud OAuth coupling
include_tasks: integration_mattermost_provision.yml
when:
- IS_STACK_HOST | bool