Add persistence to client config
diff --git a/xos/observers/vpn/steps/sync_vpntenant.py b/xos/observers/vpn/steps/sync_vpntenant.py
index d6bc664..c7c3c9d 100644
--- a/xos/observers/vpn/steps/sync_vpntenant.py
+++ b/xos/observers/vpn/steps/sync_vpntenant.py
@@ -41,14 +41,16 @@
Args:
tenant (VPNTenant): The tenant to generate the client configuration for.
-
+
"""
conf = "remote " + str(tenant.nat_ip) + "\n"
conf += "dev tun\n"
conf += "ifconfig " + tenant.client_address + " " + tenant.server_address + "\n"
- conf += "secret static.key\n"
- conf += "keepalive 10 60\n"
- conf += "ping-timer-rem\n"
- conf += "persist-tun\n"
- conf += "persist-key"
+ conf += "secret static.key"
+ if tenant.is_persistent:
+ conf += "\nkeepalive 10 60\n"
+ conf += "ping-timer-rem\n"
+ conf += "persist-tun\n"
+ conf += "persist-key"
+
return conf
diff --git a/xos/observers/vpn/steps/sync_vpntenant.yaml b/xos/observers/vpn/steps/sync_vpntenant.yaml
index 8ff6460..8dd1d12 100644
--- a/xos/observers/vpn/steps/sync_vpntenant.yaml
+++ b/xos/observers/vpn/steps/sync_vpntenant.yaml
@@ -37,7 +37,7 @@
- name: write persistent config
shell:
|
- printf "keepalive 10 60
+ printf "\nkeepalive 10 60
ping-timer-rem
persist-tun
persist-key" >> server.conf