Sfoglia il codice sorgente

states: peer_present: display only if endpoint really changed

tags/v1.0
Maximilian Eschenbacher 6 anni fa
parent
commit
441bac008d
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. +4
    -2
      _states/wireguard.py

+ 4
- 2
_states/wireguard.py Vedi File



if endpoint and show.get('endpoint', '') != endpoint: if endpoint and show.get('endpoint', '') != endpoint:
__salt__['wg.set'](interface, peer=name, endpoint=endpoint) __salt__['wg.set'](interface, peer=name, endpoint=endpoint)
ret['changes']['endpoint'] = dict(
old=show.get('endpoint'), new=endpoint)
updated_show = __salt__['wg.show'](name=interface, peer=name)
if updated_show.get('endpoint') != show.get('endpoint'):
ret['changes']['endpoint'] = dict(
old=show.get('endpoint'), new=updated_show.get('endpoint'))


if persistent_keepalive and not show.get('persistent keepalive', '').startswith('every %s second' % (persistent_keepalive,)): if persistent_keepalive and not show.get('persistent keepalive', '').startswith('every %s second' % (persistent_keepalive,)):
__salt__['wg.set'](interface, peer=name, __salt__['wg.set'](interface, peer=name,

Loading…
Annulla
Salva