From 9a7956e918068fdc013302ce75e6d53e0a689474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20W=C3=BCrsten?= Date: Thu, 4 May 2023 11:36:36 +0200 Subject: [PATCH] feat: add possibilty to always verbose output --- defaults/main.yml | 2 ++ templates/usr/bin/potos-ansible-pull.j2 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index bb78e57..3676f84 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,6 +14,8 @@ potos_basics_runtypes: on_calendar: 'hourly' - runtype: 'setup' +potos_basics_always_verbose: false + potos_basics_on_error_additional_lines: - "Contact your local administrator at admin@example.com" diff --git a/templates/usr/bin/potos-ansible-pull.j2 b/templates/usr/bin/potos-ansible-pull.j2 index 04ba52b..7eef3d1 100644 --- a/templates/usr/bin/potos-ansible-pull.j2 +++ b/templates/usr/bin/potos-ansible-pull.j2 @@ -99,10 +99,12 @@ while :; do shift done +{% if not potos_basics_always_verbose | default(false) %} # if not verbose, pipe everything to /dev/null if ! $VERBOSE; then exec >/dev/null 2>&1 fi +{% endif %} # Check if working directory exists [ -d '{{ potos_basics_ansible_workdir }}' ] || mkdir -p {{ potos_basics_ansible_workdir }}