- Removed obsolete variable files: variables-common.pkr.hcl and variables.pkr.hcl. - Updated debian-trixie.pkr.hcl to include local values for LUKS configuration. - Modified boot command to include LUKS arguments based on the enable_luks variable. - Enhanced initial-setup.sh to support LUKS detection and resizing. - Replaced preseed.cfg with preseed.cfg.pkrtpl for dynamic LUKS configuration. - Added enable_luks variable to control LUKS encryption during image build. - Introduced luks.pkrvars.hcl for LUKS-specific variable settings. - Updated mise.toml to support new variable file argument for Packer builds.
56 lines
2.1 KiB
TOML
56 lines
2.1 KiB
TOML
|
|
[tasks.lint]
|
|
usage = '''
|
|
arg "<dir>" help="Directory containing the Packer template to lint e.g. debian/13-trixie"
|
|
'''
|
|
run = '''
|
|
packer fmt --recursive --check ${usage_dir?} \
|
|
&& packer validate ${usage_dir?}
|
|
'''
|
|
|
|
[tasks.fmt]
|
|
usage = '''
|
|
arg "<dir>" help="Directory containing the Packer template to format e.g. debian/13-trixie" default="."
|
|
'''
|
|
run = "packer fmt --recursive ${usage_dir?}"
|
|
|
|
[tasks.build]
|
|
usage = '''
|
|
arg "<dir>" help="Directory containing the Packer template to build e.g. debian/13-trixie"
|
|
flag "--var-file <path>" help="HCL var-file to pass to Packer"
|
|
flag "-i --install-finished-inform-port <port>" help="Server port to inform when installation is finished" hide=#true
|
|
'''
|
|
run = '''
|
|
mise run lint ${usage_dir?}
|
|
build_args=()
|
|
[[ -n "${usage_var_file}" ]] && build_args+=("-var-file=${usage_var_file?}")
|
|
[[ -n "${usage_install_finished_inform_port}" ]] && build_args+=("-var" "install_finished_inform_port=${usage_install_finished_inform_port?}")
|
|
packer build "${build_args[@]}" ${usage_dir?} || true
|
|
'''
|
|
|
|
[tasks.build-luks]
|
|
usage = '''
|
|
arg "<dir>" help="Directory containing the Packer template to build e.g. debian/13-trixie"
|
|
flag "--luks-wait-seconds <seconds>" help="Seconds to wait for the LUKS password prompt after installation before sending the password" default="45"
|
|
'''
|
|
run = '''
|
|
_scripts/unlock-luks-after-install.py -t ${usage_dir?} --var-file ${usage_dir?}/variants/luks.pkrvars.hcl --luks-wait-seconds ${usage_luks_wait_seconds?}
|
|
'''
|
|
|
|
[tasks.init]
|
|
usage = '''
|
|
arg "<dir>" help="Directory containing the Packer template to initialize e.g. debian/13-trixie"
|
|
'''
|
|
run = "packer init ${usage_dir?}"
|
|
|
|
[tasks.setup]
|
|
usage = '''
|
|
arg "<distribution>" help="The Linux distribution name (e.g. debian)"
|
|
arg "<version>" help="The Linux distribution version (e.g. 13-trixie)"
|
|
'''
|
|
run = '''
|
|
mkdir -p ${usage_distribution?}/${usage_version?} \
|
|
&& ln -s ../../credentials.auto.pkrvars.hcl ${usage_distribution?}/${usage_version?}/credentials.auto.pkrvars.hcl \
|
|
&& ln -s ../../variables-common.pkr.hcl ${usage_distribution?}/${usage_version?}/variables-common.pkr.hcl \
|
|
&& touch ${usage_distribution?}/${usage_version?}/${usage_distribution?}-${usage_version?}.pkr.hcl
|
|
'''
|