diff --git a/group_vars/all/07_applications.yml b/group_vars/all/07_applications.yml index 6f6dcaac..d67ec1a6 100644 --- a/group_vars/all/07_applications.yml +++ b/group_vars/all/07_applications.yml @@ -424,7 +424,7 @@ defaults_applications: enabled: true recognize: # Nextcloud recognize: performs image recognition tasks (https://apps.nextcloud.com/apps/recognize) - enabled: true + enabled: false # Deactivated because it let to bugs richdocuments: # Nextcloud Rich Documents: provides collaborative document editing capabilities (https://apps.nextcloud.com/apps/richdocuments) enabled: true @@ -446,9 +446,6 @@ defaults_applications: #terms_of_service # # Nextcloud Terms of Service: manages user acceptance of terms and conditions (https://apps.nextcloud.com/apps/terms_of_service) # enabled: false - twofactor_backupcodes: - # Nextcloud two-factor backup codes: generates backup codes for two-factor authentication (https://apps.nextcloud.com/apps/twofactor_backupcodes) - enabled: "{{ (not _applications_nextcloud_oidc_enabled) | lower }}" # Deactivate 2FA if oidc is active twofactor_nextcloud_notification: # Nextcloud two-factor notification: sends notifications for two-factor authentication events (https://apps.nextcloud.com/apps/twofactor_nextcloud_notification) enabled: "{{ (not _applications_nextcloud_oidc_enabled) | lower }}" # Deactivate 2FA if oidc is active diff --git a/roles/docker-nextcloud/tasks/plugin.yml b/roles/docker-nextcloud/tasks/plugin.yml index 95ee094e..054c880d 100644 --- a/roles/docker-nextcloud/tasks/plugin.yml +++ b/roles/docker-nextcloud/tasks/plugin.yml @@ -3,12 +3,27 @@ loop: "{{plugin_configuration.incompatible_plugins}}" loop_control: loop_var: incompatible_plugin - when: plugin_configuration.incompatible_plugins is defined and plugin_configuration.incompatible_plugins | length > 0 + register: disable_incompatible_plugin_result + changed_when: disable_incompatible_plugin_result.rc == 0 and ("No such app enabled" not in disable_incompatible_plugin_result.stdout) + when: + - plugin_configuration.incompatible_plugins is defined and plugin_configuration.incompatible_plugins | length > 0 + - plugin_configuration.enabled | bool + +- name: disable {{ plugin_name }} nextcloud plugin + command: "docker exec -u www-data {{ applications.nextcloud.container.application }} {{ nextcloud_docker_path }}occ app:disable {{ plugin_name }}" + register: disable_result + changed_when: disable_result.rc == 0 and ("No such app enabled" not in disable_result.stdout) + when: not (plugin_configuration.enabled | bool) - name: install {{ plugin_name }} nextcloud plugin command: "docker exec -u www-data {{ applications.nextcloud.container.application }} {{ nextcloud_docker_path }}occ app:install {{ plugin_name }}" register: install_result failed_when: install_result.rc != 0 and ("already installed" not in install_result.stdout) + changed_when: install_result.rc == 0 and ("already installed" not in install_result.stdout) + when: plugin_configuration.enabled | bool - name: enable {{plugin_name}} nextcloud plugin - command: "docker exec -u www-data {{applications.nextcloud.container.application}} {{nextcloud_docker_path}}occ app:enable {{plugin_name}}" \ No newline at end of file + command: "docker exec -u www-data {{applications.nextcloud.container.application}} {{nextcloud_docker_path}}occ app:enable {{plugin_name}}" + register: enable_result + changed_when: enable_result.rc == 0 and ("already enabled" not in enable_result.stdout) + when: plugin_configuration.enabled | bool \ No newline at end of file