From fce544d6b5723ccef6b6c92f8d9d9d33cc974876 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 29 Nov 2022 13:47:41 +0100 Subject: [PATCH] better error reporting --- autoupdate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoupdate.yml b/autoupdate.yml index 471d12f..b0f130e 100644 --- a/autoupdate.yml +++ b/autoupdate.yml @@ -70,10 +70,10 @@ group: root create: yes marker: "# {mark} ANSIBLE MANAGED BLOCK" - block: | - [ -e /root/server-$(hostname -s)/$(hostname -s).sh ] && bash -ex /root/server-$(hostname -s)/$(hostname -s).sh >/var/log/server-$(hostname -s)-update.log 2>&1 + block: | + [ -e /root/server-$(hostname -s)/$(hostname -s).sh ] && bash -x /root/server-$(hostname -s)/$(hostname -s).sh >/var/log/server-$(hostname -s)-update.log 2>&1 g_echo_warn "$(egrep -B1 "^changed" /var/log/server-$(hostname -s)-update.log)" - g_echo_error "$(egrep -q -B1 -i "^error|^fatal" /var/log/server-$(hostname -s)-update.log && tail -n 50 /var/log/server-$(hostname -s)-update.log)" + g_echo_error "$(egrep -q -B1 -i '^error|^fatal' /var/log/server-$(hostname -s)-update.log && egrep -B50 '^error|^fatal' /var/log/server-$(hostname -s)-update.log)" backup: yes validate: /bin/bash -n %s