---
- name: π Resolve SuiteCRM partner coupling facts
set_fact:
nextcloud_crm_container: "{{ lookup('config', 'web-app-suitecrm', 'services.suitecrm.name') }}"
nextcloud_crm_instance_dir: "{{ lookup('container', 'web-app-suitecrm', 'directories.instance') }}"
nextcloud_crm_base_url: "{{ lookup('tls', 'web-app-suitecrm', 'url.origin') }}"
nextcloud_crm_client_name: "Nextcloud ({{ lookup('domain', 'web-app-nextcloud') }})"
nextcloud_crm_client_secret: "{{ lookup('config', application_id, 'secrets.credentials.integration_suitecrm_client_secret') }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: π Probe whether the SuiteCRM partner container is running
command: > # nocheck: container-exec-resolver this IS the bare-name partner probe gate, compose co-location
container inspect --type container -f '{% raw %}{{.State.Running}}{% endraw %}' {{ nextcloud_crm_container }}
register: integration_suitecrm_partner_running
changed_when: false
failed_when: false
- name: π§ Provision the bidirectional SuiteCRM <-> Nextcloud OAuth coupling
include_tasks: "{{ [role_path, 'tasks/addons/integration_suitecrm_provision.yml'] | path_join }}"
when: (integration_suitecrm_partner_running.stdout | trim) == 'true'