From: Frank Brehm Date: Wed, 17 Mar 2021 10:50:01 +0000 (+0100) Subject: Ensuring rsyslog config file templates X-Git-Tag: 2.2.5^2~4^2~2 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=b664b6251eb4915b3702287427b4ba1dbe6df69c;p=pixelpark%2Fcreate-vmware-tpl.git Ensuring rsyslog config file templates --- diff --git a/lib/cr_vmware_tpl/cobbler.py b/lib/cr_vmware_tpl/cobbler.py index b1bba83..100c1d1 100644 --- a/lib/cr_vmware_tpl/cobbler.py +++ b/lib/cr_vmware_tpl/cobbler.py @@ -40,7 +40,7 @@ from .config import CrTplConfiguration from .xlate import XLATOR -__version__ = '0.6.3' +__version__ = '0.6.4' LOG = logging.getLogger(__name__) @@ -430,6 +430,19 @@ class Cobbler(BaseHandler): self.ensure_remote_file(local_file, remote_file) + # ------------------------------------------------------------------------- + def ensure_rsyslog_cfg_files(self): + + remote_dir = docroot / self.config.system_status + + LOG.info(_("Ensuring correctness of rsyslog config files ...")) + + for local_cfg_file in self.base_dir.glob('*rsyslog.conf*'): + remote_cfg_file = remote_dir / local_cfg_file.name + LOG.debug(_("Ensuring {loc!r} => {rem!r}.").format( + loc=str(local_cfg_file), rem=str(remote_cfg_file))) + self.ensure_remote_file(local_cfg_file, remote_cfg_file, check_parent=False) + # ------------------------------------------------------------------------- def ensure_profile_ks(self): diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index ecc1fce..03b6c05 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -44,7 +44,7 @@ from .cobbler import Cobbler from .xlate import XLATOR -__version__ = '1.8.3' +__version__ = '1.8.4' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -257,6 +257,7 @@ class CrTplHandler(BaseHandler): self.check_for_cobbler_distro() self.cobbler.ensure_profile() self.cobbler.ensure_root_authkeys() + self.cobbler.ensure_rsyslog_cfg_files() self.cobbler.ensure_system_ks() self.cobbler.ensure_snippets() self.cobbler.ensure_keys()