From ed7dbeb43dc80069c7cae2a94e19fb0ce31d8dd5 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 12 Oct 2022 18:13:25 +0200 Subject: [PATCH] Fixing postinstall-scripts/init-puppet --- postinstall-scripts/init-puppet | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/postinstall-scripts/init-puppet b/postinstall-scripts/init-puppet index f7aa951..5b71e7f 100755 --- a/postinstall-scripts/init-puppet +++ b/postinstall-scripts/init-puppet @@ -734,8 +734,8 @@ generate_facts() { debug "Generatet content of '${yfile}':\n${content}" echo "${content}" > "${yfile}" - if [[ "${INITIAL_INSTALL}" ]] ; then - yfile="${facts_dir}/initial_install.yaml" + yfile="${facts_dir}/initial_install.yaml" + if [[ "${INITIAL_INSTALL}" == "y" ]] ; then info "Generating '${GREEN}${yfile}${NORMAL}' ..." content=$( cat <<-EOF --- @@ -744,6 +744,9 @@ generate_facts() { ) debug "Generatet content of '${yfile}':\n${content}" echo "${content}" > "${yfile}" + elif [[ -f "${yfile}" ]] ; then + info "Removing '${GREEN}${yfile}${NORMAL}' ..." + RM "${yfile}" fi wrong_file="${facts_dir}/host" -- 2.39.5