]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Defining Domain for template VM
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 9 Jun 2020 08:02:45 +0000 (10:02 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 9 Jun 2020 08:02:45 +0000 (10:02 +0200)
etc/create-vmware-template.ini.default
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/config.py
lib/cr_vmware_tpl/handler.py

index f08e18b924f4657f1c7a84de1d206f6a760e4f44..ebf42162a632fb9499e7c4c3aa8c7b7508ccdef6 100644 (file)
@@ -18,6 +18,8 @@
 
 ;vm_id = centos8
 
+;vm_domain = pixelpark.com
+
 ;vm = template.pixelpark.com
 
 ;vmware_cfg_version = vmx-14
index 7328e3053bba004591621134c325dc197ddfec00..83a5aa0d7f17d659f0d81605febea9c6112dbc43 100644 (file)
@@ -37,7 +37,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.4.0'
+__version__ = '0.4.1'
 
 LOG = logging.getLogger(__name__)
 
index 12aab8fe29853821bbba9c5e096d5346eded8893..24be0b4ed975595f506333c5c7eb8e41c02709c8 100644 (file)
@@ -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
index 015bdb2c1174c1faed5c220f71282ba26e5a07a8..fd72caa840c09cd3642a3ef8d897f2dede5b3a26 100644 (file)
@@ -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."""