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