diff --git a/roles/custom/matrix-tuwunel/defaults/main.yml b/roles/custom/matrix-tuwunel/defaults/main.yml index 1a0d8333b..7bc6e1d5b 100644 --- a/roles/custom/matrix-tuwunel/defaults/main.yml +++ b/roles/custom/matrix-tuwunel/defaults/main.yml @@ -331,7 +331,6 @@ matrix_tuwunel_config_ldap_bind_dn: '' matrix_tuwunel_config_ldap_bind_password_file: '' matrix_tuwunel_config_ldap_filter: '(objectClass=*)' matrix_tuwunel_config_ldap_uid_attribute: 'uid' -matrix_tuwunel_config_ldap_name_attribute: 'givenName' matrix_tuwunel_config_ldap_admin_base_dn: '' matrix_tuwunel_config_ldap_admin_filter: '' diff --git a/roles/custom/matrix-tuwunel/tasks/validate_config.yml b/roles/custom/matrix-tuwunel/tasks/validate_config.yml index a693e43bf..7a1c52cad 100644 --- a/roles/custom/matrix-tuwunel/tasks/validate_config.yml +++ b/roles/custom/matrix-tuwunel/tasks/validate_config.yml @@ -5,6 +5,15 @@ --- +- name: (Deprecation) Catch and report renamed tuwunel variables + ansible.builtin.fail: + msg: >- + Your configuration contains a variable, which now has a different name. + Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" + with_items: + - {'old': 'matrix_tuwunel_config_ldap_name_attribute', 'new': ' (tuwunel v1.9.0 dropped the option; the localpart must appear in the attribute named by `matrix_tuwunel_config_ldap_uid_attribute`)'} + - name: Fail if required tuwunel settings not defined ansible.builtin.fail: msg: >- diff --git a/roles/custom/matrix-tuwunel/templates/tuwunel.toml.j2 b/roles/custom/matrix-tuwunel/templates/tuwunel.toml.j2 index 32b5cb9d1..b11a7ce6e 100644 --- a/roles/custom/matrix-tuwunel/templates/tuwunel.toml.j2 +++ b/roles/custom/matrix-tuwunel/templates/tuwunel.toml.j2 @@ -194,7 +194,6 @@ bind_password_file = {{ matrix_tuwunel_config_ldap_bind_password_file | to_json {% endif %} filter = {{ matrix_tuwunel_config_ldap_filter | to_json }} uid_attribute = {{ matrix_tuwunel_config_ldap_uid_attribute | to_json }} -name_attribute = {{ matrix_tuwunel_config_ldap_name_attribute | to_json }} {% if matrix_tuwunel_config_ldap_admin_base_dn | length > 0 %} admin_base_dn = {{ matrix_tuwunel_config_ldap_admin_base_dn | to_json }} {% endif %}