2020-11-13 20:41:02 +00:00
|
|
|
directories = {
|
|
|
|
'/etc/ppp/ip-up.d': {
|
|
|
|
'purge': True,
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:ppp',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/ppp/ip-down.d': {
|
|
|
|
'purge': True,
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:ppp',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/ppp/ipv6-up.d': {
|
|
|
|
'purge': True,
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:ppp',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/ppp/ipv6-down.d': {
|
|
|
|
'purge': True,
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:ppp',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/ppp/peers': {
|
|
|
|
'purge': True,
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:ppp',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
files = {
|
2021-06-03 11:59:15 +00:00
|
|
|
'/etc/nftables-rules.d/90-pppd': {
|
2020-11-13 22:56:59 +00:00
|
|
|
'content_type': 'any',
|
|
|
|
},
|
2020-11-13 20:41:02 +00:00
|
|
|
'/etc/ppp/chap-secrets': {
|
|
|
|
'source': 'secrets',
|
|
|
|
'content_type': 'mako',
|
2021-08-14 05:55:01 +00:00
|
|
|
'context': node.metadata.get('pppd'),
|
2020-11-13 20:41:02 +00:00
|
|
|
'mode': '0400',
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:pppoe:restart',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/ppp/pap-secrets': {
|
|
|
|
'source': 'secrets',
|
|
|
|
'content_type': 'mako',
|
2021-08-14 05:55:01 +00:00
|
|
|
'context': node.metadata.get('pppd'),
|
2020-11-13 20:41:02 +00:00
|
|
|
'mode': '0400',
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:pppoe:restart',
|
|
|
|
},
|
|
|
|
},
|
2021-06-03 11:59:15 +00:00
|
|
|
'/etc/ppp/ip-down.d/nftables': {
|
2020-11-13 22:04:43 +00:00
|
|
|
'source': 'ip-down',
|
|
|
|
'mode': '0755',
|
|
|
|
},
|
2021-06-03 11:59:15 +00:00
|
|
|
'/etc/ppp/ip-up.d/nftables': {
|
2020-11-13 22:04:43 +00:00
|
|
|
'source': 'ip-up',
|
2021-12-14 15:18:11 +00:00
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
|
|
|
'nftables': node.metadata.get('pppd/nftables-rules.d', set()),
|
|
|
|
},
|
2020-11-13 22:04:43 +00:00
|
|
|
'mode': '0755',
|
|
|
|
},
|
2020-11-13 20:41:02 +00:00
|
|
|
'/etc/ppp/peers/provider': {
|
|
|
|
'content_type': 'mako',
|
2021-08-14 05:55:01 +00:00
|
|
|
'context': node.metadata.get('pppd'),
|
2020-11-13 20:41:02 +00:00
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:pppoe:restart',
|
|
|
|
},
|
|
|
|
},
|
2020-11-15 08:56:06 +00:00
|
|
|
'/etc/ppp/wait-until-stopped': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
2021-02-18 17:12:25 +00:00
|
|
|
'services': node.metadata.get('pppd/wait-until-stopped', set()),
|
2020-11-15 08:56:06 +00:00
|
|
|
},
|
|
|
|
'mode': '0700',
|
|
|
|
},
|
2021-06-04 05:27:49 +00:00
|
|
|
'/etc/sysctl.d/90-pppd.conf': {
|
|
|
|
'content_type': 'any',
|
|
|
|
},
|
2020-11-13 20:41:02 +00:00
|
|
|
'/etc/systemd/system/pppoe.service': {
|
|
|
|
'triggers': {
|
|
|
|
'action:systemd-reload',
|
|
|
|
'svc_systemd:pppoe:restart',
|
|
|
|
},
|
|
|
|
},
|
2020-12-10 15:14:17 +00:00
|
|
|
'/usr/local/bin/restart-pppoe-if-no-public-ip': {
|
|
|
|
'mode': '0755',
|
|
|
|
},
|
2020-11-13 20:41:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-19 05:21:04 +00:00
|
|
|
svc_systemd = {
|
|
|
|
'pppoe': {
|
|
|
|
'needs': {
|
|
|
|
'file:/etc/ppp/chap-secrets',
|
|
|
|
'file:/etc/ppp/pap-secrets',
|
|
|
|
'file:/etc/ppp/peers/provider',
|
|
|
|
'file:/etc/systemd/system/pppoe.service',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-08-14 05:55:01 +00:00
|
|
|
if node.metadata.get('pppd/dyndns', {}):
|
2020-11-14 11:46:19 +00:00
|
|
|
files['/etc/ppp/ip-up.d/dyndns'] = {
|
|
|
|
'content_type': 'mako',
|
2021-08-14 05:55:01 +00:00
|
|
|
'context': node.metadata.get('pppd/dyndns'),
|
|
|
|
'mode': '0755',
|
|
|
|
}
|
2021-12-19 05:21:04 +00:00
|
|
|
files['/usr/local/bin/dyndns_periodic'] = {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': node.metadata.get('pppd/dyndns'),
|
|
|
|
'mode': '0755',
|
|
|
|
}
|
|
|
|
files['/etc/systemd/system/dyndns_periodic.timer'] = {
|
|
|
|
'triggers': {
|
|
|
|
'action:systemd-reload',
|
|
|
|
'svc_systemd:dyndns_periodic.timer:restart',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
files['/etc/systemd/system/dyndns_periodic.service'] = {
|
|
|
|
'triggers': {
|
|
|
|
'action:systemd-reload',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
svc_systemd['dyndns_periodic.timer'] = {
|
2020-11-13 20:41:02 +00:00
|
|
|
'needs': {
|
2021-12-19 05:21:04 +00:00
|
|
|
'file:/etc/systemd/system/dyndns_periodic.timer',
|
|
|
|
'file:/etc/systemd/system/dyndns_periodic.service',
|
2020-11-13 20:41:02 +00:00
|
|
|
},
|
2021-12-19 05:21:04 +00:00
|
|
|
}
|
|
|
|
else:
|
|
|
|
files['/etc/systemd/system/dyndns_periodic.timer'] = {
|
|
|
|
'delete': True,
|
|
|
|
}
|
|
|
|
files['/etc/systemd/system/dyndns_periodic.service'] = {
|
|
|
|
'delete': True,
|
|
|
|
}
|
|
|
|
svc_systemd['dyndns_periodic.timer'] = {
|
|
|
|
'before': {
|
|
|
|
'file:/etc/systemd/system/dyndns_periodic.timer',
|
|
|
|
'file:/etc/systemd/system/dyndns_periodic.service',
|
|
|
|
},
|
|
|
|
}
|