From c70dd01bb2c0492e5e6d9ebbc9980dd7c81abbbc Mon Sep 17 00:00:00 2001 From: Fabian Foerg <3429782+faf0@users.noreply.github.com> Date: Wed, 12 Dec 2018 22:07:29 -0800 Subject: [PATCH] Simplify Apple Profile Configuration Template --- roles/strongswan/templates/mobileconfig.j2 | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) 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