From 3b5f18114d9a1a7cd54bbc5b1b69b7ecf5924efd Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Thu, 5 Jan 2023 13:51:45 +0100 Subject: [PATCH] fup --- recipes/alpine/locals.matchbox.pkr.hcl | 4 ++-- .../conf/matchbox/dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl | 5 ++++- recipes/alpine/templates/one/vm/matchbox.xml | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/alpine/locals.matchbox.pkr.hcl b/recipes/alpine/locals.matchbox.pkr.hcl index 07ac59c..f75f3b7 100644 --- a/recipes/alpine/locals.matchbox.pkr.hcl +++ b/recipes/alpine/locals.matchbox.pkr.hcl @@ -13,7 +13,7 @@ locals { destination = "/etc/dnsmasq-hosts.conf" source = "dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl" mode = "600" - owner = "root" + owner = "dnsmasq" group = "root" }, { @@ -74,7 +74,7 @@ locals { DHCPLeaseDuration = "12h" } MatchBox = { - URL = "" + Hostname = "mb.cadoles.com" HTTPPort = "8080" gRPCPort = "8081" LogLevel = "info" diff --git a/recipes/alpine/templates/conf/matchbox/dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl b/recipes/alpine/templates/conf/matchbox/dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl index 74016c3..a8461dd 100644 --- a/recipes/alpine/templates/conf/matchbox/dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl +++ b/recipes/alpine/templates/conf/matchbox/dnsmasq.d/dnsmasq-hosts.conf.pktpl.hcl @@ -1 +1,4 @@ -${Vars.ETH0.IP} ${Vars.Set.Hostname} \ No newline at end of file +${Vars.ETH0.IP} ${Vars.Set.Hostname} +%{ if Vars.MatchBox.Hostname != "" } +${Vars.ETHO.IP} ${Vars.MatchBox.Hostname} +%{ endif } \ No newline at end of file diff --git a/recipes/alpine/templates/one/vm/matchbox.xml b/recipes/alpine/templates/one/vm/matchbox.xml index 028c8f1..aeecce5 100644 --- a/recipes/alpine/templates/one/vm/matchbox.xml +++ b/recipes/alpine/templates/one/vm/matchbox.xml @@ -8,6 +8,7 @@ CONTEXT = [ PXE_DHCPRANGESTART = "$CDHCPRANGESTART", PXE_DHCPRANGEEND = "$DDHCPRANGEEND", PXE_DHCPLEASEDURATION = "$EDHCPLEASEDURATION", + MATCHBOX_HOSTNAME = "$FMATCHBOX_HOSTNAME", REPORT_READY = "YES", SET_HOSTNAME = "$NAME", SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]", @@ -41,5 +42,6 @@ USER_INPUTS = [ BDNSDOMAIN = "M|text|Nom de la zone DNS (ex: cadol.es)", CDHCPRANGESTART = "O|text|DNSMASQ DHCP Range First IP", DDHCPRANGEEND = "O|text|DNSMASQ DHCP Range Last IP", - EDHCPLEASEDURATION = "M|list|DHCP lease duration|1h,2h,4h,6h,8h,10h,12h,14h,24h|1h" ] + EDHCPLEASEDURATION = "M|list|DHCP lease duration|1h,2h,4h,6h,8h,10h,12h,14h,24h|1h", + FMATCHBOX_HOSTNAME = "O|text|Matchbox service hostname"|mb.cadol.es ] VCPU = "2"