feat: add provisioning of apps to nextcloud role

This commit is contained in:
Bert-Jan Fikse 2026-01-16 15:53:36 +01:00
parent ea8178fcf0
commit bce1daf5a6
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
2 changed files with 32 additions and 1 deletions

View file

@ -46,4 +46,13 @@ nextcloud_admin_password: admin
nextcloud_memory_limit_mb: 1024 nextcloud_memory_limit_mb: 1024
nextcloud_upload_limit_mb: 2048 nextcloud_upload_limit_mb: 2048
nextcloud_scale_factor: 2 nextcloud_scale_factor: 2
# Non-default apps to install and enable
nextcloud_apps_to_install:
- groupfolders
- richdocuments
- spreed
- user_ldap
- user_oidc
- whiteboard

View file

@ -1,3 +1,25 @@
#SPDX-License-Identifier: MIT-0 #SPDX-License-Identifier: MIT-0
--- ---
# tasks file for installing Nextcloud plugins/apps # tasks file for installing Nextcloud plugins/apps
- name: Install Nextcloud apps
ansible.builtin.shell:
cmd: docker compose exec -T nextcloud php /var/www/html/occ app:install {{ item }}
chdir: "{{ nextcloud_docker_compose_dir }}"
loop: "{{ nextcloud_apps_to_install }}"
register: app_install_result
changed_when: "'installed' in app_install_result.stdout"
failed_when:
- app_install_result.rc != 0
- "'already installed' not in app_install_result.stdout"
- name: Enable Nextcloud apps
ansible.builtin.shell:
cmd: docker compose exec -T nextcloud php /var/www/html/occ app:enable {{ item }}
chdir: "{{ nextcloud_docker_compose_dir }}"
loop: "{{ nextcloud_apps_to_install }}"
register: app_enable_result
changed_when: "'enabled' in app_enable_result.stdout"
failed_when:
- app_enable_result.rc != 0
- "'already enabled' not in app_enable_result.stdout"