feat: allow deletion of ressources via blueprints

This commit is contained in:
Bert-Jan Fikse 2026-01-14 16:03:20 +01:00
parent f8b9975ae4
commit 3d3a09025a
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
4 changed files with 70 additions and 2 deletions

View file

@ -0,0 +1,38 @@
# yaml-language-server: $schema=https://goauthentik.io/blueprints/schema.json
version: 1
metadata:
name: "cleanup"
labels:
blueprints.goauthentik.io/instantiate: "true"
blueprints.goauthentik.io/description: "Remove stale resources"
entries:
{% for slug in authentik_removed_oidc_apps %}
# Remove OIDC app: {{ slug }}
- model: authentik_core.application
state: absent
identifiers:
slug: {{ slug }}
- model: authentik_providers_oauth2.oauth2provider
state: absent
identifiers:
name: {{ slug }}
{% endfor %}
{% for slug in authentik_removed_proxy_apps %}
# Remove proxy app: {{ slug }}
- model: authentik_core.application
state: absent
identifiers:
slug: {{ slug }}
- model: authentik_providers_proxy.proxyprovider
state: absent
identifiers:
name: {{ slug }}
{% endfor %}
{% for username in authentik_removed_local_users %}
# Remove user: {{ username }}
- model: authentik_core.user
state: absent
identifiers:
username: {{ username }}
{% endfor %}