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 <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-09-18 21:08:23 +02:00
parent 495c347e77
commit eb7b6eb78a
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
3 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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"

View File

@ -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"))))