From b4758ee0e120d9ab4ad4292e77307ab7de84640e Mon Sep 17 00:00:00 2001 From: fencl Date: Fri, 3 Oct 2025 14:12:14 +0200 Subject: [PATCH] Refactor health check playbook to ensure script existence before upload and restore requirements.yml for Nextcloud collections --- nextcloud/check_stack_nextcloud.yml | 11 ++--------- .../collections/requirements.yml => requirements.yml | 0 2 files changed, 2 insertions(+), 9 deletions(-) rename nextcloud/collections/requirements.yml => requirements.yml (100%) diff --git a/nextcloud/check_stack_nextcloud.yml b/nextcloud/check_stack_nextcloud.yml index 5fe050f..9bd48d1 100644 --- a/nextcloud/check_stack_nextcloud.yml +++ b/nextcloud/check_stack_nextcloud.yml @@ -1,24 +1,17 @@ --- - name: Upload and run stack health checks hosts: proxmox - gather_facts: false - become: false + become: true vars: health_script_path: /data/compose/nextcloud/stack-health.sh tasks: - - name: Ensure script exists (upload if missing) - ansible.builtin.stat: - path: "{{ health_script_path }}" - register: hs - - name: Upload stack-health.sh ansible.builtin.copy: src: files/stack-health.sh dest: "{{ health_script_path }}" mode: '0755' - when: not hs.stat.exists - name: Run stack-health.sh ansible.builtin.shell: "{{ health_script_path }}" @@ -30,7 +23,7 @@ ansible.builtin.debug: msg: "{{ health.stdout | default('no stdout') }}" - - name: Fail if checks failed + - name: Fail if checks failed (rc != 0) ansible.builtin.fail: msg: "Health checks failed" when: health.rc != 0 \ No newline at end of file diff --git a/nextcloud/collections/requirements.yml b/requirements.yml similarity index 100% rename from nextcloud/collections/requirements.yml rename to requirements.yml