added #fixed-address-ipv6 in dhcpd.conf for reference

This commit is contained in:
mischa 2020-09-23 22:19:16 +02:00
parent 3373bfffa5
commit 50a2546d18
6 changed files with 15 additions and 6 deletions

View File

@ -36,11 +36,12 @@ if vmctl show ${1%.txt} >/dev/null 2>&1; then
exit 1
fi
if vmctl show ${1%.txt} | grep stopped >/dev/null 2>&1; then
echo -n "Current rDNS: "
dig +short -x $(grep -A2 ${1%.txt} /etc/dhcpd.conf | awk '/fixed/ {print $2}' | tr -d ';')
remove.pl ${1}
deploy.pl
rcctl restart dhcpd
vmctl reload
dig +short -x $(grep -A2 vm26 /etc/dhcpd.conf | awk '/fixed/ {print $2}' | tr -d ';')
fi
fi

View File

@ -25,6 +25,7 @@
# 2020/05/10 changed: includes all install sets, inline with sysupgrade
# 2020/05/22 changed: set the hosts password for the users
# 2020/05/24 changed: add staggered option to vm.conf, leave disable for now
# 2020/09/20 changed: add agentx option to vm.conf for OpenBSD 6.8
#
use 5.024;
use strict;
@ -75,11 +76,16 @@ sub render_vm_conf {
my %conf = %{$_[0]};
my %vms = %{$_[1]};
my $_etc = $conf{'conf'}{'ETC'};
my $_VERSION = qx(uname -r);
open my $fh_vm, ">", "$_etc/vm.conf";
printf $fh_vm "#\n# File generated by deploy.pl\n#\n";
printf $fh_vm "socket owner :%s\n", $conf{'conf'}{'VMDUSERS'};
printf $fh_vm "staggered start parallel 2 delay 90\n\n";
printf $fh_vm "staggered start parallel 2 delay 90\n";
if ($_VERSION > 6.7) {
printf $fh_vm "agentx\n";
}
printf $fh_vm "\n";
printf $fh_vm "switch \"%s\" {\n", $conf{'conf'}{'SWITCH'};
printf $fh_vm "\tinterface %s\n", $conf{'conf'}{'INTERFACE'};
printf $fh_vm "}\n\n";
@ -141,11 +147,13 @@ sub render_dhcpd_conf {
my $_disk = $conf{'conf'}{'IMAGES'} . "/" . $_instance . "." . $_disk_format;
my $_mac = $vms{$vm_name}{'mac'} || $conf{'conf'}{'MAC_PREFIX'} . ":" . $vms{$vm_name}{'vm_number'};
my $_ip = $vms{$vm_name}{'ip'} || $conf{'conf'}{'IP_PREFIX'} . "." . ($conf{'conf'}{'IP_START'} + $vms{$vm_name}{'vm_number'});
my $_ipv6 = $conf{'conf'}{'IPV6_PREFIX'} . ":" . ($conf{'conf'}{'IPV6_START'} + $vms{$vm_name}{'vm_number'}) . "::" . ($conf{'conf'}{'IP_START'} + $vms{$vm_name}{'vm_number'});
my $_hostname = $vms{$vm_name}{'hostname'};
printf $fh_dhcpd "\thost %s {\n", $_instance;
printf $fh_dhcpd "\t\thardware ethernet %s;\n", $_mac;
printf $fh_dhcpd "\t\tfixed-address %s;\n", $_ip;
printf $fh_dhcpd "\t\t#fixed-address-ipv6 %s;\n", $_ipv6;
if (! -e $_disk) {
printf $fh_dhcpd "\t\tfilename \"auto_install\";\n";
} else {

View File

@ -1,5 +1,6 @@
From: admin
Subject: OpenBSD Amsterdam Renewal YEAR
Content-Type: text/plain; charset=utf-8
Hi NAME,

View File

@ -1,4 +1,3 @@
#!/bin/sh
#
# Copyright (c) 2019 Mischa Peters <mischa @ openbsd.amsterdam>

View File

@ -1,3 +1,3 @@
#!/bin/sh
OPTIONS=${1:--qa}
/usr/local/bin/rsync ${OPTIONS} /etc /var/www/htdocs /home/mischa backup.openbsd.amsterdam::obsdams/$(hostname -s)
/usr/local/bin/rsync ${OPTIONS} /etc /home/mischa /var/nsd /var/unbound /var/www n1.high5.nl::obsdams/$(hostname -s) --del

View File

@ -2,11 +2,11 @@ mac="fe:e1:ab:dd:73:a4"
ip="192.168.1.1"
instance="superduper1"
owner="testuser1"
date="2018/06/02"
date="2018/09/02"
payment="70"
donated=""
name="Test1 User"
email="devtest19@openbsd.amsterdam"
email="mischa@high5.nl"
sshkey="ssh-ed25519 AAAAC3NzDITE5AAAAik7Lmiq4l4gCoYCLkJ9wlqpNhR1gUnP5EnXJXzvMVl"
hostname="deploytest1"
username="deploytest1"