This commit is contained in:
2026-03-10 20:30:07 -05:00
parent 86cf979453
commit fa9fd9c65f

View File

@@ -17,33 +17,31 @@
{{ proxmox_realms.stdout | from_json | selectattr('realm', 'equalto', proxmox_oidc_realm_name) | list | length > 0 }}
- name: Add OIDC realm for Authentik
ansible.builtin.command:
cmd: >-
pveum realm add {{ proxmox_oidc_realm_name }}
--type openid
--issuer-url {{ proxmox_oidc_issuer_url }}
--client-id {{ proxmox_oidc_client_id }}
--client-key {{ proxmox_oidc_client_key }}
--username-claim {{ proxmox_oidc_username_claim }}
--scopes {{ proxmox_oidc_scopes }}
--autocreate {{ proxmox_oidc_autocreate | ternary('1', '0') }}
--comment "{{ proxmox_oidc_comment }}"
{% if proxmox_oidc_default_realm %}--default 1{% endif %}
ansible.builtin.shell: >-
pveum realm add {{ proxmox_oidc_realm_name }}
--type openid
--issuer-url '{{ proxmox_oidc_issuer_url }}'
--client-id '{{ proxmox_oidc_client_id }}'
--client-key '{{ proxmox_oidc_client_key }}'
--username-claim '{{ proxmox_oidc_username_claim }}'
--scopes '{{ proxmox_oidc_scopes }}'
--autocreate {{ proxmox_oidc_autocreate | ternary('1', '0') }}
--comment '{{ proxmox_oidc_comment }}'
{% if proxmox_oidc_default_realm %}--default 1{% endif %}
when: not proxmox_realm_exists
no_log: false # true
- name: Update OIDC realm for Authentik
ansible.builtin.command:
cmd: >-
pveum realm modify {{ proxmox_oidc_realm_name }}
--issuer-url {{ proxmox_oidc_issuer_url }}
--client-id {{ proxmox_oidc_client_id }}
--client-key {{ proxmox_oidc_client_key }}
--username-claim {{ proxmox_oidc_username_claim }}
--scopes {{ proxmox_oidc_scopes }}
--autocreate {{ proxmox_oidc_autocreate | ternary('1', '0') }}
--comment "{{ proxmox_oidc_comment }}"
{% if proxmox_oidc_default_realm %}--default 1{% endif %}
ansible.builtin.shell: >-
pveum realm modify {{ proxmox_oidc_realm_name }}
--issuer-url '{{ proxmox_oidc_issuer_url }}'
--client-id '{{ proxmox_oidc_client_id }}'
--client-key '{{ proxmox_oidc_client_key }}'
--username-claim '{{ proxmox_oidc_username_claim }}'
--scopes '{{ proxmox_oidc_scopes }}'
--autocreate {{ proxmox_oidc_autocreate | ternary('1', '0') }}
--comment '{{ proxmox_oidc_comment }}'
{% if proxmox_oidc_default_realm %}--default 1{% endif %}
when: proxmox_realm_exists
no_log: false # true