dataset/seed/openldap/templates/openldap.yml

51 lines
2.2 KiB
YAML
Raw Permalink Normal View History

2023-06-23 08:12:05 +02:00
{% set username = "rougail_test@silique.fr" %}
{% set username_family = "rougail_test@gnunux.info" %}
{% set name_family = 'gnunux' %}
2023-07-31 15:30:32 +02:00
{% set familydn = ldap_base_dn|calc_ldapclient_base_dn(family_name=name_family) %}
{% set userdn = 'cn=' + username + ',' + ldap_base_dn|calc_ldapclient_base_dn %}
2023-06-23 08:12:05 +02:00
{% set userfamilydn = 'cn=' + username_family + ',' + familydn %}
2023-07-31 15:30:32 +02:00
address: {{ general.network.interface_0.ip_eth0 }}
admin_dn: {{ ldap_user }}
admin_password: {{ general.ldap.ldap_user_password }}
2023-06-23 08:12:05 +02:00
user_dn: {{ userdn }}
user_password: {{ username|get_password(server_name='test', description='test', type="cleartext", hide=hide_secret, temporary=True) }}
user_family_dn: {{ userfamilydn }}
2023-07-31 15:30:32 +02:00
user_family_password: {{ username_family|get_password(server_name='test', description="test", type="cleartext", hide=hide_secret, temporary=True) }}
2023-06-23 08:12:05 +02:00
base_account_dn: {{ ldap_account_dn }}
2023-07-31 15:30:32 +02:00
base_user_dn: {{ ldap_user_dn }}
2023-06-23 08:12:05 +02:00
base_family_dn: {{ familydn }}
2023-07-31 15:30:32 +02:00
base_group_dn: {{ ldap_group_dn }}
2023-06-23 08:12:05 +02:00
{% for idx in range(3) %}
{% set name = 'remote_test' + idx|string %}
2023-07-31 15:30:32 +02:00
remote{{ idx }}: cn={{ name }},{{ ldap_base_dn }}
2023-06-23 08:12:05 +02:00
remote_password{{ idx }}: {{ name|get_password(server_name=domain_name_eth0, description="remote account", type="cleartext", hide=hide_secret, temporary=True) }}
{% endfor %}
2022-07-07 09:37:49 +02:00
users:
2023-06-23 08:12:05 +02:00
{{ username }}: {{ userdn }}
{{ username_family }}: {{ userfamilydn }}
{% for user in accounts.users.ldap_user_mail %}
2023-07-31 15:30:32 +02:00
{{ user }}: cn={{ user }},{{ ldap_user_dn }}
2023-06-23 08:12:05 +02:00
{% endfor %}
{% for family in accounts.families %}
2023-07-31 15:30:32 +02:00
{% set families = ldap_base_dn|calc_ldapclient_base_dn(family) %}
2023-06-23 08:12:05 +02:00
{% for user in accounts['family_' + family]['users_' + family]['ldap_user_mail_' + family] %}
{{ user }}: cn={{ user }},{{ families }}
{% endfor %}
{% endfor %}
2022-07-07 09:37:49 +02:00
groups:
users:
2023-06-23 08:12:05 +02:00
- {{ userdn }}
{% for user in accounts.users.ldap_user_mail %}
2023-07-31 15:30:32 +02:00
- cn={{ user }},{{ ldap_user_dn }}
2023-06-23 08:12:05 +02:00
{% endfor %}
2023-07-31 15:30:32 +02:00
{% for family in accounts.families %}
{% set families = ldap_base_dn|calc_ldapclient_base_dn(family) %}
2023-06-23 08:12:05 +02:00
{{ family }}:
2023-07-31 15:30:32 +02:00
{% if family == name_family %}
- {{ userfamilydn }}
2023-06-23 08:12:05 +02:00
{% endif %}
2023-07-31 15:30:32 +02:00
{%- for user in accounts['family_' + family]['users_' + family]['ldap_user_mail_' + family] %}
- cn={{ user }},{{ families }}
{% endfor %}
{% endfor %}