]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Starting with kssnippets
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 10 Jun 2020 16:27:10 +0000 (18:27 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 10 Jun 2020 16:27:10 +0000 (18:27 +0200)
lib/cr_vmware_tpl/cobbler.py
snippets/tpl.001.basics.sh [new file with mode: 0644]

index 810c3ff098fd8b9cb39c9a71c1971d3913a13a90..34d077fd1c56c161a81bd3df3a5d30f8304f01dc 100644 (file)
@@ -345,9 +345,10 @@ class Cobbler(BaseHandler):
         return profile_list
 
     # -------------------------------------------------------------------------
-    def ensure_remote_file(self, local_file, remote_file):
+    def ensure_remote_file(self, local_file, remote_file, check_parent=True):
 
-        self.check_remote_directory(remote_file.parent)
+        if check_parent:
+            self.check_remote_directory(remote_file.parent)
 
         if self.verbose > 1:
             msg = _("Checking remote file {rfile!r} based on local {lfile!r} ...").format(
@@ -607,6 +608,11 @@ class Cobbler(BaseHandler):
 
         self.ensure_remote_file(local_ks, remote_ks)
 
+    # -------------------------------------------------------------------------
+    def ensure_snippets(self):
+
+        local_snippets_dir = self.base_dir / 'snippets'
+
     # -------------------------------------------------------------------------
     def add_system(self, name, fqdn, mac_address, comment=None):
         """Creating a new system."""
diff --git a/snippets/tpl.001.basics.sh b/snippets/tpl.001.basics.sh
new file mode 100644 (file)
index 0000000..15e9720
--- /dev/null
@@ -0,0 +1,21 @@
+## !/bin/bash
+#raw
+
+HASH_LINE="#######################################################################################"
+
+echo "$(date --rfc-3339=seconds): Das ist das Post-Install-Script '$0'."
+echo
+
+if [[ -z "${hostname}" ]] ; then
+    hostname="template.pixelpark.com"
+fi
+IP_ADDRESS_ETH0=$( host "${hostname}" | sed -e 's/.*has address[       ][      ]*//' )
+DOMAIN=$( echo "${hostname}" | cut -d. -f2,3 )
+SIMPLE_HOSTNAME=$( echo "${hostname}" | cut -d. -f1 )
+
+if [[ -z "${ip_address_eth0}" ]] ; then
+    ip_address_eth0="${IP_ADDRESS_ETH0}"
+fi
+
+#end raw
+## vim: ts=4 et list