From 25463e6013a2d387e48916b496a860cfe7d56ae1 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Fri, 3 Feb 2023 16:04:51 +0100 Subject: [PATCH 1/2] respect COSMOS_VERBOSE --- global/pre-tasks.d/015set-overlay-permissions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/global/pre-tasks.d/015set-overlay-permissions b/global/pre-tasks.d/015set-overlay-permissions index 373ef68..37f9844 100755 --- a/global/pre-tasks.d/015set-overlay-permissions +++ b/global/pre-tasks.d/015set-overlay-permissions @@ -15,5 +15,9 @@ if ! test -d "$MODEL_OVERLAY"; then fi if [ -d "$MODEL_OVERLAY/root" ]; then - chmod -v 0700 "$MODEL_OVERLAY"/root + args="" + if [ "x$COSMOS_VERBOSE" = "xy" ]; then + args="-v" + fi + chmod ${args} 0700 "$MODEL_OVERLAY"/root fi From 708c6c1b64faa7e175133bc9d96dc2d082708477 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Fri, 3 Feb 2023 16:05:09 +0100 Subject: [PATCH 2/2] add set -e, and do some shellcheck cleanup --- global/post-tasks.d/030puppet | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/global/post-tasks.d/030puppet b/global/post-tasks.d/030puppet index af45005..561ebc4 100755 --- a/global/post-tasks.d/030puppet +++ b/global/post-tasks.d/030puppet @@ -1,13 +1,15 @@ #!/bin/sh +set -e + if [ "x$COSMOS_VERBOSE" = "xy" ]; then args="--verbose --show_diff" else args="--logdest=syslog" fi -if [ -f /usr/bin/puppet -a -d /etc/puppet/manifests ]; then - for m in `find /etc/puppet/manifests -name \*.pp`; do +if [ -f /usr/bin/puppet ] && [ -d /etc/puppet/manifests ]; then + find /etc/puppet/manifests -name \*.pp | while read -r m; do test "x$COSMOS_VERBOSE" = "xy" && echo "$0: Applying Puppet manifest $m" puppet apply $args $m done