diff --git a/roles/strongswan/templates/mobileconfig.j2 b/roles/strongswan/templates/mobileconfig.j2 index e9d6670..6cf0ea1 100644 --- a/roles/strongswan/templates/mobileconfig.j2 +++ b/roles/strongswan/templates/mobileconfig.j2 @@ -1,3 +1,4 @@ +#jinja2:lstrip_blocks: True @@ -12,8 +13,8 @@ 1 OnDemandRules -{% if algo_ondemand_wifi_exclude|b64decode != '_null' %} -{% set WIFI_EXCLUDE_LIST = (algo_ondemand_wifi_exclude|b64decode|string).split(',') %} + {% if algo_ondemand_wifi_exclude|b64decode != '_null' %} + {% set WIFI_EXCLUDE_LIST = (algo_ondemand_wifi_exclude|b64decode|string).split(',') %} Action Disconnect @@ -21,20 +22,19 @@ WiFi SSIDMatch -{% for network_name in WIFI_EXCLUDE_LIST %} + {% for network_name in WIFI_EXCLUDE_LIST %} {{ network_name|e }} -{% endfor %} + {% endfor %} -{% else %} -{% endif %} + {% endif %} Action -{% if algo_ondemand_wifi %} + {% if algo_ondemand_wifi %} Connect {% else %} Disconnect -{% endif %} + {% endif %} InterfaceTypeMatch WiFi URLStringProbe @@ -42,11 +42,11 @@ Action -{% if algo_ondemand_cellular %} + {% if algo_ondemand_cellular %} Connect {% else %} Disconnect -{% endif %} + {% endif %} InterfaceTypeMatch Cellular URLStringProbe @@ -57,7 +57,6 @@ Disconnect -{% else %} {% endif %} AuthenticationMethod Certificate