]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Ensuring existence of logrotate files on the webserver.
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 19 Jun 2020 14:14:55 +0000 (16:14 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 19 Jun 2020 14:14:55 +0000 (16:14 +0200)
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/handler.py

index 2349dcc2658ba548dab595a9aa71c6e51cb770a9..21e2c144175fae25a73c1bec5befcd622e7ffe4a 100644 (file)
@@ -40,7 +40,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.5.10'
+__version__ = '0.5.11'
 
 LOG = logging.getLogger(__name__)
 
@@ -641,6 +641,21 @@ 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_logrotate_files(self):
+
+        files_dir = self.base_dir / 'files'
+        docroot = self.config.cobbler_ws_docroot / self.config.cobbler_ws_rel_filesdir
+        remote_dir = docroot / self.config.system_status
+
+        LOG.info(_("Ensuring currentness of logrotate files."))
+
+        for local_file in files_dir.glob('logrotate*'):
+            remote_file = remote_dir / local_file.name
+            LOG.debug(_("Ensuring {loc!r} => {rem!r}.").format(
+                loc=str(local_file), rem=str(remote_file)))
+            self.ensure_remote_file(local_file, remote_file, check_parent=False)
+
     # -------------------------------------------------------------------------
     def ensure_create_motd(self):
 
index 98113ac667b3adf9a0c0d1f1df60ada6b0cc4746..3758f941fe0ae25a5bc41f7dd2b4708379617d46 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.6.5'
+__version__ = '1.6.6'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -236,6 +236,7 @@ class CrTplHandler(BaseHandler):
         self.cobbler.ensure_bashrc()
         self.cobbler.ensure_create_motd()
         self.cobbler.ensure_postfix_files()
+        self.cobbler.ensure_logrotate_files()
 
         self.vsphere.get_about()
         self.vsphere.get_clusters()