Skip to content

Commit

Permalink
Merge pull request #33 from stackhpc/bugfix/config-diff-verbosity
Browse files Browse the repository at this point in the history
Add guards around backing up ANSIBLE_VERBOSITY
  • Loading branch information
jovial authored Apr 26, 2023
2 parents d9d1790 + a576a8b commit 5232d68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/config-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function post_config_init {
}

function redact_file {
_ANSIBLE_VERBOSITY=$ANSIBLE_VERBOSITY
if [ ! -z ${ANSIBLE_VERBOSITY:+x} ]; then
_ANSIBLE_VERBOSITY=$ANSIBLE_VERBOSITY
fi
unset ANSIBLE_VERBOSITY
if [ ! -f "$1" ]; then
log_info "Skipping redaction of: $1"
Expand All @@ -75,7 +77,9 @@ function redact_file {
$KAYOBE_AUTOMATION_UTILS_PATH/kayobe-automation-redact <($ANSIBLE_VAULT view --vault-password-file $KAYOBE_AUTOMATION_UTILS_PATH/kayobe-automation-vault-helper $1) >$1.redact
fi
mv $1.redact $1
export ANSIBLE_VERBOSITY=$_ANSIBLE_VERBOSITY
if [ ! -z ${_ANSIBLE_VERBOSITY:+x} ]; then
export ANSIBLE_VERBOSITY=$_ANSIBLE_VERBOSITY
fi
}

function encrypt_file {
Expand Down

0 comments on commit 5232d68

Please sign in to comment.