2020-11-21 14:38:38 +00:00
|
|
|
assert node.has_bundle('systemd-networkd')
|
|
|
|
|
|
|
|
files = {
|
|
|
|
'/etc/systemd/network/99-wg0.netdev': {
|
|
|
|
'source': 'wg0.netdev',
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': node.metadata['wireguard'],
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:wireguard',
|
|
|
|
},
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:systemd-networkd:restart',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/systemd/network/99-wg0.network': {
|
|
|
|
'source': 'wg0.network',
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': node.metadata['wireguard'],
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:wireguard',
|
|
|
|
},
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:systemd-networkd:restart',
|
|
|
|
},
|
|
|
|
},
|
2020-11-21 15:15:34 +00:00
|
|
|
'/usr/local/share/icinga/plugins/check_wireguard_connected': {
|
|
|
|
'mode': '0755',
|
|
|
|
},
|
2020-11-21 14:38:38 +00:00
|
|
|
}
|
2020-11-27 02:09:37 +00:00
|
|
|
|
|
|
|
if node.has_bundle('pppd'):
|
|
|
|
files['/etc/ppp/ip-up.d/reconnect-wireguard'] = {
|
|
|
|
'source': 'pppd-ip-up',
|
|
|
|
'content_type': 'mako',
|
|
|
|
'mode': '0755',
|
|
|
|
}
|