bundles/pppd: introduce
This commit is contained in:
parent
b1860b7e01
commit
3b829caaf6
5 changed files with 117 additions and 0 deletions
12
bundles/pppd/files/pppoe.service
Normal file
12
bundles/pppd/files/pppoe.service
Normal 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
|
18
bundles/pppd/files/provider
Normal file
18
bundles/pppd/files/provider
Normal 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
|
2
bundles/pppd/files/secrets
Normal file
2
bundles/pppd/files/secrets
Normal file
|
@ -0,0 +1,2 @@
|
|||
# client server secret IP addresses
|
||||
${username} * ${password} *
|
77
bundles/pppd/items.py
Normal file
77
bundles/pppd/items.py
Normal 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
8
bundles/pppd/metadata.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'ppp': {},
|
||||
'pppoe': {},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue