03_enable.ymlยถ

---
- name: ๐ŸŸข enable {{ plugin_key }} nextcloud plugin
  shell: "{{ NEXTCLOUD_DOCKER_EXEC_OCC }} app:enable {{ plugin_key }}"
  register: enable_result
  failed_when: >
    enable_result.rc != 0
    and not (enable_result | nextcloud_install_status).incompatible
  changed_when: >
    enable_result.rc == 0
    and ("already enabled" not in enable_result.stdout)

- name: "๐Ÿ”‘ Classify {{ plugin_key }} enable result"
  ansible.builtin.set_fact:
    plugin_enable_incompatible: "{{ (enable_result | nextcloud_install_status).incompatible }}"

- name: "๐Ÿ”ด Skip {{ plugin_key }}: incompatible with Nextcloud version (enable+configure)"
  ansible.builtin.debug:
    msg: >-
      Plugin '{{ plugin_key }}' enable refused by occ: not compatible with the
      currently pinned Nextcloud server version. Skipping configure for this run.
  when: plugin_enable_incompatible

- name: "๐Ÿงฎ Queue {{ plugin_key }} for the batched configuration"
  ansible.builtin.set_fact:
    nextcloud_plugin_configure_keys: "{{ nextcloud_plugin_configure_keys + [plugin_key] }}"
  when: not plugin_enable_incompatible