mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Support module installation on RHEL8
This commit is contained in:
		| @@ -77,31 +77,33 @@ where **/install/post/custom/<distro>/myotherlist** is another package list file | ||||
|  | ||||
| Note: the trailing **"#"** character at the end of the line. It is important to specify this character for correct pkglist parsing. | ||||
|  | ||||
| Group/Pattern Names | ||||
| ''''''''''''''''''' | ||||
| Module/Group/Pattern Names | ||||
| '''''''''''''''''''''''''' | ||||
|  | ||||
| It is only supported for stateful deployment. | ||||
| .. note:: On SLES pattern names are not supported for diskless deployment | ||||
|  | ||||
| In Linux, a groups of rpms can be packaged together into one package. It is called a group on RedHat, CentOS, Fedora and Scientific Linux. To get the list of available groups, run | ||||
| On Linux, groups of rpms can be packaged together into one package. It can be a module or a group on RedHat, CentOS, Fedora and Scientific Linux. To get the list of available groups, run | ||||
|  | ||||
| * **[RHEL]** :: | ||||
|  | ||||
|    yum grouplist | ||||
|    yum group list | ||||
|    yum module list | ||||
|  | ||||
| * **[SLES]** :: | ||||
|  | ||||
|    zypper se -t pattern | ||||
|  | ||||
| You can specify in this file the group/pattern names by adding a **'@'** and a space before the group/pattern names. For example: :: | ||||
| You can specify module/group/pattern names by adding a **'@'** before the module/group/pattern names. For example: :: | ||||
|  | ||||
|     @ base | ||||
|     @base | ||||
|     @Security Tools | ||||
|     @ruby:2.6 | ||||
|  | ||||
| Remove RPMs After Installing | ||||
| '''''''''''''''''''''''''''' | ||||
|  | ||||
| It is only supported for stateful deployment. | ||||
|  | ||||
| You can specify in this file that certain rpms to be removed after installing the new software. This is done by adding **'-'** before the rpm names you want to remove. For example: :: | ||||
| You can specify that certain rpms to be removed after installing the new software. This is done by adding **'-'** before the rpm names you want to remove. For example: :: | ||||
|  | ||||
|     -ntp | ||||
|     -@ruby:2.6 | ||||
|  | ||||
|   | ||||
| @@ -28,6 +28,7 @@ compare_postscripts | ||||
| cleanup_postscripts_diskfull | ||||
| reg_linux_diskless_installation_flat | ||||
| reg_linux_diskless_installation_flat_squashfs | ||||
| reg_linux_diskless_installation_flat_modules_and_groups | ||||
| reg_linux_statelite_installation_flat | ||||
| cleanup_postscripts_diskless | ||||
| rmimage_diskless | ||||
|   | ||||
| @@ -28,6 +28,7 @@ compare_postscripts | ||||
| cleanup_postscripts_diskfull | ||||
| reg_linux_diskless_installation_flat | ||||
| reg_linux_diskless_installation_flat_squashfs | ||||
| reg_linux_diskless_installation_flat_modules_and_groups | ||||
| reg_linux_statelite_installation_flat | ||||
| cleanup_postscripts_diskless | ||||
| rmimage_diskless | ||||
|   | ||||
| @@ -0,0 +1,39 @@ | ||||
| start:reg_linux_diskfull_installation_flat_modules_and_groups | ||||
| description:Test provision and updatenode with yum groups and modules. Runs only on RH8 | ||||
| os:Linux | ||||
| label:flat_cn_diskful,provision | ||||
| cmd:cp /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:echo "@Security Tools" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:echo "@ruby:2.6" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute pkglist=/opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:cat /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh  $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute | ||||
| check:rc==0 | ||||
| check:output=~Provision node\(s\)\: $$CN | ||||
| cmd:ping $$CN -c 3 | ||||
| check:rc==0 | ||||
| check:output=~64 bytes from $$CN | ||||
| cmd:lsdef -l $$CN | grep status | ||||
| check:rc==0 | ||||
| check:output=~booted | ||||
| cmd:xdsh $$CN date | ||||
| check:rc==0 | ||||
| # Verify group and module were installed | ||||
| cmd:xdsh $$CN yum group list installed | ||||
| check:output=~Security Tools | ||||
| cmd:xdsh $$CN yum module list --installed | ||||
| check:output=~ruby 2.6 | ||||
| # Verify group and module can be removed | ||||
| cmd:cp /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:echo "-@Security Tools" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:echo "-@ruby:2.6" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| cmd:updatenode $$CN -P ospkgs | ||||
| check:rc==0 | ||||
| cmd:xdsh $$CN yum group list installed | ||||
| check:output!~Security Tools | ||||
| cmd:xdsh $$CN yum module list --installed | ||||
| check:output!~ruby 2.6 | ||||
| # Cleanup | ||||
| cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute pkglist=/opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist | ||||
| cmd:rm /opt/xcat/share/xcat/install/rh/compute.pkglist.modules | ||||
| end | ||||
| @@ -0,0 +1,52 @@ | ||||
| start:reg_linux_diskless_installation_flat_modules_and_groups | ||||
| description:Test provision and updatenode with yum groups and modules. Runs only on RH7 and RH8 | ||||
| os:Linux | ||||
| label:flat_cn_diskless,provision | ||||
| cmd:a=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -i osvers -c | cut -d":" -f2 | cut -d"=" -f2 | cut -d"." -f1`; cp /opt/xcat/share/xcat/netboot/rh/compute.$a.__GETNODEATTR($$CN,arch)__.pkglist /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:echo "yum" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:echo "@Security Tools" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhels8" ]] ; then echo "@ruby:2.6" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules; fi | ||||
| cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| check:rc==0 | ||||
| cmd:cat /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute | ||||
| check:rc==0 | ||||
| cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute | ||||
| check:rc==0 | ||||
| cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute | ||||
| check:rc==0 | ||||
| cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh  $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute | ||||
| check:rc==0 | ||||
| check:output=~Provision node\(s\)\: $$CN | ||||
| cmd:ping $$CN -c 3 | ||||
| check:rc==0 | ||||
| check:output=~64 bytes from $$CN | ||||
| cmd:lsdef -l $$CN | grep status | ||||
| check:rc==0 | ||||
| check:output=~booted | ||||
| cmd:xdsh $$CN date | ||||
| check:rc==0 | ||||
| # Verify group and module (on RH8) were installed. Can not use "yum group" | ||||
| # since .repo files are not setup at this point | ||||
| cmd:xdsh $$CN rpm -q xml-common | ||||
| check:rc==0 | ||||
| check:output=~xml-common | ||||
| cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhels8" ]] ; then xdsh $$CN yum module list --installed; else echo "ruby 2.6"; fi | ||||
| check:output=~ruby | ||||
| check:output=~2.6 | ||||
|  | ||||
| # Verify group and module (on RH8) can be removed | ||||
| cmd:a=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -i osvers -c | cut -d":" -f2 | cut -d"=" -f2 | cut -d"." -f1`; cp /opt/xcat/share/xcat/netboot/rh/compute.$a.__GETNODEATTR($$CN,arch)__.pkglist /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:echo "-@Security Tools" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhels8" ]] ; then echo "-@ruby:2.6" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules; fi | ||||
| cmd:cat /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| cmd:updatenode $$CN -P ospkgs | ||||
| check:rc==0 | ||||
| cmd:xdsh $$CN yum group list installed | ||||
| check:output!~Security Tools | ||||
| cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhels8" ]] ; then xdsh $$CN yum module list --installed; else echo ""; fi | ||||
| check:output!~ruby | ||||
| # Cleanup | ||||
| cmd:a=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -i osvers -c | cut -d":" -f2 | cut -d"=" -f2 | cut -d"." -f1`; chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/opt/xcat/share/xcat/netboot/rh/compute.$a.__GETNODEATTR($$CN,arch)__.pkglist | ||||
| cmd:rm /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules | ||||
| end | ||||
| @@ -436,9 +436,9 @@ do | ||||
|  | ||||
|         #categorize the groups according to the action(install/remove) | ||||
|         if [ $remove -eq 0 ]; then | ||||
|     	   groups="$groups $tmp" | ||||
|     	   groups="$groups @$tmp" | ||||
|         else | ||||
|            groups_d="$groups_d $tmp" | ||||
|            groups_d="$groups_d @$tmp" | ||||
|         fi | ||||
|     else | ||||
|         if ( pmatch  "$x" "cuda*" ); then | ||||
| @@ -945,8 +945,8 @@ else | ||||
|  | ||||
|     #install new groups if any | ||||
|     if [ -n "$groups" ]; then | ||||
| 	#cmd="echo $groups| $ENVLIST xargs yum -y groupinstall" | ||||
| 	cmd="$ENVLIST yum -y groupinstall $groups" | ||||
| 	#cmd="$ENVLIST yum -y groupinstall $groups" | ||||
| 	cmd="$ENVLIST yum -y install $groups" | ||||
| 	result=`eval $cmd 2>&1` | ||||
|         R=$? | ||||
|         if [ $R -ne 0 ]; then | ||||
| @@ -1005,7 +1005,8 @@ else | ||||
|  | ||||
|     #remove some groups if specified | ||||
|     if [ -n "$groups_d" ]; then | ||||
|         cmd="$ENVLIST yum -y groupremove $groups_d" | ||||
|         #cmd="$ENVLIST yum -y groupremove $groups_d" | ||||
|         cmd="$ENVLIST yum -y remove $groups_d" | ||||
|         result=`eval $cmd 2>&1` | ||||
|         R=$? | ||||
|         if [ $R -ne 0 ]; then | ||||
|   | ||||
		Reference in New Issue
	
	Block a user