Sfoglia il codice sorgente

manage addition and removal of allowed ips

tags/v0.9
Maximilian Eschenbacher 6 anni fa
parent
commit
f8fa2b4cd3
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. +4
    -0
      _states/wireguard.py

+ 4
- 0
_states/wireguard.py Vedi File

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


Loading…
Annulla
Salva