]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Fixing postinstall-scripts/init-puppet
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 12 Oct 2022 16:13:25 +0000 (18:13 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 12 Oct 2022 16:13:25 +0000 (18:13 +0200)
postinstall-scripts/init-puppet

index f7aa951f829176bfb1f053da0434024404563317..5b71e7f9f2e417a1db7836dc0a7c2646c0ff3327 100755 (executable)
@@ -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"