feat: added network template and vars file

This commit is contained in:
AJ Schroeder
2024-06-29 10:53:12 -05:00
parent 76f79e8678
commit a3181105ba
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
network:
network:
version: 2
ethernets:
%{ if ip != null ~}
${device}:
dhcp4: false
addresses:
- ${ip}/${netmask}
gateway4: ${gateway}
nameservers:
addresses:
%{ for item in dns ~}
- ${item}
%{ endfor ~}
%{ else ~}
${device}:
dhcp4: true
%{ endif ~}

View File

@@ -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 = "ens18"
}
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 = []
}