19
19
from vyos .config import Config
20
20
from vyos .configdict import get_interface_dict
21
21
from vyos .configdict import is_node_changed
22
+ from vyos .configdict import is_source_interface
23
+ from vyos .configdep import set_dependents
24
+ from vyos .configdep import call_dependents
22
25
from vyos .configverify import verify_vrf
23
26
from vyos .configverify import verify_address
24
27
from vyos .configverify import verify_bridge_delete
35
38
from pathlib import Path
36
39
airbag .enable ()
37
40
41
+
38
42
def get_config (config = None ):
39
43
"""
40
44
Retrive CLI config as dictionary. Dictionary can never be empty, as at least the
@@ -61,8 +65,15 @@ def get_config(config=None):
61
65
if 'disable' not in peer_config and 'host_name' in peer_config :
62
66
wireguard ['peers_need_resolve' ].append (peer )
63
67
68
+ # Check if interface is used as source-interface on VXLAN interface
69
+ if 'deleted' not in wireguard :
70
+ tmp = is_source_interface (conf , ifname , 'vxlan' )
71
+ if tmp :
72
+ set_dependents ('vxlan' , conf , tmp )
73
+
64
74
return wireguard
65
75
76
+
66
77
def verify (wireguard ):
67
78
if 'deleted' in wireguard :
68
79
verify_bridge_delete (wireguard )
@@ -119,9 +130,11 @@ def verify(wireguard):
119
130
120
131
public_keys .append (peer ['public_key' ])
121
132
133
+
122
134
def generate (wireguard ):
123
135
return None
124
136
137
+
125
138
def apply (wireguard ):
126
139
check_kmod ('wireguard' )
127
140
@@ -157,8 +170,11 @@ def apply(wireguard):
157
170
domain_action = 'stop'
158
171
call (f'systemctl { domain_action } vyos-domain-resolver.service' )
159
172
173
+ call_dependents ()
174
+
160
175
return None
161
176
177
+
162
178
if __name__ == '__main__' :
163
179
try :
164
180
c = get_config ()
0 commit comments