Add tasks to create only 1 client #11
18
tasks/hydra-create-client.yml
Normal file
18
tasks/hydra-create-client.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
# Simple task to create 1 client for hydra. Fails if the client already exists.
|
||||
# Parameter: client_id
|
||||
|
||||
- fail: msg='Error, client does not exist. Please define the client first'
|
||||
when: hydra_clients|selectattr("client_id", "equalto", client_id)|list|length == 0
|
||||
|
||||
- name: Create hydra-client
|
||||
template:
|
||||
src: hydra-client.json.j2
|
||||
pcaseiro marked this conversation as resolved
Outdated
|
||||
dest: "/etc/hydra/clients.d/{{ item.client_id }}.json"
|
||||
with_items: "{{ hydra_clients }}"
|
||||
when: item.client_id == client_id
|
||||
become: true
|
||||
|
||||
- name: Import client
|
||||
command: podman exec -t cadoles-pod-hydra-v1 /bin/sh -c "hydra clients import /etc/hydra/clients.d/{{ client_id }}.json --endpoint http://127.0.0.1:4445"
|
||||
become: true
|
Loading…
Reference in New Issue
Block a user
Je ne trouve pas trace de ce fichier "hydra-client.json.j2"