2023-10-25 11:38:08 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install Hydra
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
|
|
|
- cadoles-pod-hydra-v1={{ cadoles_pod_hydra_v1_package_version }}
|
|
|
|
update_cache: yes
|
|
|
|
state: present
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Configure Hydra local database
|
|
|
|
ansible.builtin.include_tasks: hydra-database.yml
|
2023-10-25 17:55:54 +02:00
|
|
|
when: not hydra_use_external_database
|
2023-10-25 11:38:08 +02:00
|
|
|
|
|
|
|
- name: Configure cadoles-pod-hydra-v1
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
with_items:
|
|
|
|
- src: cadoles-pod-hydra-v1.conf.j2
|
|
|
|
dest: /etc/cadoles-pod-hydra-v1.conf
|
|
|
|
notify:
|
|
|
|
- Restart cadoles-pod-hydra-v1
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Check cadoles-pod-hydra-v1 status
|
|
|
|
service:
|
|
|
|
name: cadoles-pod-hydra-v1
|
|
|
|
state: started
|
|
|
|
become: true
|
|
|
|
|
2023-10-25 17:55:54 +02:00
|
|
|
- name: Migrate Hydra database schema
|
|
|
|
command: podman exec -it cadoles-pod-hydra-v1 migrate-hydra-schema
|
|
|
|
become: true
|
|
|
|
when: hydra_auto_migrate
|
|
|
|
|
2023-10-25 11:38:08 +02:00
|
|
|
- name: Create hydra-clients
|
|
|
|
template:
|
|
|
|
src: hydra-client.json.j2
|
|
|
|
dest: "/etc/hydra/clients.d/{{ item.client_id }}.json"
|
|
|
|
with_items: "{{ hydra_clients }}"
|
|
|
|
notify:
|
|
|
|
- Reload hydra clients
|
|
|
|
become: true
|
|
|
|
|