bundles/radvd: introduce, add to home.router
This commit is contained in:
parent
fa224a9939
commit
644eb37b82
6 changed files with 77 additions and 0 deletions
3
bundles/radvd/files/ip-down
Normal file
3
bundles/radvd/files/ip-down
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl stop radvd
|
3
bundles/radvd/files/ip-up
Normal file
3
bundles/radvd/files/ip-up
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl start radvd
|
16
bundles/radvd/files/radvd.conf
Normal file
16
bundles/radvd/files/radvd.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
% for interface, config in sorted(interfaces.items()):
|
||||
interface ${interface}
|
||||
{
|
||||
AdvSendAdvert on;
|
||||
prefix ${config.get('prefix', '::/64')}
|
||||
{
|
||||
AdvOnLink on;
|
||||
AdvAutonomous on;
|
||||
AdvRouterAddr on;
|
||||
};
|
||||
RDNSS ${' '.join(sorted(config['rdnss']))}
|
||||
{
|
||||
AdvRDNSSLifetime 900;
|
||||
};
|
||||
};
|
||||
% endfor
|
36
bundles/radvd/items.py
Normal file
36
bundles/radvd/items.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
if node.metadata.get('radvd', {}).get('integrate-with-pppd', False):
|
||||
files['/etc/ppp/ip-up.d/radvd'] = {
|
||||
'source': 'ip-up',
|
||||
'mode': '0755',
|
||||
}
|
||||
files['/etc/ppp/ip-down.d/radvd'] = {
|
||||
'source': 'ip-down',
|
||||
'mode': '0755',
|
||||
}
|
||||
|
||||
# Will be started and stopped by pppd.
|
||||
should_be_running = None
|
||||
should_be_enabled = False
|
||||
else:
|
||||
should_be_running = True
|
||||
should_be_enabled = True
|
||||
|
||||
files['/etc/radvd.conf'] = {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'interfaces': node.metadata['radvd']['interfaces'],
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:radvd:restart',
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'radvd': {
|
||||
'running': should_be_running,
|
||||
'enabled': should_be_enabled,
|
||||
'needs': {
|
||||
'file:/etc/radvd.conf',
|
||||
},
|
||||
},
|
||||
}
|
7
bundles/radvd/metadata.py
Normal file
7
bundles/radvd/metadata.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'radvd': {},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue