--- # ================================================================= # Nextcloud Configuration via Script # ================================================================= # Rick-Infra - Nextcloud Role # # Deploys and runs a configuration script inside the Nextcloud # container to set system configuration via OCC commands. - name: Deploy Nextcloud configuration script template: src: configure-nextcloud.sh.j2 dest: "{{ nextcloud_config_dir }}/configure.sh" mode: '0755' tags: [config, nextcloud-config] - name: Run Nextcloud configuration script command: podman exec --user www-data nextcloud bash /var/www/html/config/configure.sh register: nc_config_result changed_when: false # Script output doesn't indicate changes reliably failed_when: nc_config_result.rc != 0 tags: [config, nextcloud-config] - name: Display configuration script output debug: msg: "{{ nc_config_result.stdout_lines }}" when: nc_config_result.stdout | length > 0 tags: [config, nextcloud-config] - name: Display configuration script errors debug: msg: "{{ nc_config_result.stderr_lines }}" when: - nc_config_result.stderr | length > 0 - nc_config_result.rc != 0 tags: [config, nextcloud-config]