feat: add ability to provision local users using blueprints

This commit is contained in:
Bert-Jan Fikse 2026-01-14 15:43:03 +01:00
parent 359622d17a
commit 599bb3e282
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
2 changed files with 22 additions and 0 deletions

View file

@ -98,3 +98,16 @@ authentik_entra_sources: []
authentik_login_source_ids: [] authentik_login_source_ids: []
# - "source-entra-entra-id" # - "source-entra-entra-id"
authentik_identification_stage_name: default-authentication-identification authentik_identification_stage_name: default-authentication-identification
# Local users to provision
authentik_local_users: []
# - username: admin
# name: "Admin User"
# email: "admin@example.com"
# password_env: AUTHENTIK_ADMIN_PASSWORD # reference env var in authentik_blueprint_env
# is_active: true
# groups:
# - authentik Admins
# attributes:
# settings:
# locale: en

View file

@ -77,6 +77,14 @@
mode: "0644" mode: "0644"
register: login_bp register: login_bp
- name: Render local users blueprint
ansible.builtin.template:
src: blueprints/blueprint-local-users.yaml.j2
dest: "{{ authentik_docker_volume_dir }}/blueprints/05-local-users.yaml"
mode: "0644"
when: authentik_local_users | length > 0
register: local_users_bp
- name: Create docker-compose file for authentik - name: Create docker-compose file for authentik
template: template:
src: docker-compose.yml.j2 src: docker-compose.yml.j2
@ -95,5 +103,6 @@
or (outpost_bp is defined and (outpost_bp.results | selectattr('changed') | list | length > 0)) or (outpost_bp is defined and (outpost_bp.results | selectattr('changed') | list | length > 0))
or (entra_bp is defined and (entra_bp.results | selectattr('changed') | list | length > 0)) or (entra_bp is defined and (entra_bp.results | selectattr('changed') | list | length > 0))
or (login_bp is defined and login_bp.changed) or (login_bp is defined and login_bp.changed)
or (local_users_bp.changed | default(false))
) | ternary('always','auto') ) | ternary('always','auto')
}} }}