From b664b6251eb4915b3702287427b4ba1dbe6df69c Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 17 Mar 2021 11:50:01 +0100 Subject: [PATCH] Ensuring rsyslog config file templates --- lib/cr_vmware_tpl/cobbler.py | 15 ++++++++++++++- lib/cr_vmware_tpl/handler.py | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) 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() -- 2.39.5