bundles/pppd: introduce

This commit is contained in:
Franzi 2020-11-13 21:41:02 +01:00
parent b1860b7e01
commit 3b829caaf6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,12 @@
[Unit]
Description=PPPoE connection
After=network-online.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/pon
ExecStop=/usr/bin/poff -a
[Install]
WantedBy=default.target

View file

@ -0,0 +1,18 @@
user ${username}
pty "/usr/sbin/pppoe -I ${interface} -T 80 -m 1452"
noipdefault
# We're not setting 'usepeerdns' on purpose. We're running our own
# resolver instead.
defaultroute
hide-password
lcp-echo-interval 20
lcp-echo-failure 3
connect /bin/true
noauth
persist
mtu 1492
noaccomp
default-asyncmap

View file

@ -0,0 +1,2 @@
# client server secret IP addresses
${username} * ${password} *

77
bundles/pppd/items.py Normal file
View file

@ -0,0 +1,77 @@
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 = {
'/etc/ppp/chap-secrets': {
'source': 'secrets',
'content_type': 'mako',
'context': node.metadata['pppd'],
'mode': '0400',
'triggers': {
'svc_systemd:pppoe:restart',
},
},
'/etc/ppp/pap-secrets': {
'source': 'secrets',
'content_type': 'mako',
'context': node.metadata['pppd'],
'mode': '0400',
'triggers': {
'svc_systemd:pppoe:restart',
},
},
'/etc/ppp/peers/provider': {
'content_type': 'mako',
'context': node.metadata['pppd'],
'triggers': {
'svc_systemd:pppoe:restart',
},
},
'/etc/systemd/system/pppoe.service': {
'triggers': {
'action:systemd-reload',
'svc_systemd:pppoe:restart',
},
},
}
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',
},
},
}

8
bundles/pppd/metadata.py Normal file
View file

@ -0,0 +1,8 @@
defaults = {
'apt': {
'packages': {
'ppp': {},
'pppoe': {},
},
},
}