]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding URL of the RHEL-9 repo server to configuration.
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 17 Nov 2023 15:31:21 +0000 (16:31 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 17 Nov 2023 15:31:21 +0000 (16:31 +0100)
etc/create-vmware-template.ini.default
lib/cr_vmware_tpl/config/__init__.py
lib/cr_vmware_tpl/config/eval.py

index 0118d72c7159a81e6bb46f769b445e96bd567154..6702d525c3e9c17a2a8603816f9b07fca0cce87f 100644 (file)
@@ -46,6 +46,9 @@ rhsm_user = dpx-subscriber
 ; The password of the latter user
 ;rhsm_pwd =
 
+; The complete URL of the RHEL9 repo server
+;rhel9_repo_server_url = https://test-repo01.pixelpark.com/Linux/yum/rhel
+
 [Timeouts]
 
 ; General timeout in seconds for create_vm, poweron_vm and shutdown_vm
index b08d15755c84af020ba326166dbeccab18771a20..539fa69801d0d8c482c1217046de9249a0d65ef9 100644 (file)
@@ -140,6 +140,7 @@ class CrTplConfiguration(BaseMultiConfig, ConfigCobbler, ConfigTimeouts, ConfigE
     re_resolv_ns_entry = re.compile(r'^\s*nameserver\s+(\S+)')
 
     default_rhsm_user = 'dpx-subscriber'
+    default_rhel9_repo_server_url = 'https://test-repo01.pixelpark.com/Linux/yum/rhel'
 
     # -------------------------------------------------------------------------
     def __init__(
@@ -217,6 +218,8 @@ class CrTplConfiguration(BaseMultiConfig, ConfigCobbler, ConfigTimeouts, ConfigE
         self._rhsm_user = self.default_rhsm_user
         self._rhsm_pwd = None
 
+        self._rhel9_repo_server_url = self.default_rhel9_repo_server_url
+
         super(CrTplConfiguration, self).__init__(
             appname=appname, verbose=verbose, version=version, base_dir=base_dir,
             append_appname_to_stems=append_appname_to_stems, config_dir=config_dir,
@@ -364,6 +367,12 @@ class CrTplConfiguration(BaseMultiConfig, ConfigCobbler, ConfigTimeouts, ConfigE
         """Flag, that the RPM packages should be installed with documentation and man pages."""
         return self._vm_has_docs
 
+    # -------------------------------------------------------------------------
+    @property
+    def rhel9_repo_server_url(self):
+        """The complete URL of the repository server for RHEL-9."""
+        return self._rhel9_repo_server_url
+
     # -------------------------------------------------------------------------
     def as_dict(self, short=True):
         """
@@ -387,6 +396,7 @@ class CrTplConfiguration(BaseMultiConfig, ConfigCobbler, ConfigTimeouts, ConfigE
         res['data_size'] = self.data_size
         res['default_cobbler_nameservers'] = self.default_cobbler_nameservers
         res['ram_gb'] = self.ram_gb
+        res['rhel9_repo_server_url'] = self.rhel9_repo_server_url
         res['rhsm_pwd'] = None
         res['rhsm_user'] = self.rhsm_user
         res['system_ks'] = self.system_ks
index 6af249cd16aeac1a874688c9f460e4afac41fc2f..4fc7e267b02a341cd240f9b3e25d56bed01472ca 100644 (file)
@@ -194,6 +194,8 @@ class ConfigEval():
         re_rhsm_pwd = re.compile(r'^\s*rhsm[-_]?(?:pwd|password)\s*$', re.IGNORECASE)
         re_has_docs = re.compile(
             r'^\s*(?:vm[-_]?)?has[-_]?doc(?:s|umentation)?\s*$', re.IGNORECASE)
+        re_rhel9_repo_server = re.compile(
+            r'^\s*rhel9[-_]?repo[-_]?server(?:[-_]?url)?\s*$', re.IGNORECASE)
 
         for key in section.keys():
             value = section[key]
@@ -256,6 +258,8 @@ class ConfigEval():
             if re_has_docs.match(key):
                 self._vm_has_docs = to_bool(value)
                 continue
+            if re_rhel9_repo_server.match(key) and value.strip():
+                self._rhel9_repo_server_url = value.strip()
 
         return