Add BooleanField for persistence and subnet visibility and dynimically create configuration with server and client addresses attempt 2
diff --git a/xos/observers/vpn/steps/sync_vpntenant.py b/xos/observers/vpn/steps/sync_vpntenant.py
index bd8e9f9..b579f12 100644
--- a/xos/observers/vpn/steps/sync_vpntenant.py
+++ b/xos/observers/vpn/steps/sync_vpntenant.py
@@ -31,7 +31,9 @@
def get_extra_attributes(self, o):
return {"server_key": o.server_key.splitlines(),
"is_persistent": o.is_persistent,
- "can_view_subnet": o.can_view_subnet}
+ "can_view_subnet": o.can_view_subnet,
+ "server_address": o.server_address,
+ "client_address": o.client_address}
def generate_client_conf(self, tenant):
# tenant.nat_ip maybe None when the first line executes
diff --git a/xos/observers/vpn/steps/sync_vpntenant.yaml b/xos/observers/vpn/steps/sync_vpntenant.yaml
index da18ebd..4d35c90 100644
--- a/xos/observers/vpn/steps/sync_vpntenant.yaml
+++ b/xos/observers/vpn/steps/sync_vpntenant.yaml
@@ -22,7 +22,7 @@
shell:
|
printf "dev tun
- ifconfig {{ server_address }} {{ client_address }}
+ ifconfig {{ '{{' }} server_address {{ '}}' }} {{ '{{' }} client_address {{ '}}' }}
secret static.key
keepalive 10 60
ping-timer-rem