Pārlūkot izejas kodu

manage addition and removal of allowed ips

tags/v0.9
Maximilian Eschenbacher pirms 6 gadiem
vecāks
revīzija
f8fa2b4cd3
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. +4
    -0
      _states/wireguard.py

+ 4
- 0
_states/wireguard.py Parādīt failu

@@ -96,6 +96,10 @@ def peer_present(name, interface, endpoint=None, persistent_keepalive=None,
elif not persistent_keepalive and show.get('persistent keepalive'):
__salt__['wg.set'](interface, peer=name, persistent_keepalive=0)
ret['changes']['persistent keepalive'] = 'persistent keepalive removed.'
if sorted(show.get('allowed ips')) != sorted(allowed_ips):
__salt__['wg.set'](interface, peer=name, allowed_ips=','.join(allowed_ips))
ret['changes']['allowed ips'] = dict(new=allowed_ips, old=show.get('allowed ips'))


ret['result'] = True


Notiek ielāde…
Atcelt
Saglabāt