nomad/jobs/user-vms/bastion.hcl
wizzdom 32f645b3ee bastion-vm: use preconfigured image
configures the bastion-vm job to use a preconfigured image rather than a
base debian image with cloudinit configs.

Tested: 27/01/2024
2024-02-03 17:37:31 +00:00

51 lines
978 B
HCL

job "bastion-vm" {
datacenters = ["aperture"]
group "bastion-vm" {
network {
mode = "host"
}
service {
name = "bastion-vm"
}
task "bastion-vm" {
constraint {
attribute = "${attr.unique.hostname}"
value = "chell"
}
resources {
cpu = 12000
memory = 4096
}
artifact {
source = "http://10.10.0.5:8000/base-images/bastion-vm-latest.qcow2"
destination = "local/bastion-vm.qcow2"
mode = "file"
}
driver = "qemu"
config {
image_path = "local/bastion-vm.qcow2"
accelerator = "kvm"
drive_interface = "virtio"
args = [
"-netdev",
"bridge,id=hn0",
"-device",
"virtio-net-pci,netdev=hn0,id=nic1,mac=52:54:84:ba:49:02",
"-smbios",
#"type=1,serial=ds=nocloud-net;s=http://10.10.0.5:8000/bastion-vm/",
"type=1",
]
}
}
}
}