From a4f218dc99a12b726a8acf0ba063fce3e2e53a43 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Sat, 18 Mar 2023 13:12:45 +0000 Subject: [PATCH] add vm job config with networking --- jobs/user-vms/distro.hcl | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) mode change 100755 => 100644 jobs/user-vms/distro.hcl diff --git a/jobs/user-vms/distro.hcl b/jobs/user-vms/distro.hcl old mode 100755 new mode 100644 index a85f32c..0185827 --- a/jobs/user-vms/distro.hcl +++ b/jobs/user-vms/distro.hcl @@ -4,10 +4,6 @@ job "distro-vm" { group "distro-vm" { network { - port "ssh" { - to = -1 - } - mode = "host" } @@ -16,6 +12,11 @@ job "distro-vm" { } task "distro-vm" { + constraint { + attribute = "${attr.unique.hostname}" + value = "wheatley" + } + resources { cpu = 1000 memory = 1024 @@ -36,17 +37,13 @@ job "distro-vm" { drive_interface = "virtio" - port_map { - ssh = 22 - } - args = [ - "-net", - "nic,model=virtio", - "-net", - "user", + "-netdev", + "bridge,id=hn0", + "-device", + "virtio-net-pci,netdev=hn0,id=nic1", "-smbios", - "type=1,serial=ds=nocloud-net;s=http://10.10.0.4:8000/", + "type=1,serial=ds=nocloud-net;s=http://136.206.16.5:8000/", ] } }