From b7f6d38a32a0888a9f8385664e85902b69e9e221 Mon Sep 17 00:00:00 2001 From: fencl Date: Sun, 5 Oct 2025 09:22:42 +0200 Subject: [PATCH] Refactor update_collabora.yml: add comprehensive maintenance and update commands for Nextcloud and Collabora with error handling --- nextcloud/update_collabora.yml | 154 +++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 nextcloud/update_collabora.yml diff --git a/nextcloud/update_collabora.yml b/nextcloud/update_collabora.yml new file mode 100644 index 0000000..0f758f3 --- /dev/null +++ b/nextcloud/update_collabora.yml @@ -0,0 +1,154 @@ +# """ +# Run the command and check the response. +# +# :parameter command: The command to be executed. +# :parameter add_command: Whether to include the command in the database values. +# :parameter add_response: Whether to include the response in the database values. +# :parameter measurement: The measurement index for the command. +# :parameter measure_retries: The number of retries for measurement in case of failure. +# :parameter check_port: Whether to check the port before sending the command. +# :parameter response_equals: The expected response string to compare against. +# :parameter response_length: The expected length or format of the response. +# :parameter send_skipped: Whether to mark the test as skipped without execution. +# :parameter no_response: Whether to expect no response from the command. +# :parameter expect_patch_id_decimal: The expected patch ID in decimal format for validation. +# :parameter response_equals_match: The expected response string to match against. +# :return: RunResultType +# """ + +- name: Run Nextcloud maintenance on VM via Proxmox + hosts: proxmox + gather_facts: false + become: true + become_user: root + become_method: sudo + + vars: + vm_ip: "{{ lookup('env', 'VM_IP') }}" + vm_user: "{{ lookup('env', 'VM_USER') }}" + vm_pass: "{{ lookup('env', 'VM_PASS') }}" + + # Flip to true if Docker needs sudo on the VM + use_sudo: false + + # ---------- Collabora settings ---------- + collabora_project: "nextcloud-collabora" + collabora_compose_file: "/data/compose/nextcloud/collabora-only.yml" + + # ---------- Nextcloud commands ---------- + vm_commands: + - "docker exec -u www-data nextcloud php -f /var/www/html/cron.php" + - "docker exec -u www-data nextcloud php occ app:update --all" + - "docker exec -u www-data nextcloud php occ maintenance:repair --include-expensive" + - "docker exec -u www-data nextcloud php occ status" + # English comments: run health script non-interactively with a timeout and xtrace for debugging + - "set -o pipefail; timeout 180s bash -x /data/compose/nextcloud/stack-health.sh