Experimental IPv6 installbox.

This commit is contained in:
Andreas B. Mundt 2022-06-25 10:11:57 +02:00 committed by Andreas B. Mundt
parent de2a473cde
commit 6438585128
5 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,20 @@
---
- name: restart radvd
systemd:
name: radvd.service
state: restarted
enabled: true
listen: restart radvd
- name: restart kea-dhcp6-server
systemd:
name: kea-dhcp6-server.service
state: restarted
enabled: true
listen: restart kea-dhcp6-server
- name: restart network interfaces
systemd:
name: networking
state: restarted
listen: reconfigure network

View file

@ -0,0 +1,39 @@
## DHCPv6, RAs and TFTP
---
- name: preseed aftpd
debconf:
name: atftpd
question: atftpd/basedir
value: /var/lib/tftpboot
vtype: string
- name: install di-netboot-assistant and installer package
apt:
name:
- kea-dhcp6-server
- radvd
- atftpd
state: latest # noqa package-latest
- name: configure radvd
template:
src: radvd.conf.j2
dest: /etc/radvd.conf
mode: 0644
notify: restart radvd
- name: configure kea-dhcp-server
template:
src: kea-dhcp6.conf.j2
dest: /etc/kea/kea-dhcp6.conf
mode: 0644
notify: restart kea-dhcp6-server
- name: set IPv6 address on interface
blockinfile:
path: /etc/network/interfaces
block: |
allow-hotplug {{ if_lan }}
iface {{ if_lan }} inet6 static
address 2001:db8:b001::1/64
notify: reconfigure network

View file

@ -0,0 +1,20 @@
{
"Dhcp6": {
"interfaces-config": {
"interfaces": [ "{{ if_lan }}" ]
},
"option-data": [
{
"name": "bootfile-url",
"data": "tftp://[2001:db8:b001::1]/d-i/n-a/grubx64.efi"
}
],
"subnet6": [
{
"subnet": "2001:db8:b001::/64",
"pools": [ { "pool": "2001:db8:b001::2 - 2001:db8:b001::ffff" } ],
"interface": "enp1s0"
}
]
}
}

View file

@ -0,0 +1,10 @@
interface {{ if_lan }}
{
AdvSendAdvert on;
AdvManagedFlag on;
AdvOtherConfigFlag on;
prefix {{ prefix }}
{
};
};