From: Frank Brehm Date: Tue, 9 Jun 2020 08:02:45 +0000 (+0200) Subject: Defining Domain for template VM X-Git-Tag: 2.1.2^2~9^2~31^2~75 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=99fd6d3d07e5fd53f36cc596ef131004c21356db;p=pixelpark%2Fcreate-vmware-tpl.git Defining Domain for template VM --- diff --git a/etc/create-vmware-template.ini.default b/etc/create-vmware-template.ini.default index f08e18b..ebf4216 100644 --- a/etc/create-vmware-template.ini.default +++ b/etc/create-vmware-template.ini.default @@ -18,6 +18,8 @@ ;vm_id = centos8 +;vm_domain = pixelpark.com + ;vm = template.pixelpark.com ;vmware_cfg_version = vmx-14 diff --git a/lib/cr_vmware_tpl/cobbler.py b/lib/cr_vmware_tpl/cobbler.py index 7328e30..83a5aa0 100644 --- a/lib/cr_vmware_tpl/cobbler.py +++ b/lib/cr_vmware_tpl/cobbler.py @@ -37,7 +37,7 @@ from .config import CrTplConfiguration from .xlate import XLATOR -__version__ = '0.4.0' +__version__ = '0.4.1' LOG = logging.getLogger(__name__) diff --git a/lib/cr_vmware_tpl/config.py b/lib/cr_vmware_tpl/config.py index 12aab8f..24be0b4 100644 --- a/lib/cr_vmware_tpl/config.py +++ b/lib/cr_vmware_tpl/config.py @@ -21,7 +21,7 @@ from fb_tools.config import ConfigError, BaseConfiguration from .xlate import XLATOR -__version__ = '1.5.0' +__version__ = '1.5.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -70,6 +70,8 @@ class CrTplConfiguration(BaseConfiguration): max_max_wait_for_finish_install = 24 * 60 * 60 limit_max_nr_templates_stay = 100 + default_tpl_vm_domain = 'pixelpark.com' + default_cobbler_host = 'cobbler.pixelpark.com' default_cobbler_ssh_port = 22 default_cobbler_ssh_user = 'root' @@ -129,6 +131,8 @@ class CrTplConfiguration(BaseConfiguration): self.vmware_cfg_version = self.default_vmware_cfg_version self.os_version = self.default_os_version + self.tpl_vm_domain = self.default_tpl_vm_domain + self._cobbler_profile_given = False self._template_name_given = False @@ -321,6 +325,7 @@ class CrTplConfiguration(BaseConfiguration): re_os_id = re.compile(r'^\s*os[-_]?id\s*$', re.IGNORECASE) re_os_id_subst = re.compile(r'[^a-z0-9_-]+', re.IGNORECASE) + re_vm_domain = re.compile(r'^\s*(?:vm[-_]?)?domain\s*$', re.IGNORECASE) for (key, value) in config.items(section_name): if key.lower() == 'vm': @@ -336,6 +341,9 @@ class CrTplConfiguration(BaseConfiguration): self.template_name = value self._template_name_given = True continue + elif re_vm_domain.match(key) and value.strip(): + self.tpl_vm_domain = value.strip().lower() + continue elif key.lower() == 'data_size_gb': self.data_size_gb = float(value) continue diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 015bdb2..fd72caa 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -40,7 +40,7 @@ from .cobbler import CobblerError, Cobbler from .xlate import XLATOR -__version__ = '1.4.6' +__version__ = '1.5.0' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -97,6 +97,7 @@ class CrTplHandler(BaseHandler): self.tpl_data_store = None self.tpl_network = None self.tpl_vm = None + self.tpl_vm_hostname = None self.ts_start_install = None self.ts_finish_install = None self.initial_sleep = 60 @@ -130,6 +131,11 @@ class CrTplHandler(BaseHandler): self.initialized = True self.vsphere.initialized = True + # ------------------------------------------------------------------------- + @property + def tpl_vm_hostname_base(self): + + # ------------------------------------------------------------------------- def __call__(self): """Executing the underlying action."""