bundles/wide-dhcp6c: introduce, add to home.router
This commit is contained in:
parent
6b4eae842b
commit
fa224a9939
7 changed files with 132 additions and 0 deletions
58
bundles/wide-dhcp6c/items.py
Normal file
58
bundles/wide-dhcp6c/items.py
Normal file
|
@ -0,0 +1,58 @@
|
|||
if node.metadata.get('wide-dhcp6c', {}).get('integrate-with-pppd', False):
|
||||
files['/etc/ppp/ip-up.d/wide-dhcp6c'] = {
|
||||
'source': 'ip-up',
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'source': node.metadata['wide-dhcp6c']['source'],
|
||||
},
|
||||
'mode': '0755',
|
||||
}
|
||||
files['/etc/ppp/ip-down.d/wide-dhcp6c'] = {
|
||||
'source': 'ip-down',
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'targets': node.metadata['wide-dhcp6c']['targets'],
|
||||
},
|
||||
'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/wide-dhcpv6/dhcp6c.conf'] = {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'source': node.metadata['wide-dhcp6c']['source'],
|
||||
'targets': node.metadata['wide-dhcp6c']['targets'],
|
||||
'subnet_len': node.metadata['wide-dhcp6c']['subnet_len'],
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:wide-dhcpv6-client:restart',
|
||||
},
|
||||
}
|
||||
|
||||
files['/etc/systemd/system/wide-dhcpv6-client.service'] = {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'source': node.metadata['wide-dhcp6c']['source'],
|
||||
},
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
'svc_systemd:wide-dhcpv6-client:restart',
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'wide-dhcpv6-client': {
|
||||
'running': should_be_running,
|
||||
'enabled': should_be_enabled,
|
||||
'needs': {
|
||||
'file:/etc/systemd/system/wide-dhcpv6-client.service',
|
||||
'file:/etc/wide-dhcpv6/dhcp6c.conf',
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue