diff --git a/recipes/alpine/locals.matchbox.pkr.hcl b/recipes/alpine/locals.matchbox.pkr.hcl index 1a76d4a..07ac59c 100644 --- a/recipes/alpine/locals.matchbox.pkr.hcl +++ b/recipes/alpine/locals.matchbox.pkr.hcl @@ -9,6 +9,13 @@ locals { owner = "root" group = "root" }, + { + destination = "/etc/dnsmasq-hosts.conf" + source = "dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl" + mode = "600" + owner = "root" + group = "root" + }, { destination = "/etc/conf.d/matchbox" source = "conf.d/matchbox.conf.pktpl.hcl" @@ -77,6 +84,9 @@ locals { DNS = "" GATEWAY = "" } + Set = { + Hostname = "matchbox" + } } Users = {} Daemons = { diff --git a/recipes/alpine/templates/conf/matchbox/dnsmasq.d/ipxe.conf.pktpl.hcl b/recipes/alpine/templates/conf/matchbox/dnsmasq.d/ipxe.conf.pktpl.hcl index f80412e..195d368 100644 --- a/recipes/alpine/templates/conf/matchbox/dnsmasq.d/ipxe.conf.pktpl.hcl +++ b/recipes/alpine/templates/conf/matchbox/dnsmasq.d/ipxe.conf.pktpl.hcl @@ -5,8 +5,11 @@ log-dhcp listen-address=0.0.0.0 interface=${Vars.PXE.ListenInterface} no-resolv +domain-needed +bogus-priv expand-hosts server=${Vars.ETH0.DNS} +strict-order addn-hosts=/etc/dnsmasq-hosts.conf domain=${Vars.PXE.DNSDomain} diff --git a/recipes/alpine/templates/one/vm/matchbox.xml b/recipes/alpine/templates/one/vm/matchbox.xml index 53db3c1..e8e958a 100644 --- a/recipes/alpine/templates/one/vm/matchbox.xml +++ b/recipes/alpine/templates/one/vm/matchbox.xml @@ -1,14 +1,13 @@ NAME = "<%= template_name %>" CONTEXT = [ - DHCPLEASEDURATION = "$DHCPLEASEDURATION", - DHCPMODE = "$DHCPMODE", - DNSDOMAIN = "$DNSDOMAIN", MATCHBOX_URL = "http://$NAME", NETWORK = "YES", PXE_DHCPLEASEDURATION = "$DHCPLEASEDURATION", - PXE_DHCPMODE = "$DHCPMODE", - PXE_DHCPRANGESTART = "$ADHCPRANGESTART", - PXE_DHCPRANGEEND = "$BDHCPRANGEEND", + PXE_DHCPMODE = "$ADHCPMODE", + PXE_DNSDOMAIN = "$BDNSDOMAIN", + PXE_DHCPRANGESTART = "$CDHCPRANGESTART", + PXE_DHCPRANGEEND = "$DDHCPRANGEEND", + PXE_DHCPLEASEDURATION = "$EDHCPLEASEDURATION", REPORT_READY = "YES", SET_HOSTNAME = "$NAME", SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]", @@ -38,9 +37,9 @@ OS = [ BOOT = "", SD_DISK_BUS = "scsi" ] USER_INPUTS = [ - DHCPLEASEDURATION = "M|list|DHCP lease duration|1h,2h,4h,6h,8h,10h,12h,14h,24h|1h", - DHCPMODE = "M|list|DHCP Mode|proxy,direct|proxy", - DNSDOMAIN = "M|text|Nom de la zone DNS (ex: cadol.es)", - ADHCPRANGESTART = "O|text|DNSMASQ DHCP Range First IP", - BDHCPRANGEEND = "O|text|DNSMASQ DHCP Range Last IP" ] + ADHCPMODE = "M|list|DHCP Mode|proxy,direct|proxy", + BNSDOMAIN = "M|text|Nom de la zone DNS (ex: cadol.es)", + CADHCPRANGESTART = "O|text|DNSMASQ DHCP Range First IP", + DBDHCPRANGEEND = "O|text|DNSMASQ DHCP Range Last IP", + EDHCPLEASEDURATION = "M|list|DHCP lease duration|1h,2h,4h,6h,8h,10h,12h,14h,24h|1h" ] VCPU = "2"