Skip to content

Add guards around backing up ANSIBLE_VERBOSITY #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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