Pārlūkot izejas kodu

state: allow for removal of persistent keepalive

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

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

@@ -89,10 +89,13 @@ def peer_present(name, interface, endpoint=None, persistent_keepalive=None,
__salt__['wg.set'](interface, peer=name, endpoint=endpoint)
ret['changes']['endpoint'] = 'Endpoint changed.'

if show.get('persistent keepalive', None) != persistent_keepalive:
if persistent_keepalive and show.get('persistent keepalive', None).startswith('every %s second' % (persistent_keepalive,)):
__salt__['wg.set'](interface, peer=name,
persistent_keepalive=persistent_keepalive)
ret['changes']['persistent keepalive'] = 'persistent keepalive changed.'
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.'

ret['result'] = True


Notiek ielāde…
Atcelt
Saglabāt