20 lines
969 B
Django/Jinja
20 lines
969 B
Django/Jinja
{# Copyright (C) 2018 Maciej Delmanowski <drybjed@gmail.com>
|
|
# Copyright (C) 2018 DebOps <https://debops.org/>
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
#}
|
|
# {{ ansible_managed }}
|
|
|
|
# See sudoers.ldap(5) for details.
|
|
# This file shouldn't be world readable.
|
|
|
|
{% for option in sudo__ldap_combined_configuration | debops.debops.parse_kv_config %}
|
|
{% if option.state | d('present') not in [ 'absent', 'ignore' ] %}
|
|
{% if ((option.separator | d()) | bool or option.comment | d()) and not loop.first %}
|
|
|
|
{% endif %}
|
|
{% if option.comment | d() %}
|
|
{{ option.comment | regex_replace('\n$','') | comment(prefix='', postfix='') -}}
|
|
{% endif %}
|
|
{{ '{}{}\t{}{}'.format(('#' if (option.state | d('present') == 'comment') else ''), option.name | upper, ('\t' if (option.name | count < 8) else ''), (option.value if option.value is string else (option.value | selectattr("name", "defined") | map(attribute="name") | list | join(' ')))) }}
|
|
{% endif %}
|
|
{% endfor %}
|