3
0
forked from jakub/ansible

Refactor health check playbook to update host target from 'proxmox' to 'nextcloud_stack' and streamline stack health script content

This commit is contained in:
fencl
2025-10-03 14:32:32 +02:00
parent bbc27cb2f6
commit d40bb2984b
2 changed files with 8 additions and 9 deletions

5
inv_linuxes_portainer Normal file
View File

@@ -0,0 +1,5 @@
[linux_servers]
proxmox ansible_host=192.168.69.2
[nextcloud_stack]
vm_portainer ansible_host=192.168.69.X ansible_user=root ansible_python_interpreter=/usr/bin/python3

View File

@@ -1,12 +1,11 @@
# Comments in English in code:
---
- name: Upload and run stack health checks
hosts: proxmox
hosts: nextcloud_stack # <-- dříve 'proxmox'
gather_facts: false
become: false
vars:
health_script_path: /data/compose/nextcloud/stack-health.sh
tasks:
- name: Ensure target directory exists
ansible.builtin.file:
@@ -18,7 +17,6 @@
ansible.builtin.copy:
dest: "{{ health_script_path }}"
mode: '0755'
# Comments in English: wrap the whole script with {% raw %} ... {% endraw %} so Jinja doesn't eat {{...}} in bash.
content: |-
{% raw %}
#!/usr/bin/env bash
@@ -167,11 +165,7 @@
echo "ALL CHECKS PASSED ✅"
else
echo "----------------------------------------"
echo "ONE OR MORE CHECKS FAILED ❌ (see above)"
fi
exit "$EXIT"
{% endraw %}
- name: Run stack-health.sh
ansible.builtin.shell: "{{ health_script_path }}"