From 8468adc8eef6be670dbb7bd5e6e41c20b5de3634 Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Mon, 11 Nov 2024 19:16:57 +0100 Subject: [PATCH 1/6] aii-ks/pxelinux: refactoring of base OS url definition - Required to deal with new repository naming scheme in EL9 --- aii-ks/src/main/pan/quattor/aii/ks/config.pan | 40 ++++++++++++++++--- .../main/pan/quattor/aii/pxelinux/config.pan | 12 +++--- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/aii-ks/src/main/pan/quattor/aii/ks/config.pan b/aii-ks/src/main/pan/quattor/aii/ks/config.pan index 97a8e6c1..b0043eea 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/config.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/config.pan @@ -75,6 +75,11 @@ variable AII_OSINSTALL_PROTOCOL ?= # For backward compatibility, as in previous versions, osinstall_protocol was explicitly defined by sites. variable AII_OSINSTALL_PROTOCOL = value('/system/aii/osinstall/ks/osinstall_protocol'); +# Protocol to use with AII_KS_SERVER +variable AII_KS_PROTOCOL ?= AII_OSINSTALL_PROTOCOL; + +# Protocol to use with AII_ACK_BIN +variable AII_ACK_PROTOCOL ?= AII_OSINSTALL_PROTOCOL; # # Define OS installation path based on OS version @@ -113,16 +118,37 @@ variable AII_OSINSTALL_SELINUX ?= 'disabled'; # Install type and URL (for http or https) or directory (for NFS) # with the OS distribution # For backward compatibility (deprecated), allow installtype to be defined explicicly -# rather than from AII_OSINSTALL_xxx variables. +# rather than from BASE_OS_REPOSITORY_TEMPLATE or AII_OSINSTALL_xxx variables. # "installtype" ?= { - if ( !exists(AII_OSINSTALL_PATH) || !is_defined(AII_OSINSTALL_PATH) ) { - error("You need to define the variable AII_OSINSTALL_PATH or AII_OSINSTALL_ROOT " - + "(OS distribution location on the Quattor server)"); + if ( !is_defined(AII_OSINSTALL_PATH) && !is_defined(BASE_OS_REPOSITORY_TEMPLATE) ) { + error("You need to define the variable AII_OSINSTALL_PATH or BASE_OS_REPOSITORY_TEMPLATE" + + " (base OS distribution location on the Quattor server)"); }; if ( match(AII_OSINSTALL_PROTOCOL, "^https?") ) { - "url --url " + AII_OSINSTALL_PROTOCOL + "://" + AII_OSINSTALL_SRV + AII_OSINSTALL_PATH; + if ( is_defined(BASE_OS_REPOSITORY_TEMPLATE) ) { + debug('BASE_OS_REPOSITORY_TEMPLATE=%s', BASE_OS_REPOSITORY_TEMPLATE); + repo_template_name = format('%s/%s', YUM_OS_SNAPSHOT_NS, BASE_OS_REPOSITORY_TEMPLATE); + debug('Base OS repository template = %s', repo_template_name); + repo_template = if_exists(repo_template_name); + } else { + repo_template = undef; + }; + repo_url = undef; + if ( is_defined(repo_template) ) { + repo_params = create(repo_template); + if ( exists(repo_params['protocols']) ) { + repo_protocols = repo_params['protocols']; + # Assume that all protocols entries are http/https entries + repo_url = repo_protocols[0]['url'] + }; + }; + if ( !is_defined(repo_url) ) { + repo_url = format("%s://%s%s", AII_OSINSTALL_PROTOCOL, AII_OSINSTALL_SRV, AII_OSINSTALL_PATH); + }; + debug('Base OS repository URL = %s', repo_url); + "url --url " + repo_url; } else if ( match(AII_OSINSTALL_PROTOCOL, "(?i)nfs") ) { "nfs --server " + AII_OSINSTALL_SRV + " --dir " + AII_OSINSTALL_PATH; } else { @@ -175,6 +201,7 @@ variable AII_OSINSTALL_OPTION_NTPSERVERS ?= null; # Root Password (for example: aii) # by default, derived from the account component # +include 'components/accounts/config'; variable AII_OSINSTALL_ROOTPW ?= value("/software/components/accounts/rootpwd"); "rootpw" ?= AII_OSINSTALL_ROOTPW; @@ -389,12 +416,13 @@ variable AII_OSINSTALL_PACKAGES ?= list( # variable AII_ACK_SRV ?= AII_OSINSTALL_SRV; variable AII_ACK_CGI ?= "/cgi-bin/aii-installack.cgi"; -variable AII_ACK_LIST ?= list("http://" + AII_ACK_SRV + AII_ACK_CGI); +variable AII_ACK_LIST ?= list(format("%s://%s%s", AII_ACK_PROTOCOL, AII_ACK_SRV, AII_ACK_CGI)); "acklist" ?= AII_ACK_LIST; # # Set the location of the node profile # +include 'components/ccm/config'; variable AII_USE_CCM ?= exists("/software/components/ccm") && is_defined("/software/components/ccm"); variable AII_PROFILE_PATH ?= "/profiles"; variable AII_OSINSTALL_NODEPROFILE ?= diff --git a/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan b/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan index 5b6f4806..226b2b06 100644 --- a/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan +++ b/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan @@ -40,10 +40,10 @@ variable AII_KS_PATH ?= { variable AII_KS_CONFIG_FILE ?= AII_KS_PATH + "/" + AII_HOSTNAME + "." + AII_DOMAIN + ".ks"; "/system/aii/nbp/pxelinux/kslocation" ?= { - if (AII_OSINSTALL_PROTOCOL == "http") { - s = "http://" + AII_KS_SRV; + if ( match(AII_KS_PROTOCOL, "^https*$") ) { + s = format("%s://%s", AII_KS_PROTOCOL, AII_KS_SRV); } else { - s = "nfs:" + AII_KS_SRV + ":"; + s = format("nfs:%s:", AII_KS_SRV); }; return(s + AII_KS_CONFIG_FILE); }; @@ -99,7 +99,7 @@ variable AII_NBP_ROOT ?= { if (LPXELINUX) { root = LPXELINUX_ROOT; } else { - toks = matches(AII_OSINSTALL_OS_VERSION, '^(\w+?)[_\-](.*)'); + toks = matches(AII_OSINSTALL_OS_VERSION, '^([\w\.]+?)[_\-](.*)$'); if ( length(toks) < 3 ) { root = undef; } else { @@ -113,7 +113,7 @@ variable AII_NBP_ROOT ?= { }; "/system/aii/nbp/pxelinux/kernel" ?= - if ( is_defined(AII_OSINSTALL_OS_VERSION) ) { + if ( is_defined(AII_NBP_ROOT) ) { format('%s/vmlinuz', AII_NBP_ROOT); } else { undef; @@ -122,7 +122,7 @@ variable AII_NBP_ROOT ?= { variable AII_NBP_INITRD ?= "initrd.img"; "/system/aii/nbp/pxelinux/initrd" ?= - if ( is_defined(AII_OSINSTALL_OS_VERSION) ) { + if ( is_defined(AII_NBP_ROOT) ) { format('%s/%s', AII_NBP_ROOT, AII_NBP_INITRD); } else { undef; From 864e10fdf1ad286301577797b85f8e20ad8e42a5 Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Mon, 11 Nov 2024 19:18:43 +0100 Subject: [PATCH 2/6] aii-ks EL9 variant: add required packages --- aii-ks/src/main/pan/quattor/aii/ks/config.pan | 21 +++++++++++++------ .../main/pan/quattor/aii/ks/variants/el9.pan | 7 +++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/aii-ks/src/main/pan/quattor/aii/ks/config.pan b/aii-ks/src/main/pan/quattor/aii/ks/config.pan index b0043eea..73abfd17 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/config.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/config.pan @@ -89,10 +89,12 @@ variable AII_ACK_PROTOCOL ?= AII_OSINSTALL_PROTOCOL; # variable AII_OSINSTALL_ROOT ?= undef; variable AII_OSINSTALL_OS_VERSION ?= undef; -variable DEBUG = debug(format('%s: AII_OSINSTALL_ROOT=%s, AII_OSINSTALL_OS_VERSION=%s', - OBJECT, - AII_OSINSTALL_ROOT, - AII_OSINSTALL_OS_VERSION)); +variable DEBUG = debug( + '%s: AII_OSINSTALL_ROOT=%s, AII_OSINSTALL_OS_VERSION=%s', + OBJECT, + AII_OSINSTALL_ROOT, + AII_OSINSTALL_OS_VERSION +)); # AII_OSINSTALL_SUBURL allows to specify a sub-url under root/version # (e.g. /base) @@ -356,6 +358,11 @@ variable AII_OSINSTALL_OPTION_FIREWALL ?= null; # default list of packages required for the initial installation # +variable AII_OSINSTALL_VERSIONLOCK_PLUGIN = if ( OS_VERSION_PARAMS['majorversion'] >= '8' ) { + "python3-dnf-plugin-versionlock"; +} else { + "yum-plugin-versionlock"; +}; variable AII_OSINSTALL_PACKAGES ?= list( "curl", "lsof", @@ -373,13 +380,15 @@ variable AII_OSINSTALL_PACKAGES ?= list( "perl-URI", "perl-XML-Parser", "yum-plugin-priorities", - "yum-plugin-versionlock", + AII_OSINSTALL_VERSIONLOCK_PLUGIN, "wget", ); -"packages" ?= AII_OSINSTALL_PACKAGES; "packages" = { + foreach (i; pkg_name; AII_OSINSTALL_PACKAGES) { + append(pkg_name); + }; if (value('/system/aii/osinstall/ks/selinux') == 'disabled') { # grubby is used to disable selinux on with kernel parameter append('grubby'); diff --git a/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan b/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan index 6d862cd6..6e33ac22 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan @@ -8,6 +8,13 @@ prefix "/system/aii/osinstall/ks"; "langsupport" = null; "packages_args" = list("--ignoremissing"); +# Required by perl-CDB_File +"packages" = append("perl-English"); +# Required by some Quattor components and must be installed before +# /etc/init.d is created by something else (e.g. a Quattor package) +"packages" = append("chkconfig"); +"packages" = append("initscripts"); + "part_label" = true; "volgroup_required" = false; "lvmforce" = true; From 1dd35524d3c0b0a4bbd462a6c442d7b253c984d2 Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Mon, 11 Nov 2024 19:56:29 +0100 Subject: [PATCH 3/6] aii-ks: define versionlock plugin name into KS variant --- aii-ks/src/main/pan/quattor/aii/ks/config.pan | 63 +++++++++---------- .../main/pan/quattor/aii/ks/variants/el8.pan | 2 + .../main/pan/quattor/aii/ks/variants/el9.pan | 2 + 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/aii-ks/src/main/pan/quattor/aii/ks/config.pan b/aii-ks/src/main/pan/quattor/aii/ks/config.pan index 73abfd17..dbec5cbd 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/config.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/config.pan @@ -353,16 +353,41 @@ variable AII_OSINSTALL_OPTION_FIREWALL ?= null; "firewall" ?= AII_OSINSTALL_OPTION_FIREWALL; +# Include OS specific kickstart configuration, if needed +# - including this at the end allow to undefine tree elements, and remain compatible with other (previous) OSes +# - allow 2 types of variants : major and minor OS variants. Variants for major OS version are located in the standard configuration +# (as defined by AII_KS_OS_MAJOR_SPECIFIC_INCLUDE, default value should be appropriate when using QWG templates). Variants for minor +# OS versions are located into the related OS templates ((as defined by AII_KS_OS_MINOR_SPECIFIC_INCLUDE, default value should be appropriate when using QWG +# templates). When both exist, they are both applied. +variable AII_KS_OS_MAJOR_SPECIFIC_INCLUDE ?= + if ( is_defined(OS_VERSION_PARAMS['major']) ) { + if_exists('quattor/aii/ks/variants/' + OS_VERSION_PARAMS['major']); + } else { + undef; + }; +include { + debug('KS specific configuration for OS major version: ' + to_string(AII_KS_OS_MAJOR_SPECIFIC_INCLUDE)); + AII_KS_OS_MAJOR_SPECIFIC_INCLUDE; +}; +# Existence of OS_VERSION_PARAMS['minor'] is used as a QWG signature +variable AII_KS_OS_MINOR_SPECIFIC_INCLUDE ?= + if ( is_defined(OS_VERSION_PARAMS['minor']) ) { + if_exists('config/quattor/ks'); + } else { + undef; +}; +include { + debug('KS specific configuration for OS minor release: ' + to_string(AII_KS_OS_MINOR_SPECIFIC_INCLUDE)); + AII_KS_OS_MINOR_SPECIFIC_INCLUDE; +}; + + # # Minimal package sets to install # default list of packages required for the initial installation # -variable AII_OSINSTALL_VERSIONLOCK_PLUGIN = if ( OS_VERSION_PARAMS['majorversion'] >= '8' ) { - "python3-dnf-plugin-versionlock"; -} else { - "yum-plugin-versionlock"; -}; +final variable AII_OSINSTALL_VERSIONLOCK_PLUGIN ?= 'yum-plugin-versionlock'; variable AII_OSINSTALL_PACKAGES ?= list( "curl", "lsof", @@ -447,34 +472,6 @@ variable AII_OSINSTALL_NODEPROFILE ?= }; "node_profile" ?= AII_OSINSTALL_NODEPROFILE; -# Include OS specific kickstart configuration, if needed -# - including this at the end allow to undefine tree elements, and remain compatible with other (previous) OSes -# - allow 2 types of variants : major and minor OS variants. Variants for major OS version are located in the standard configuration -# (as defined by AII_KS_OS_MAJOR_SPECIFIC_INCLUDE, default value should be appropriate when using QWG templates). Variants for minor -# OS versions are located into the related OS templates ((as defined by AII_KS_OS_MINOR_SPECIFIC_INCLUDE, default value should be appropriate when using QWG -# templates). When both exist, they are both applied. -variable AII_KS_OS_MAJOR_SPECIFIC_INCLUDE ?= - if ( is_defined(OS_VERSION_PARAMS['major']) ) { - if_exists('quattor/aii/ks/variants/' + OS_VERSION_PARAMS['major']); - } else { - undef; - }; -include { - debug('KS specific configuration for OS major version: ' + to_string(AII_KS_OS_MAJOR_SPECIFIC_INCLUDE)); - AII_KS_OS_MAJOR_SPECIFIC_INCLUDE; -}; -# Existence of OS_VERSION_PARAMS['minor'] is used a a QWG signature -variable AII_KS_OS_MINOR_SPECIFIC_INCLUDE ?= - if ( is_defined(OS_VERSION_PARAMS['minor']) ) { - if_exists('config/quattor/ks'); - } else { - undef; -}; -include { - debug('KS specific configuration for OS minor release: ' + to_string(AII_KS_OS_MINOR_SPECIFIC_INCLUDE)); - AII_KS_OS_MINOR_SPECIFIC_INCLUDE; -}; - # # For more details on Kickstart options see RedHat documentation: # http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-kickstart2.html diff --git a/aii-ks/src/main/pan/quattor/aii/ks/variants/el8.pan b/aii-ks/src/main/pan/quattor/aii/ks/variants/el8.pan index d7796080..f41a85f3 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/variants/el8.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/variants/el8.pan @@ -2,6 +2,8 @@ template quattor/aii/ks/variants/el8; +variable AII_OSINSTALL_VERSIONLOCK_PLUGIN ?= 'python3-dnf-plugin-versionlock'; + # Remove deprecated options prefix "/system/aii/osinstall/ks"; "mouse" = null; diff --git a/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan b/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan index 6e33ac22..d3da38f6 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan @@ -2,6 +2,8 @@ template quattor/aii/ks/variants/el9; +variable AII_OSINSTALL_VERSIONLOCK_PLUGIN ?= 'python3-dnf-plugin-versionlock'; + # Remove deprecated options prefix "/system/aii/osinstall/ks"; "mouse" = null; From 5fc2d876fc8e2c0f49f647125a2e41eb634f289d Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Tue, 12 Nov 2024 11:54:59 +0100 Subject: [PATCH 4/6] Fix indentation in ks/config and pxelinux/config --- aii-ks/src/main/pan/quattor/aii/ks/config.pan | 86 ++++++++++--------- .../main/pan/quattor/aii/pxelinux/config.pan | 16 ++-- 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/aii-ks/src/main/pan/quattor/aii/ks/config.pan b/aii-ks/src/main/pan/quattor/aii/ks/config.pan index dbec5cbd..6c092c6c 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/config.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/config.pan @@ -31,8 +31,10 @@ variable AII_OSINSTALL_CLEARPART_BOOT_ONLY ?= false; # Also ensure that AII_OSINSTALL_SRV has no trailing /. # variable AII_OSINSTALL_SRV ?= { - error("You need to define variable AII_OSINSTALL_SRV (generally the Quattor server) " + - " in order to use AII templates"); + error( + "You need to define variable AII_OSINSTALL_SRV (generally the Quattor server) " + + " in order to use AII templates" + ); }; variable AII_OSINSTALL_SRV = { @@ -65,11 +67,11 @@ variable AII_OSINSTALL_PATH ?= undef; # defaults to http # variable AII_OSINSTALL_PROTOCOL ?= - if ( exists("/system/aii/osinstall/ks/osinstall_protocol") ) { - error('Use AII_OSINSTALL_PROTOCOL to define installation protocol'); - } else { - 'http'; - }; +if ( exists("/system/aii/osinstall/ks/osinstall_protocol") ) { + error('Use AII_OSINSTALL_PROTOCOL to define installation protocol'); +} else { + 'http'; +}; "osinstall_protocol" ?= AII_OSINSTALL_PROTOCOL; # Be sure AII_OSINSTALL_PROTOCOL matches osinstall_protocol in case the latter was defined first. # For backward compatibility, as in previous versions, osinstall_protocol was explicitly defined by sites. @@ -94,22 +96,22 @@ variable DEBUG = debug( OBJECT, AII_OSINSTALL_ROOT, AII_OSINSTALL_OS_VERSION -)); +); # AII_OSINSTALL_SUBURL allows to specify a sub-url under root/version # (e.g. /base) variable AII_OSINSTALL_SUBURL ?= undef; variable AII_OSINSTALL_PATH ?= - if ( is_defined(AII_OSINSTALL_ROOT) && is_defined(AII_OSINSTALL_OS_VERSION) ) { - path = AII_OSINSTALL_ROOT + '/' + AII_OSINSTALL_OS_VERSION; - if ( is_defined(AII_OSINSTALL_SUBURL) ) { - path = path + AII_OSINSTALL_SUBURL; - }; - path; - } else { - debug('AII_OSINSTALL_ROOT or AII_OSINSTALL_OS_VERSION undefined: cannot define AII_OSINSTALL_PATH'); +if ( is_defined(AII_OSINSTALL_ROOT) && is_defined(AII_OSINSTALL_OS_VERSION) ) { + path = AII_OSINSTALL_ROOT + '/' + AII_OSINSTALL_OS_VERSION; + if ( is_defined(AII_OSINSTALL_SUBURL) ) { + path = path + AII_OSINSTALL_SUBURL; }; + path; +} else { + debug('AII_OSINSTALL_ROOT or AII_OSINSTALL_OS_VERSION undefined: cannot define AII_OSINSTALL_PATH'); +}; # SElinux default configuration at installation time. @@ -124,8 +126,10 @@ variable AII_OSINSTALL_SELINUX ?= 'disabled'; # "installtype" ?= { if ( !is_defined(AII_OSINSTALL_PATH) && !is_defined(BASE_OS_REPOSITORY_TEMPLATE) ) { - error("You need to define the variable AII_OSINSTALL_PATH or BASE_OS_REPOSITORY_TEMPLATE" - + " (base OS distribution location on the Quattor server)"); + error( + "You need to define the variable AII_OSINSTALL_PATH or BASE_OS_REPOSITORY_TEMPLATE" + + " (base OS distribution location on the Quattor server)" + ); }; if ( match(AII_OSINSTALL_PROTOCOL, "^https?") ) { @@ -242,8 +246,8 @@ variable AII_OSINSTALL_DISKS = { if ( is_defined(AII_OSINSTALL_OPTION_CLEARPART) ) { if ( is_list(AII_OSINSTALL_OPTION_CLEARPART) ) { SELF['clearpart'] = AII_OSINSTALL_OPTION_CLEARPART; - foreach (i; disk; AII_OSINSTALL_OPTION_CLEARPART) { - explicit_clearpath[disk] = ''; + foreach (i; disk; AII_OSINSTALL_OPTION_CLEARPART) { + explicit_clearpath[disk] = ''; }; } else { error('AII_OSINSTALL_OPTION_CLEARPART must be a list'); @@ -288,15 +292,17 @@ variable AII_OSINSTALL_DISKS = { SELF['clearpart'][length(SELF['clearpart'])] = unescape(disk); }; } else { - clearpart_enabled = false; + clearpart_enabled = false; }; # Define only if there is an explicit boot property defined, else let undefined if ( exists(params['boot']) && params['boot'] ) { if ( clearpart_enabled ) { SELF['boot_order'][length(SELF['boot_order'])] = unescape(disk); } else { - error('HW description inconsistency: ' + disk + - ' defined as a boot disk but clearing of partitions disabled'); + error( + 'HW description inconsistency: ' + disk + + ' defined as a boot disk but clearing of partitions disabled' + ); }; }; } else { @@ -359,22 +365,16 @@ variable AII_OSINSTALL_OPTION_FIREWALL ?= null; # (as defined by AII_KS_OS_MAJOR_SPECIFIC_INCLUDE, default value should be appropriate when using QWG templates). Variants for minor # OS versions are located into the related OS templates ((as defined by AII_KS_OS_MINOR_SPECIFIC_INCLUDE, default value should be appropriate when using QWG # templates). When both exist, they are both applied. -variable AII_KS_OS_MAJOR_SPECIFIC_INCLUDE ?= - if ( is_defined(OS_VERSION_PARAMS['major']) ) { - if_exists('quattor/aii/ks/variants/' + OS_VERSION_PARAMS['major']); - } else { - undef; - }; +variable AII_KS_OS_MAJOR_SPECIFIC_INCLUDE ?= if ( is_defined(OS_VERSION_PARAMS['major']) ) { + if_exists('quattor/aii/ks/variants/' + OS_VERSION_PARAMS['major']); +}; include { debug('KS specific configuration for OS major version: ' + to_string(AII_KS_OS_MAJOR_SPECIFIC_INCLUDE)); AII_KS_OS_MAJOR_SPECIFIC_INCLUDE; }; # Existence of OS_VERSION_PARAMS['minor'] is used as a QWG signature -variable AII_KS_OS_MINOR_SPECIFIC_INCLUDE ?= - if ( is_defined(OS_VERSION_PARAMS['minor']) ) { - if_exists('config/quattor/ks'); - } else { - undef; +variable AII_KS_OS_MINOR_SPECIFIC_INCLUDE ?= if ( is_defined(OS_VERSION_PARAMS['minor']) ) { + if_exists('config/quattor/ks'); }; include { debug('KS specific configuration for OS minor release: ' + to_string(AII_KS_OS_MINOR_SPECIFIC_INCLUDE)); @@ -460,16 +460,18 @@ include 'components/ccm/config'; variable AII_USE_CCM ?= exists("/software/components/ccm") && is_defined("/software/components/ccm"); variable AII_PROFILE_PATH ?= "/profiles"; variable AII_OSINSTALL_NODEPROFILE ?= - if (AII_USE_CCM) { - if (exists("/software/components/ccm/profile") && !(value("/software/components/ccm/profile") == '' )) { - value("/software/components/ccm/profile"); - } else { - error("Can't find value for the profile url at /software/components/ccm/profile. " + - "If you don't use ccm, set the variable AII_USE_CCM to false."); - }; +if (AII_USE_CCM) { + if (exists("/software/components/ccm/profile") && !(value("/software/components/ccm/profile") == '' )) { + value("/software/components/ccm/profile"); } else { - format("http://%s%s/%s.xml", AII_CDB_SRV, AII_PROFILE_PATH, OBJECT); + error( + "Can't find value for the profile url at /software/components/ccm/profile. " + + "If you don't use ccm, set the variable AII_USE_CCM to false." + ); }; +} else { + format("http://%s%s/%s.xml", AII_CDB_SRV, AII_PROFILE_PATH, OBJECT); +}; "node_profile" ?= AII_OSINSTALL_NODEPROFILE; # diff --git a/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan b/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan index 226b2b06..f2068b35 100644 --- a/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan +++ b/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan @@ -113,20 +113,16 @@ variable AII_NBP_ROOT ?= { }; "/system/aii/nbp/pxelinux/kernel" ?= - if ( is_defined(AII_NBP_ROOT) ) { - format('%s/vmlinuz', AII_NBP_ROOT); - } else { - undef; - }; +if ( is_defined(AII_NBP_ROOT) ) { + format('%s/vmlinuz', AII_NBP_ROOT); +}; variable AII_NBP_INITRD ?= "initrd.img"; "/system/aii/nbp/pxelinux/initrd" ?= - if ( is_defined(AII_NBP_ROOT) ) { - format('%s/%s', AII_NBP_ROOT, AII_NBP_INITRD); - } else { - undef; - }; +if ( is_defined(AII_NBP_ROOT) ) { + format('%s/%s', AII_NBP_ROOT, AII_NBP_INITRD); +}; variable AII_NBP_KERNELPARAMS ?= null; From 11a32879a89e3b700d747a5b750651f98f9d035b Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Wed, 13 Nov 2024 17:09:52 +0100 Subject: [PATCH 5/6] KS EL9: remove chkconfig and initscripts from base installation --- aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan | 4 ---- 1 file changed, 4 deletions(-) diff --git a/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan b/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan index d3da38f6..62e192e6 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/variants/el9.pan @@ -12,10 +12,6 @@ prefix "/system/aii/osinstall/ks"; # Required by perl-CDB_File "packages" = append("perl-English"); -# Required by some Quattor components and must be installed before -# /etc/init.d is created by something else (e.g. a Quattor package) -"packages" = append("chkconfig"); -"packages" = append("initscripts"); "part_label" = true; "volgroup_required" = false; From 5cf6487a6f64bd4be8c20c1a81054bb57aedea8b Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Wed, 13 Nov 2024 17:21:18 +0100 Subject: [PATCH 6/6] Miscellenaous cleanups --- aii-ks/src/main/pan/quattor/aii/ks/config.pan | 18 ++++++++---------- .../main/pan/quattor/aii/pxelinux/config.pan | 8 +++----- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/aii-ks/src/main/pan/quattor/aii/ks/config.pan b/aii-ks/src/main/pan/quattor/aii/ks/config.pan index 6c092c6c..5a026339 100644 --- a/aii-ks/src/main/pan/quattor/aii/ks/config.pan +++ b/aii-ks/src/main/pan/quattor/aii/ks/config.pan @@ -66,8 +66,7 @@ variable AII_OSINSTALL_PATH ?= undef; # Installation protocol (http or nfs) # defaults to http # -variable AII_OSINSTALL_PROTOCOL ?= -if ( exists("/system/aii/osinstall/ks/osinstall_protocol") ) { +variable AII_OSINSTALL_PROTOCOL ?= if ( exists("/system/aii/osinstall/ks/osinstall_protocol") ) { error('Use AII_OSINSTALL_PROTOCOL to define installation protocol'); } else { 'http'; @@ -102,8 +101,7 @@ variable DEBUG = debug( # (e.g. /base) variable AII_OSINSTALL_SUBURL ?= undef; -variable AII_OSINSTALL_PATH ?= -if ( is_defined(AII_OSINSTALL_ROOT) && is_defined(AII_OSINSTALL_OS_VERSION) ) { +variable AII_OSINSTALL_PATH ?= if ( is_defined(AII_OSINSTALL_ROOT) && is_defined(AII_OSINSTALL_OS_VERSION) ) { path = AII_OSINSTALL_ROOT + '/' + AII_OSINSTALL_OS_VERSION; if ( is_defined(AII_OSINSTALL_SUBURL) ) { path = path + AII_OSINSTALL_SUBURL; @@ -300,8 +298,9 @@ variable AII_OSINSTALL_DISKS = { SELF['boot_order'][length(SELF['boot_order'])] = unescape(disk); } else { error( - 'HW description inconsistency: ' + disk + - ' defined as a boot disk but clearing of partitions disabled' + 'HW description inconsistency: %s defined as a boot disk ' + + 'but clearing of partitions disabled', + disk, ); }; }; @@ -369,7 +368,7 @@ variable AII_KS_OS_MAJOR_SPECIFIC_INCLUDE ?= if ( is_defined(OS_VERSION_PARAMS[ if_exists('quattor/aii/ks/variants/' + OS_VERSION_PARAMS['major']); }; include { - debug('KS specific configuration for OS major version: ' + to_string(AII_KS_OS_MAJOR_SPECIFIC_INCLUDE)); + debug('KS specific configuration for OS major version: %s', to_string(AII_KS_OS_MAJOR_SPECIFIC_INCLUDE)); AII_KS_OS_MAJOR_SPECIFIC_INCLUDE; }; # Existence of OS_VERSION_PARAMS['minor'] is used as a QWG signature @@ -377,7 +376,7 @@ variable AII_KS_OS_MINOR_SPECIFIC_INCLUDE ?= if ( is_defined(OS_VERSION_PARAMS[ if_exists('config/quattor/ks'); }; include { - debug('KS specific configuration for OS minor release: ' + to_string(AII_KS_OS_MINOR_SPECIFIC_INCLUDE)); + debug('KS specific configuration for OS minor release: %s', to_string(AII_KS_OS_MINOR_SPECIFIC_INCLUDE)); AII_KS_OS_MINOR_SPECIFIC_INCLUDE; }; @@ -459,8 +458,7 @@ variable AII_ACK_LIST ?= list(format("%s://%s%s", AII_ACK_PROTOCOL, AII_ACK_SRV, include 'components/ccm/config'; variable AII_USE_CCM ?= exists("/software/components/ccm") && is_defined("/software/components/ccm"); variable AII_PROFILE_PATH ?= "/profiles"; -variable AII_OSINSTALL_NODEPROFILE ?= -if (AII_USE_CCM) { +variable AII_OSINSTALL_NODEPROFILE ?= if (AII_USE_CCM) { if (exists("/software/components/ccm/profile") && !(value("/software/components/ccm/profile") == '' )) { value("/software/components/ccm/profile"); } else { diff --git a/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan b/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan index f2068b35..11213930 100644 --- a/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan +++ b/aii-pxelinux/src/main/pan/quattor/aii/pxelinux/config.pan @@ -99,7 +99,7 @@ variable AII_NBP_ROOT ?= { if (LPXELINUX) { root = LPXELINUX_ROOT; } else { - toks = matches(AII_OSINSTALL_OS_VERSION, '^([\w\.]+?)[_\-](.*)$'); + toks = matches(AII_OSINSTALL_OS_VERSION, '^([\w\.]+?)[_\-](.*)$'); if ( length(toks) < 3 ) { root = undef; } else { @@ -112,15 +112,13 @@ variable AII_NBP_ROOT ?= { root; }; -"/system/aii/nbp/pxelinux/kernel" ?= -if ( is_defined(AII_NBP_ROOT) ) { +"/system/aii/nbp/pxelinux/kernel" ?= if ( is_defined(AII_NBP_ROOT) ) { format('%s/vmlinuz', AII_NBP_ROOT); }; variable AII_NBP_INITRD ?= "initrd.img"; -"/system/aii/nbp/pxelinux/initrd" ?= -if ( is_defined(AII_NBP_ROOT) ) { +"/system/aii/nbp/pxelinux/initrd" ?= if ( is_defined(AII_NBP_ROOT) ) { format('%s/%s', AII_NBP_ROOT, AII_NBP_INITRD); };