]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Putting RHEL-9 repo server into cobbler profile
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 17 Nov 2023 16:03:33 +0000 (17:03 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 17 Nov 2023 16:03:33 +0000 (17:03 +0100)
lib/cr_vmware_tpl/cobbler/profile.py
snippets/tpl.190.repos_rhel9.sh
templates/el9-standard.ks

index 8184ce7deeb175a1333c97ed413cf008f83d0049..cfc2809cd43d1d08a29f0cecadcacb4c5c9feb07 100644 (file)
@@ -27,7 +27,7 @@ from .. import print_section_start, print_section_end
 from ..errors import ExpectedCobblerError
 from ..xlate import XLATOR
 
-__version__ = '0.1.2'
+__version__ = '0.2.0'
 
 LOG = logging.getLogger(__name__)
 
@@ -257,6 +257,7 @@ class CobblerProfile():
             ks_meta_list.append("SYSTEM_STATUS={}".format(status))
             ks_meta_list.append("WS_REL_FILESDIR={}".format(self.cfg.cobbler_ws_rel_filesdir))
             ks_meta_list.append("COBBLER_URL=http://{}".format(self.cfg.cobbler_host))
+            ks_meta_list.append("RHEL9_REPOSERVER_URL={}".format(self.cfg.rhel9_repo_server_url)
 
             ks_meta = ' '.join(ks_meta_list)
 
@@ -297,11 +298,17 @@ class CobblerProfile():
                 ks_meta_vars['WS_REL_FILESDIR'] != str(self.cfg.cobbler_ws_rel_filesdir):
             LOG.debug(_('Profile ks_meta {!r} is not ok.').format('WS_REL_FILESDIR'))
             ks_meta_ok = False
+
         if 'COBBLER_URL' not in ks_meta_vars or \
                 ks_meta_vars['COBBLER_URL'] != "http://{}".format(self.cfg.cobbler_host):
             LOG.debug(_('Profile ks_meta {!r} is not ok.').format('COBBLER_URL'))
             ks_meta_ok = False
 
+        if 'RHEL9_REPOSERVER_URL' not in ks_meta_vars or \
+                ks_meta_vars['RHEL9_REPOSERVER_URL'] != self.cfg.rhel9_repo_server_url:
+            LOG.debug(_('Profile ks_meta {!r} is not ok.').format('RHEL9_REPOSERVER_URL'))
+            ks_meta_ok = False
+
         return ks_meta_ok
 
     # -------------------------------------------------------------------------
@@ -324,6 +331,7 @@ class CobblerProfile():
         ks_meta_list.append("SYSTEM_STATUS={}".format(status))
         ks_meta_list.append("WS_REL_FILESDIR={}".format(self.cfg.cobbler_ws_rel_filesdir))
         ks_meta_list.append("COBBLER_URL=http://{}".format(self.cfg.cobbler_host))
+        ks_meta_list.append("RHEL9_REPOSERVER_URL={}".format(self.cfg.rhel9_repo_server_url)
 
         ks_meta = None
         if ks_meta_list:
index c11e81305fcc0c50eecc5081c70e485b1265c02c..0fb9c20bcf5cda78b45885f6780b8efe3e2e70a8 100644 (file)
@@ -38,7 +38,6 @@ get_repos_rhel9() {
     local -a repos=(
             'rhel-9-for-x86_64-appstream-rpms'
             'rhel-9-for-x86_64-baseos-rpms'
-            'rhv-4-tools-for-rhel-9-x86_64-rpms'
     )
 
     local repo=
index c01a735811c0e5e4568ee91483fd2e81615ef007..b235cbd842728965642931d57f6540f041addfb5 100644 (file)
@@ -232,6 +232,7 @@ export mac_address_eth0="$mac_address_eth0"
 export system_status="${SYSTEM_STATUS}"
 export ws_rel_filesdir="${WS_REL_FILESDIR}"
 export cobbler_url="${COBBLER_URL}"
+export rhel9_reposerver_url="${RHEL9_REPOSERVER_URL}"
 {% if distro.is_rhel %}
 export rhsm_user="${RHSM_USER}"
 export rhsm_pwd="${RHSM_PWD}"
@@ -256,14 +257,15 @@ fi
 {% endif %}
 echo
 echo "------------------"
-echo "hostname:             '$hostname'"
-echo "system_name:          '$system_name'"
-echo "gateway:              '$gateway'"
-echo "Management interface: '${mgmt_interface}'"
-echo "ip_address_eth0:      '$ip_address_eth0'"
-echo "mac_address_eth0:     '$mac_address_eth0'"
-echo "System status:        '${system_status}'"
-echo "Cobbler URL:          '${cobbler_url}'"
+echo "hostname:              '$hostname'"
+echo "system_name:           '$system_name'"
+echo "gateway:               '$gateway'"
+echo "Management interface:  '${mgmt_interface}'"
+echo "ip_address_eth0:       '$ip_address_eth0'"
+echo "mac_address_eth0:      '$mac_address_eth0'"
+echo "System status:         '${system_status}'"
+echo "Cobbler URL:           '${cobbler_url}'"
+echo "RHEL9 repo server URL: '${rhel9_reposerver_url}'"
 {% if distro.is_rhel %}
 echo
 echo "RedHat SubscriptionManager User:      '${rhsm_user}'"