This commit is contained in:
martin.fencl
2026-08-06 18:04:05 +02:00
parent 4239ab4ed0
commit feec8ec7a3
2 changed files with 282 additions and 315 deletions
+16 -11
View File
@@ -8,7 +8,6 @@
become_method: sudo
vars:
# Internal normalized variables
vm_use_sudo: "{{ use_sudo | default(false) | bool }}"
vm_commands:
@@ -30,8 +29,8 @@
- >-
set -o pipefail;
timeout 180s bash -x
/data/compose/nextcloud/stack-health.sh
timeout 180s
bash -x /data/compose/nextcloud/stack-health.sh
</dev/null
pre_tasks:
@@ -46,7 +45,7 @@
- vm_pass | string | length > 0
fail_msg: >-
Missing vm_ip, vm_user or vm_pass.
Configure these variables in the attached Semaphore Variable Group.
Configure them in the attached Semaphore Variable Group.
quiet: true
no_log: true
@@ -69,13 +68,17 @@
- UserKnownHostsFile=/dev/null
- -o
- ConnectTimeout=15
- -o
- ServerAliveInterval=10
- -o
- ServerAliveCountMax=3
- "{{ vm_user }}@{{ vm_ip }}"
- >-
{{
('sudo -n bash -lc ' + (item | quote))
('sudo -n bash -lc ' ~ (item | quote))
if vm_use_sudo
else
('bash -lc ' + (item | quote))
('bash -lc ' ~ (item | quote))
}}
environment:
SSHPASS: "{{ vm_pass }}"
@@ -91,10 +94,12 @@
msg: |
CMD: {{ item.item }}
RC: {{ item.rc }}
STDOUT:
{{ (item.stdout | default('') | trim) }}
{{ item.stdout | default('') | trim }}
STDERR:
{{ (item.stderr | default('') | trim) }}
{{ item.stderr | default('') | trim }}
loop: "{{ vm_cmds.results }}"
loop_control:
label: "{{ item.item }}"
@@ -103,13 +108,13 @@
ansible.builtin.assert:
that:
- item.rc == 0
fail_msg: >-
fail_msg: |
Command failed on VM: {{ item.item }}
(rc={{ item.rc }})
RC: {{ item.rc }}
STDERR:
{{ item.stderr | default('') | trim }}
quiet: true
loop: "{{ vm_cmds.results }}"
loop_control:
label: "{{ item.item }}"
label: "{{ item.item }}"