49 lines
No EOL
1.5 KiB
Django/Jinja
49 lines
No EOL
1.5 KiB
Django/Jinja
# yaml-language-server: $schema=https://goauthentik.io/blueprints/schema.json
|
|
version: 1
|
|
metadata:
|
|
name: "local-users"
|
|
labels:
|
|
blueprints.goauthentik.io/instantiate: "true"
|
|
blueprints.goauthentik.io/description: "Local groups and user accounts"
|
|
|
|
entries:
|
|
{% for group in authentik_groups %}
|
|
- model: authentik_core.group
|
|
id: group-{{ group.name | regex_replace('[^a-zA-Z0-9]', '-') }}
|
|
identifiers:
|
|
name: {{ group.name }}
|
|
attrs:
|
|
name: {{ group.name }}
|
|
{% if group.is_superuser is defined %}
|
|
is_superuser: {{ group.is_superuser | lower }}
|
|
{% endif %}
|
|
{% if group.parent is defined and group.parent %}
|
|
parent: !Find [authentik_core.group, [name, {{ group.parent }}]]
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
{% for user in authentik_local_users %}
|
|
- model: authentik_core.user
|
|
id: user-{{ user.username }}
|
|
identifiers:
|
|
username: {{ user.username }}
|
|
attrs:
|
|
username: {{ user.username }}
|
|
name: "{{ user.name | default(user.username) }}"
|
|
email: "{{ user.email | default('') }}"
|
|
is_active: {{ user.is_active | default(true) | lower }}
|
|
{% if user.password is defined %}
|
|
password: "{{ user.password }}"
|
|
{% endif %}
|
|
{% if user.groups is defined and user.groups | length > 0 %}
|
|
groups:
|
|
{% for group in user.groups %}
|
|
- !Find [authentik_core.group, [name, {{ group }}]]
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if user.attributes is defined %}
|
|
attributes:
|
|
{{ user.attributes | to_nice_yaml(indent=2) | indent(8, first=true) }}
|
|
{% endif %}
|
|
|
|
{% endfor %} |