]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Ensuring create-motd.sh on Cobbler Webserver
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 17 Jun 2020 14:32:33 +0000 (16:32 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 17 Jun 2020 14:32:33 +0000 (16:32 +0200)
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/handler.py

index f91294f218dcfffed2659b8a25f7285751a2969f..4590aec002504b46a343620f7f7151e1c79310d0 100644 (file)
@@ -40,7 +40,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.5.8'
+__version__ = '0.5.9'
 
 LOG = logging.getLogger(__name__)
 
@@ -641,6 +641,20 @@ class Cobbler(BaseHandler):
                 loc=str(local_rc_file), rem=str(remote_rc_file)))
             self.ensure_remote_file(local_rc_file, remote_rc_file, check_parent=False)
 
+    # -------------------------------------------------------------------------
+    def ensure_create_motd(self):
+
+        local_script = self.base_dir / 'bin' / 'create-motd.sh'
+        docroot = self.config.cobbler_ws_docroot / self.config.cobbler_ws_rel_filesdir
+        remote_dir = docroot / self.config.system_status
+        remote_script = remote_dir / local_script.name
+
+        LOG.info(_("Ensuring currentness of create-motd.sh."))
+
+        LOG.debug(_("Ensuring {loc!r} => {rem!r}.").format(
+            loc=str(local_script), rem=str(remote_script)))
+        self.ensure_remote_file(local_script, remote_script, check_parent=False)
+
     # -------------------------------------------------------------------------
     def add_system(self, name, fqdn, mac_address, comment=None):
         """Creating a new system."""
index 275c578a7e891ccf1963f8afe13a83f72bc32cb8..38c37fee8141af5e4342f90204c5954596a4e22f 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.6.3'
+__version__ = '1.6.4'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -234,6 +234,7 @@ class CrTplHandler(BaseHandler):
         self.cobbler.ensure_keys()
         self.cobbler.ensure_repo_files()
         self.cobbler.ensure_bashrc()
+        self.cobbler.ensure_create_motd()
 
         self.vsphere.get_about()
         self.vsphere.get_clusters()