bundles/wide-dhcp-client: fix some bugs
This commit is contained in:
parent
a61a3816ed
commit
c59a3038a1
3 changed files with 13 additions and 19 deletions
|
@ -3,8 +3,5 @@
|
||||||
systemctl stop wide-dhcpv6-client
|
systemctl stop wide-dhcpv6-client
|
||||||
|
|
||||||
% for interface, subnet_id in sorted(targets.items()):
|
% for interface, subnet_id in sorted(targets.items()):
|
||||||
for IP in $(ip -6 addr show dev ${interface} | grep inet6 | awk '{print $2}' | grep -vF 'fe80::')
|
ip -6 addr flush dev ${interface} scope global
|
||||||
do
|
|
||||||
ip -6 addr del $IP dev ${interface}
|
|
||||||
done
|
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -12,7 +12,7 @@ if systemctl is-active wide-dhcpv6-client;
|
||||||
then
|
then
|
||||||
systemctl stop wide-dhcpv6-client
|
systemctl stop wide-dhcpv6-client
|
||||||
sleep 1
|
sleep 1
|
||||||
systemctl sart wide-dhcpv6-client
|
systemctl start wide-dhcpv6-client
|
||||||
else
|
else
|
||||||
systemctl start wide-dhcpv6-client
|
systemctl start wide-dhcpv6-client
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,18 +2,21 @@ if node.has_bundle('pppd'):
|
||||||
files['/etc/ppp/ip-up.d/wide-dhcp6c'] = {
|
files['/etc/ppp/ip-up.d/wide-dhcp6c'] = {
|
||||||
'source': 'ip-up',
|
'source': 'ip-up',
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': node.metadata.get('wide-dhcp6c'),
|
||||||
'source': node.metadata['wide-dhcp6c']['source'],
|
|
||||||
},
|
|
||||||
'mode': '0755',
|
'mode': '0755',
|
||||||
|
'triggers': {
|
||||||
|
'svc_systemd:wide-dhcpv6-client:restart',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
files['/etc/ppp/ip-down.d/wide-dhcp6c'] = {
|
files['/etc/ppp/ip-down.d/wide-dhcp6c'] = {
|
||||||
'source': 'ip-down',
|
'source': 'ip-down',
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': node.metadata.get('wide-dhcp6c'),
|
||||||
'targets': node.metadata['wide-dhcp6c']['targets'],
|
|
||||||
},
|
|
||||||
'mode': '0755',
|
'mode': '0755',
|
||||||
|
'triggers': {
|
||||||
|
'svc_systemd:wide-dhcpv6-client:restart',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Will be started and stopped by pppd.
|
# Will be started and stopped by pppd.
|
||||||
|
@ -25,11 +28,7 @@ else:
|
||||||
|
|
||||||
files['/etc/wide-dhcpv6/dhcp6c.conf'] = {
|
files['/etc/wide-dhcpv6/dhcp6c.conf'] = {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': node.metadata.get('wide-dhcp6c'),
|
||||||
'source': node.metadata['wide-dhcp6c']['source'],
|
|
||||||
'targets': node.metadata['wide-dhcp6c']['targets'],
|
|
||||||
'subnet_len': node.metadata['wide-dhcp6c']['subnet_len'],
|
|
||||||
},
|
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'svc_systemd:wide-dhcpv6-client:restart',
|
'svc_systemd:wide-dhcpv6-client:restart',
|
||||||
},
|
},
|
||||||
|
@ -37,9 +36,7 @@ files['/etc/wide-dhcpv6/dhcp6c.conf'] = {
|
||||||
|
|
||||||
files['/etc/systemd/system/wide-dhcpv6-client.service'] = {
|
files['/etc/systemd/system/wide-dhcpv6-client.service'] = {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': node.metadata.get('wide-dhcp6c'),
|
||||||
'source': node.metadata['wide-dhcp6c']['source'],
|
|
||||||
},
|
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'action:systemd-reload',
|
'action:systemd-reload',
|
||||||
'svc_systemd:wide-dhcpv6-client:restart',
|
'svc_systemd:wide-dhcpv6-client:restart',
|
||||||
|
|
Loading…
Reference in a new issue