From eb7b6eb78a5311a9c034004f66f8b120d98e8506 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 18 Sep 2023 21:08:23 +0200 Subject: [PATCH] Make the VM IPv4 configurable The default IP address is supposed to be used by Libre En Communs for the deployed VM. Signed-off-by: Denis 'GNUtoo' Carikli --- Makefile.am | 1 + configure.ac | 8 ++++++++ mumble-vm-system.scm.tmpl | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 447bd10..d7020c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,6 +38,7 @@ guix-commit.txt: Makefile sed \ "s#DOMAIN#$(DOMAIN)#g ; \ s#LETSENCRYPT_EMAIL#$(LETSENCRYPT_EMAIL)#g ; \ + s#VM_IPV4_ADDRESS#$(VM_IPV4_ADDRESS)#g ; \ s#VM_SSH_PUB_KEY#$(VM_SSH_PUB_KEY)#g" $< > $@ %.sh: %.sh.tmpl guix-commit.txt Makefile diff --git a/configure.ac b/configure.ac index c285d77..0b7d9e0 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,7 @@ AC_CHECK_PROG([SED], [sed], [sed]) AC_SUBST([DOMAIN], []) AC_SUBST([LETSENCRYPT_EMAIL], []) +AC_SUBST([VM_IPV4_ADDRESS], []) AC_SUBST([VM_SSH_PUB_KEY], []) AC_ARG_WITH([domain], @@ -40,6 +41,12 @@ AC_ARG_WITH([letsencrypt-email], [LETSENCRYPT_EMAIL=$withval], [LETSENCRYPT_EMAIL=cominfra@a-lec.org]) +AC_ARG_WITH([vm-ipv4-address], + [AS_HELP_STRING([--with-vm-ipv4-address=VM_IPV4_ADDRESS], [Use custom VM + IPv4 address. (default=192.168.1.117/24)])], + [VM_IPV4_ADDRESS=$withval], + [VM_IPV4_ADDRESS="192.168.1.117/24"]) + AC_ARG_WITH([vm-ssh-public-key], [AS_HELP_STRING([--with-ssh-vm-public-key=VM_SSH_PUB_KEY], [Use custom VM SSH public key for use with 'guix deploy'. (default=\ @@ -58,4 +65,5 @@ echo "Configuration options:" echo "======================" echo "- Domain: $DOMAIN" echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL" +echo "- VM IPv4 address: $VM_IPV4_ADDRESS" echo "- VM SSH public key: $VM_SSH_PUB_KEY" diff --git a/mumble-vm-system.scm.tmpl b/mumble-vm-system.scm.tmpl index 29c2e2f..bc90086 100644 --- a/mumble-vm-system.scm.tmpl +++ b/mumble-vm-system.scm.tmpl @@ -187,7 +187,7 @@ https://DOMAIN/ (static-networking (addresses (list (network-address (device "eth0") - (value "192.168.10.37/24")))) + (value "VM_IPV4_ADDRESS")))) (routes (list (network-route (destination "default") (gateway "192.168.10.1"))))