Quellcode durchsuchen

manage addition and removal of allowed ips

tags/v0.9
Maximilian Eschenbacher vor 6 Jahren
Ursprung
Commit
f8fa2b4cd3
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. +4
    -0
      _states/wireguard.py

+ 4
- 0
_states/wireguard.py Datei anzeigen

@@ -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


Laden…
Abbrechen
Speichern