2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Add cleanupdiskfullxcatpost attribute to site table

This commit is contained in:
Mark Gurevich 2021-08-12 15:19:50 -04:00
parent 5644ab6832
commit 50f5c9040d
16 changed files with 83 additions and 5 deletions

View File

@ -44,7 +44,7 @@ nodetype Attributes:
\ **os**\
The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.
The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.

View File

@ -104,7 +104,7 @@ osimage Attributes:
\ **osvers**\
The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,SL\*, fedora\*, sles\* (where \* is the version #).
The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #).

View File

@ -261,6 +261,10 @@ site Attributes:
directory on the stateless and statelite nodes after the
postscripts are run. Default is no.
cleanupdiskfullxcatpost: (yes/1 or no/0). Set to 'yes' or '1' to clean up the /xcatpost
directory on the diskfull nodes after the
postscripts are run with no errors. Default is no.
db2installloc: The location which the service nodes should mount for
the db2 code to install. Format is hostname:/path. If hostname is
omitted, it defaults to the management node. Default is /mntdb2.

View File

@ -721,7 +721,7 @@ group Attributes:
\ **os**\ (nodetype.os)
The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.
The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.

View File

@ -727,7 +727,7 @@ node Attributes:
\ **os**\ (nodetype.os)
The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.
The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.

View File

@ -249,7 +249,7 @@ osimage Attributes:
\ **osvers**\ (osimage.osvers)
The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,SL\*, fedora\*, sles\* (where \* is the version #).
The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #).

View File

@ -1156,6 +1156,9 @@ passed as argument rather than by table value',
" cleanupxcatpost: (yes/1 or no/0). Set to 'yes' or '1' to clean up the /xcatpost\n" .
" directory on the stateless and statelite nodes after the\n" .
" postscripts are run. Default is no.\n\n" .
" cleanupdiskfullxcatpost: (yes/1 or no/0). Set to 'yes' or '1' to clean up the /xcatpost\n" .
" directory on the diskfull nodes after the\n" .
" postscripts are run with no errors. Default is no.\n\n" .
" db2installloc: The location which the service nodes should mount for\n" .
" the db2 code to install. Format is hostname:/path. If hostname is\n" .
" omitted, it defaults to the management node. Default is /mntdb2.\n\n" .

View File

@ -1204,6 +1204,7 @@ sub initDB
$chtabcmds .= "$::XCATROOT/sbin/chtab key=dnshandler site.value=ddns;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=vsftp site.value=n;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=cleanupxcatpost site.value=no;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=cleanupdiskfullxcatpost site.value=no;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=dhcplease site.value=43200;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=auditnosyslog site.value=0;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=;";

View File

@ -25,9 +25,11 @@ nodeset_runimg
nodeset_shell
reg_linux_diskfull_installation_flat
compare_postscripts
cleanup_postscripts_diskfull
reg_linux_diskless_installation_flat
reg_linux_diskless_installation_flat_squashfs
reg_linux_statelite_installation_flat
cleanup_postscripts_diskless
rmimage_diskless
rpower_reset
runcmdinstaller_command

View File

@ -25,9 +25,11 @@ nodeset_runimg
nodeset_shell
reg_linux_diskfull_installation_flat
compare_postscripts
cleanup_postscripts_diskfull
reg_linux_diskless_installation_flat
reg_linux_diskless_installation_flat_squashfs
reg_linux_statelite_installation_flat
cleanup_postscripts_diskless
rmimage_diskless
rpower_reset
runcmdinstaller_command

View File

@ -16,6 +16,8 @@ nodeset_runimg
nodeset_shell
reg_linux_diskfull_installation_flat
compare_postscripts
cleanup_postscripts_diskfull
reg_linux_diskless_installation_flat
cleanup_postscripts_diskless
reg_linux_diskless_installation_flat_squashfs
reg_linux_statelite_installation_flat

View File

@ -16,6 +16,8 @@ nodeset_runimg
nodeset_shell
reg_linux_diskfull_installation_flat
compare_postscripts
cleanup_postscripts_diskfull
reg_linux_diskless_installation_flat
cleanup_postscripts_diskless
reg_linux_diskless_installation_flat_squashfs
reg_linux_statelite_installation_flat

View File

@ -1,8 +1,10 @@
reg_linux_diskless_installation_flat
cleanup_postscripts_diskless
reg_linux_diskless_installation_flat_squashfs
reg_linux_diskfull_installation_flat
makentp_extntpserver_value
compare_postscripts
cleanup_postscripts_diskfull
assign_certain_command_permission
bmcdiscover_help
bmcdiscover_q

View File

@ -1,8 +1,10 @@
reg_linux_diskless_installation_flat
cleanup_postscripts_diskless
reg_linux_diskless_installation_flat_squashfs
reg_linux_diskfull_installation_flat
makentp_extntpserver_value
compare_postscripts
cleanup_postscripts_diskfull
assign_certain_command_permission
bmcdiscover_help
bmcdiscover_q

View File

@ -13,4 +13,49 @@ cmd:cat /tmp/diff.list
check:rc==0
cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/mn.tar; rm /tmp/diff.list
end
start:cleanup_postscripts_diskfull
os:Linux
label:provision
description: Verify postscripts cleaned up after diskfull installation
cmd:chdef -t site clustersite cleanupdiskfullxcatpost="yes"
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 1
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
cmd:xdsh $$CN ls /xcatpost | wc -l
check:rc==0
check:output==1
cmd:chdef -t site clustersite cleanupdiskfullxcatpost="no"
end
start:cleanup_postscripts_diskless
os:Linux
label:provision
description: Verify postscripts cleaned up after diskless installation
cmd:chdef -t site clustersite cleanupxcatpost="yes"
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 1
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
cmd:xdsh $$CN ls /xcatpost | wc -l
check:rc==0
check:output==0
cmd:chdef -t site clustersite cleanupxcatpost="no"
end

View File

@ -13,6 +13,7 @@ if [ -f /xcatpost/mypostscript.post ]; then
OSVER=`grep '^OSVER=' /xcatpost/mypostscript.post |cut -d= -f2|sed s/\'//g`
NODE=`grep '^NODE=' /xcatpost/mypostscript.post |cut -d= -f2|sed s/\'//g`
IMAGE=`grep '^PROVMETHOD=' /xcatpost/mypostscript.post |cut -d= -f2|sed s/\'//g`
CLEANUPDISKFULLXCATPOST=`grep CLEANUPDISKFULLXCATPOST= /xcatpost/mypostscript |awk -F = '{print $2}' | tr -d \'\" | tr A-Z a-z`
fi
@ -139,6 +140,18 @@ fi
" >> /xcatpost/mypostscript.post
fi
# If "cleanupdiskfullxcatpost" install was requested, remove all /xcapost
# files (except updateflag.awk ) if postscripts ran without an error
if [[ "$CLEANUPDISKFULLXCATPOST" =~ ^(1|yes|y)$ ]]; then
echo "
if [ \"\$return_value\" -eq \"0\" ]; then
cd /
find /xcatpost/ -type f -not -name 'updateflag.awk' -delete
find /xcatpost/ -type d -empty -delete
msgutil_r \$MASTER_IP \"info\" \"cleanup of /xcatpost completed.(\$NODE)\" \"/var/log/xcat/xcat.log\" \"\$log_label\"
fi
" >> /xcatpost/mypostscript.post
fi
chmod +x /xcatpost/mypostscript.post
if [ -x /xcatpost/mypostscript.post ];then