]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding and using some snippets
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 17 Jun 2020 11:03:21 +0000 (13:03 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 17 Jun 2020 11:03:21 +0000 (13:03 +0200)
kickstart/template-centos8.ks
snippets/tpl.200.init-repos.sh [new file with mode: 0644]
snippets/tpl.999.finish.sh [new file with mode: 0644]

index 6836a99eb3ced645787382f631686f36044635e5..e8d40597f5931743d23b333a56676d7571c5ca8f 100644 (file)
@@ -105,8 +105,9 @@ yum-utils
 %post --interpreter=/usr/bin/bash
 
 ### output to console
+mkdir -p "/var/log/anaconda"
 clear
-POST_LOG="/var/log/post-install.log"
+POST_LOG="/var/log/anaconda/post-install.log"
 exec < /dev/console &> >(tee -a "$POST_LOG")
 
 ######################################################################################
@@ -189,4 +190,18 @@ echo
 echo "Using snippet $get_repos_snippet"
 $SNIPPET($get_repos_snippet)
 
+#set $init_repos_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.200.init-repos.sh"
+echo
+echo "Using snippet $init_repos_snippet"
+$SNIPPET($init_repos_snippet)
+
+
+
+
+
+#set $finish_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.999.finish.sh"
+echo
+echo "Using snippet $finish_snippet"
+$SNIPPET($finish_snippet)
+
 %end
diff --git a/snippets/tpl.200.init-repos.sh b/snippets/tpl.200.init-repos.sh
new file mode 100644 (file)
index 0000000..6cd9863
--- /dev/null
@@ -0,0 +1,20 @@
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+init_yum_repos() {
+
+    echo
+    echo "${HASH_LINE}"
+    echo
+    log "Cleaning YUM repos and making cache ..."
+
+    yum clean all
+    yum makecache
+
+}
+
+init_yum_repos
+
+#end raw
+## vim: ts=4 et list
diff --git a/snippets/tpl.999.finish.sh b/snippets/tpl.999.finish.sh
new file mode 100644 (file)
index 0000000..1514caf
--- /dev/null
@@ -0,0 +1,30 @@
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+finish_all() {
+
+    echo
+    echo "${HASH_LINE}"
+    echo
+    log "Finishing post install tasks ..."
+
+    local wait_for=5
+    local i=${wait_for}
+
+    while [[ "${i}" -gt 0 ]] ; do
+        printf "."
+        sleep 1
+        i=$(( $i - 1 ))
+    done
+
+    echo
+    echo "${HASH_LINE}"
+    echo "Done."
+    echo
+}
+
+finish_all
+
+#end raw
+## vim: ts=4 et list