diff --git a/templates/lldap-config.toml.j2 b/templates/lldap-config.toml.j2 index 5497c82..a219453 100644 --- a/templates/lldap-config.toml.j2 +++ b/templates/lldap-config.toml.j2 @@ -1,13 +1,23 @@ {{ ansible_managed | comment }} -{% for key, value in lldap_config %} -{% if value is string %} -{{ key }}={{ value }} +{% for key in lldap_config %} +{% if lldap_config[key] is string %} +{{ key }} = "{{ lldap_config[key] }}" +{% elif lldap_config[key] is number %} +{{ key }} = {{ lldap_config[key] }} +{% elif lldap_config[key] is bool %} +{{ key }} = {{ lldap_config[key] | ternary('true', 'false')}} {% else %} [{{ key }}] -{% for entry, entry_value in value %} -{{ entry }} = {{ entry_value }} +{% for entry in lldap_config[key] %} +{{ entry }} = "{{ lldap_config[key][entry] }}" +{% if ldap_config[key][entry] is string %} +{{ entry }} = "{{ ldap_config[key][entry] }}" +{% elif ldap_config[key][entry] is number %} +{{ entry }} = {{ lldap_config[key][entry] }} +{% elif ldap_config[key][entry] is bool %} +{{ entry }} = {{ ldap_config[key][entry] | ternary('true', 'false')}} {% endfor %} {% endif %}