]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler: Rocky 10 support
authorDavid Galloway <david.galloway@ibm.com>
Tue, 1 Jul 2025 13:06:07 +0000 (09:06 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Wed, 30 Jul 2025 19:39:21 +0000 (15:39 -0400)
- no gdisk in base repos
- `clearpart --all --initlabel` now defaults to GPT.
  However, we have been using msdos and a single partition
  on testnodes since forever.  FOG seemed to have trouble
  with GPT partitions.
- /etc/sysconfig/network-scripts are no longer used in Rocky 10.
  Replaced with nmcli commands during rc.local boot

Signed-off-by: David Galloway <david.galloway@ibm.com>
cobbler.yml
roles/cobbler/templates/kickstarts/cephlab_rhel.ks
roles/cobbler/templates/kickstarts/cephlab_rhel_sdc.ks
roles/cobbler/templates/kickstarts/cephlab_rhel_sdi.ks
roles/cobbler/templates/kickstarts/cephlab_rhel_sdm.ks
roles/cobbler/templates/snippets/cephlab_packages_rhel
roles/cobbler/templates/snippets/cephlab_rc_local
roles/cobbler/templates/snippets/cephlab_rhel_disks
roles/cobbler_profile/defaults/main.yml

index f0b2709d41146cf6c5a11fa6aee3c8032f1c4c72..dce9816251854ede9cf952ffd97b7586a4afa104 100644 (file)
@@ -50,6 +50,7 @@
     - { role: cobbler_profile, distro_name: CentOS-8.stream-x86_64, tags: ['centos8.stream'] }
     - { role: cobbler_profile, distro_name: CentOS-9.stream-x86_64, tags: ['centos9.stream'] }
     - { role: cobbler_profile, distro_name: Rocky-9.5-x86_64, tags: ['rocky9.5'] }
+    - { role: cobbler_profile, distro_name: Rocky-10.0-x86_64, tags: ['rocky10.0'] }
     - { role: cobbler_profile, distro_name: Ubuntu-12.04-server-x86_64, tags: ['ubuntu-precise'] }
     - { role: cobbler_profile, distro_name: Ubuntu-14.04-server-x86_64, tags: ['ubuntu-trusty'] }
     - { role: cobbler_profile, distro_name: Ubuntu-15.04-server-x86_64, tags: ['ubuntu-vivid'] }
index 359dfcbe2c7719805979f6479841d49e3ee12daf..9c683f6da434d6051afe33059a8efd7cb3ee8d7c 100644 (file)
@@ -4,7 +4,7 @@
 # do not use with earlier distros
 #set distro = $getVar('distro','').split("-")[0]
 #set distro_ver = $getVar('distro','').split("-")[1]
-#if $distro == 'RHEL' or $distro == 'CentOS'
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver_major = $distro_ver.split(".")[0]
 #set distro_ver_minor = $distro_ver.split(".")[1]
 #end if
index 725df30ba3fe9e8fc4d8789df35d3140ea83a97c..e5f68cb943a98e3dd23a976bccf973a683b0bc0a 100644 (file)
@@ -5,7 +5,7 @@
 # do not use with earlier distros
 #set distro = $getVar('distro','').split("-")[0]
 #set distro_ver = $getVar('distro','').split("-")[1]
-#if $distro == 'RHEL' or $distro == 'CentOS'
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver_major = $distro_ver.split(".")[0]
 #set distro_ver_minor = $distro_ver.split(".")[1]
 #end if
index 0eca2556d33730fadb93248923621e7a94ecd7aa..63f5a59cf368b360bb291588e601003a38d3f885 100644 (file)
@@ -5,7 +5,7 @@
 # do not use with earlier distros
 #set distro = $getVar('distro','').split("-")[0]
 #set distro_ver = $getVar('distro','').split("-")[1]
-#if $distro == 'RHEL' or $distro == 'CentOS'
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver_major = $distro_ver.split(".")[0]
 #set distro_ver_minor = $distro_ver.split(".")[1]
 #end if
index f5f8e98b031f81e2535f904646dddfa712d58aba..6c9a9ebd7deb2712c52018279b647b8e40125d40 100644 (file)
@@ -5,7 +5,7 @@
 # do not use with earlier distros
 #set distro = $getVar('distro','').split("-")[0]
 #set distro_ver = $getVar('distro','').split("-")[1]
-#if $distro == 'RHEL' or $distro == 'CentOS'
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver_major = $distro_ver.split(".")[0]
 #set distro_ver_minor = $distro_ver.split(".")[1]
 #end if
index e83fabf4c3d040a805c1d926e8e0b5c6017738a4..f78ea8382be63eefbe9017b5f14f1ccc0efe5699 100644 (file)
@@ -10,7 +10,7 @@ python3
 #else
 @base
 #end if
-#if $distro == 'RHEL' or $distro == 'CentOS'
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver_major = $distro_ver.split(".")[0]
 #set distro_ver_minor = $distro_ver.split(".")[1]
 ## These packages are available in all RHEL/CentOS versions but not Fedora
@@ -53,4 +53,6 @@ ethtool
 wget
 smartmontools
 selinux-policy-targeted
+#if $distro != 'Rocky'
 gdisk
+#end if
index 6705c5cb00c9ec32771f16887362bf52777be8cc..578160d8e2b14214ed110c6f90a66ad55c16908a 100644 (file)
@@ -3,12 +3,12 @@
 # Set proper location for firstboot ansible post-install trigger
 #set distro = $getVar('distro','').split("-")[0]
 #set distro_ver = $getVar('distro','').split("-")[1]
-#if ($distro == 'RHEL') or ($distro == 'CentOS')
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver = $distro_ver.split(".")[0]
 #end if
 #if ($distro == 'Fedora' and int($distro_ver) >= 22) or ($distro == 'RHEL' and int($distro_ver) >= 8)
 #set script = '/etc/rc.d/rc.local'
-#else if $distro == 'CentOS' and int($distro_ver) >= 9
+#else if ($distro in ['CentOS', 'Rocky']) and int($distro_ver) >= 9
 #set script = '/etc/rc.d/rc.local'
 systemctl enable rc-local.service
 #else if $distro == 'openSUSE'
@@ -57,7 +57,12 @@ if [ ! -f /.cephlab_net_configured ]; then
       elif command -v apt-get &>/dev/null; then
         echo -e "auto lo\niface lo inet loopback\n\nauto $nic\niface $nic inet dhcp" > /etc/network/interfaces
       else
-        echo -e "DEVICE=$nic\nBOOTPROTO=dhcp\nONBOOT=yes" > /etc/sysconfig/network-scripts/ifcfg-$nic
+        etcsysconfig=true
+        if ! echo -e "DEVICE=$nic\nBOOTPROTO=dhcp\nONBOOT=yes" > /etc/sysconfig/network-scripts/ifcfg-$nic; then
+          etcsysconfig=false
+          nmcli con add type ethernet ifname $nic con-name $nic ipv4.method auto
+          nmcli con up $nic
+        fi
       fi
       # Don't bail if NIC fails to go down or come up
       { set +e; } 2>/dev/null
@@ -77,7 +82,11 @@ if [ ! -f /.cephlab_net_configured ]; then
         # If we can't ping our Cobbler host, remove the DHCP config for this NIC.
         # It must either be on a non-routable network or has no reachable DHCP server.
         ifdown $nic
-        rm -f /etc/sysconfig/network-scripts/ifcfg-$nic
+        if [ "$etcsysconfig" ]; then
+          rm -f /etc/sysconfig/network-scripts/ifcfg-$nic
+        else
+          nmcli connection delete $nic
+        fi
         sed -i "/$nic/d" /etc/network/interfaces
         # Go back to bailing if anything fails bringing the next NIC up
         set -e
index 0c9425a400c0a19e4ae22d81b5e9528c9afb9043..b663d41309ab3c838534193985a5f1a5f7d1d840 100644 (file)
@@ -3,12 +3,16 @@
 # #set hostname = $getVar('name','')
 #set distro = $getVar('distro','').split("-")[0]
 #set distro_ver = $getVar('distro','').split("-")[1]
-#if $distro == 'RHEL' or $distro == 'CentOS'
+#if $distro in ['RHEL', 'CentOS', 'Rocky']
 #set distro_ver_major = $distro_ver.split(".")[0]
 #set distro_ver_minor = $distro_ver.split(".")[1]
 #end if
 # Partition clearing information
+#if $distro == 'Rocky' and int($distro_ver_major) >= 10
+clearpart --all --disklabel msdos
+#else
 clearpart --all --initlabel
+#end if
 # Use all of /dev/sda for the root partition (20G minimum)
 part / --fstype="ext4" --ondisk=sda --size=20000 --grow
 # Clear the Master Boot Record
index 02c14b8f37fd2bae4a901699a43bce00a0234278..82b635407e9c7ced8d3d0de829eb328ecb59e02b 100644 (file)
@@ -145,6 +145,11 @@ distros:
       iso: https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-dvd.iso
       sha256: ba60c3653640b5747610ddfb4d09520529bef2d1d83c1feb86b0c84dff31e04e
       kickstart: cephlab_rhel.ks
+  "Rocky-10.0-x86_64":
+      iso: https://download.rockylinux.org/pub/rocky/10/isos/x86_64/Rocky-10.0-x86_64-dvd1.iso
+      sha256: 678ea3e1eea6f5d6c220c46fab34f5e0add260e7b64f0139ee3b9f7b7ca7d2f3
+      kickstart: cephlab_rhel.ks
+      kernel_options: "inst.ks=http://@@http_server@@/cblr/svc/op/ks/system/@@name@@"
   "Ubuntu-12.04-server-x86_64":
       iso: "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso"
       sha256: af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9