Appendix: Variable Substition

Data that is downloaded or processed by a ClusterWare head node can often include per-node modifications through a variable substitution framework. Much like a templating system, an admin can create a baseline file, e.g. a kickstart file, and have ClusterWare automatically replace entries with node- or head-specific data. Thus, one can dynamically include the node's name or IP address, or a head-node's base URL or key information.

# example kickstart fragment

# Perform a SOL friendly text-based install.
text

# Pull some basics from the head node.
url --url <root_url()>
lang <head[lang]>
keyboard <head[keymap]>
timezone <head[timezone]>

# include another file
<include(partial.ks)>

ClusterWare currently allows variable substitution in kickstart files, ZTP scripts and configuration files, and the power_uri field for a node. The goal of these substitutions is to provide mechanisms to generalize the files for simpler configuration with fewer node-specific files or commands.

The <include(partial.ks)> tag shown in the example includes another file into the output, performing variable substitution on the included content as well. The include tag allows a cluster administrator to break larger files into manageable hunks that can then be included into a top-level kickstart file, much like a C or C++ #include <filename>.

Node Attributes, Hardware, and Status

Any node's attribute can be referenced as <a[name]> or <attributes[name]> and that text will be replaced with the value corresponding to the “name”. Similarly, values from the hardware section of scyld-nodectl ls -L can be referenced as <h[name]> or <hardware[name]> and status information is referenced as <s[name]> or <status[name]>. Fields outside of attributes and hardware, such as index, ip, or MAC can be referenced by <n[name]> or <node[name]>.

Head Node Substitutions

In addition to compute node-specific fields, a few head node-specific fields are also available in kickstart files:

head[keymap]

Kickstart keymap arguments like --vckeymap=X --xlayouts=Y

head[lang]

System locale

head[timezone]

Time zone

When used within downloadable text files, such as kickstart and ZTP files, a few other parameters are available as well:

param[X]

X is a parameter provided as part of the requesting URL

cw[base_url]

A base URL that should be functional for the requestor

cw[head]

IP address of the parent head node extracted from the base URL

cw[keys]

System-wide authorized keys list including head node keys and cluster administrator keys. Suitable for appending to .ssh/authorized_keys

Kickstarting From A Repo

When downloading a kickstart file from a repo-based boot configuration, a URL parameter is added that references the repo, allowing for additional substitutions. In this case the substitutions are implemented as functions with a slightly different syntax:

<root_url()>

Link to the root of the full ISO file if the repo contains one

<iso_url()>

Link to the full ISO file if the repo contains one

<repo_url()>

Rarely if ever used. Refers to a specific URL in a ClusterWare repo

Note that all of these functions accept a repo name or UID as an argument but will use the automatically provided URL parameter if no repo is explicitly specified. The <repo_url()> function also includes a second optional integer argument to specify the index of the URL in the referenced repo.