forked from jakub/ansible
test3
This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user