diff --git a/roles/strongswan/templates/mobileconfig.j2 b/roles/strongswan/templates/mobileconfig.j2 index e9d66701..3a6b6e32 100644 --- a/roles/strongswan/templates/mobileconfig.j2 +++ b/roles/strongswan/templates/mobileconfig.j2 @@ -7,13 +7,13 @@ IKEv2 -{% if algo_ondemand_wifi or algo_ondemand_cellular %} +{%- if algo_ondemand_wifi or algo_ondemand_cellular %} OnDemandEnabled 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 +21,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 %} + {%- else %} Disconnect -{% endif %} + {%- endif %} InterfaceTypeMatch WiFi URLStringProbe @@ -42,11 +41,11 @@ Action -{% if algo_ondemand_cellular %} + {%- if algo_ondemand_cellular %} Connect - {% else %} + {%- else %} Disconnect -{% endif %} + {%- endif %} InterfaceTypeMatch Cellular URLStringProbe @@ -57,8 +56,7 @@ Disconnect -{% else %} -{% endif %} +{%- endif %} AuthenticationMethod Certificate ChildSecurityAssociationParameters