From 41c45ef133d998c31c7c8cd959f664edb66525e6 Mon Sep 17 00:00:00 2001 From: AJ Schroeder <6432150+ajschroeder@users.noreply.github.com> Date: Sat, 29 Jun 2024 10:38:30 -0500 Subject: [PATCH] feat: added network preseed template and vars file --- .../linux/debian/12/data/network.pkrtpl.hcl | 9 +++++ .../linux/debian/12/variables-network.pkr.hcl | 36 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 builds/linux/debian/12/data/network.pkrtpl.hcl create mode 100644 builds/linux/debian/12/variables-network.pkr.hcl diff --git a/builds/linux/debian/12/data/network.pkrtpl.hcl b/builds/linux/debian/12/data/network.pkrtpl.hcl new file mode 100644 index 0000000..fe4c0c9 --- /dev/null +++ b/builds/linux/debian/12/data/network.pkrtpl.hcl @@ -0,0 +1,9 @@ +d-i netcfg/choose_interface select ${device} +%{ if ip != null ~} +d-i netcfg/disable_autoconfig boolean true +d-i netcfg/get_ipaddress string ${ip} +d-i netcfg/get_netmask string ${cidrnetmask("${ip}/${netmask}")} +d-i netcfg/get_gateway string ${gateway} +d-i netcfg/get_nameservers string ${join(" ", dns)} +d-i netcfg/confirm_static boolean true +%{ endif ~} \ No newline at end of file diff --git a/builds/linux/debian/12/variables-network.pkr.hcl b/builds/linux/debian/12/variables-network.pkr.hcl new file mode 100644 index 0000000..d2d6996 --- /dev/null +++ b/builds/linux/debian/12/variables-network.pkr.hcl @@ -0,0 +1,36 @@ +/* + DESCRIPTION: + Debian Linux 11 network variables used by the Packer Plugin for VMware vSphere (vsphere-iso). +*/ + +// VM Network Settings + +variable "vm_network_device" { + type = string + description = "The network device of the VM." + default = "ens192" +} + +variable "vm_ip_address" { + type = string + description = "The IP address of the VM (e.g. 172.16.100.192)." + default = null +} + +variable "vm_ip_netmask" { + type = number + description = "The netmask of the VM (e.g. 24)." + default = null +} + +variable "vm_ip_gateway" { + type = string + description = "The gateway of the VM (e.g. 172.16.100.1)." + default = null +} + +variable "vm_dns_list" { + type = list(string) + description = "The nameservers of the VM." + default = [] +} \ No newline at end of file