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