diff --git a/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 b/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 index b380481..fde574b 100644 --- a/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 +++ b/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 @@ -17,14 +17,10 @@ country=NL community.general.passwordstore doesn't support path with spaces in it, so we're using a `ssid` attribute, which default to the names for SSIDs without space. #} +{% set pass = lookup('community.general.passwordstore', 'wifi/' + name) %} {% set suffixes = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=suffixes') or [''] %} {% set ssid = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=ssid') or name %} -{% set type = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=type') or 'wpa' %} -{% if type in ('wpa', 'wep', 'wpa-eap') %} -{% set pass = lookup('community.general.passwordstore', 'wifi/' + name) %} -{% else %} -{% set pass = 'Error, no pass for type ' + type %} -{% endif %} +{% set type = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=type') or ('wpa' if pass else 'open') %} # {{ name }} {% for suffix in suffixes %} network={