Ensure defaults are always set

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:58 -04:00
parent b18f1d85d6
commit efc152b6a6
2 changed files with 26 additions and 1 deletions

View File

@ -11,13 +11,17 @@
### General definitions/overrides ### General definitions/overrides
### ###
{% if debrelease is defined and debrelease %}
# The Debian release to use (overrides the default) # The Debian release to use (overrides the default)
#debrelease="buster" #debrelease="buster"
debrelease="{debrelease}" debrelease="{debrelease}"
{% endif %}
{% if debmirror is defined and debmirror %}
# The Debian mirror to use (overrides the default) # The Debian mirror to use (overrides the default)
#debmirror="http://debian.mirror.rafal.ca/debian" #debmirror="http://debian.mirror.rafal.ca/debian"
debmirror="{debmirror}" debmirror="{debmirror}"
{% endif %}
{% if addpkglist is defined and addpkglist %} {% if addpkglist is defined and addpkglist %}
# Additional packages (comma-separated) to install in the base system # Additional packages (comma-separated) to install in the base system
@ -25,6 +29,12 @@ debmirror="{debmirror}"
addpkglist="{addpkglist}" addpkglist="{addpkglist}"
{% endif %} {% endif %}
{% if filesystem is defined and filesystem %}
# Alternate filesystem for system volumes (/, /var/lib/ceph, /var/lib/zookeeper)
#filesystem=ext4
filesystem="{filesystem}"
{% endif %}
{% if skip_blockcheck is defined and skip_blockcheck %} {% if skip_blockcheck is defined and skip_blockcheck %}
# Skip block zeroing; only recommended for testing, slow, low-endurance, or known-zeroed block devices. # Skip block zeroing; only recommended for testing, slow, low-endurance, or known-zeroed block devices.
skip_blockcheck="y" skip_blockcheck="y"

View File

@ -133,9 +133,24 @@ seed_config() {
# Fetch the seed config # Fetch the seed config
tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed
# Load the variables from the seed config
. /tmp/install.seed || exit 1 . /tmp/install.seed || exit 1
if [[ -n "${addpkglist}" ]]; then # Ensure optional configurations are set to defaults if unset
if [[ -z ${filesystem} ]]; then
filesystem="${default_filesystem}"
fi
if [[ -z ${debrelease} ]]; then
debrelease="${default_debrelease}"
fi
if [[ -z ${debmirror} ]]; then
debmirror="${default_debmirror}"
fi
# Append the addpkglist to the suppkglist if present
if [[ -n ${addpkglist} ]]; then
suppkglist="${suppkglist},${addpkglist}" suppkglist="${suppkglist},${addpkglist}"
fi fi