diff --git a/ansible/playbooks/roles/proxmox/tasks/oidc.yml b/ansible/playbooks/roles/proxmox/tasks/oidc.yml index 8ab274b..cd8bcd4 100644 --- a/ansible/playbooks/roles/proxmox/tasks/oidc.yml +++ b/ansible/playbooks/roles/proxmox/tasks/oidc.yml @@ -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