Преглед на файлове

manage addition and removal of allowed ips

tags/v0.9
Maximilian Eschenbacher преди 6 години
родител
ревизия
f8fa2b4cd3
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. +4
    -0
      _states/wireguard.py

+ 4
- 0
_states/wireguard.py Целия файл

@@ -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…
Отказ
Запис