feat(hydra): adding tasks to only update hydra-v1.

This commit is contained in:
Philippe Caseiro 2023-10-16 13:54:11 +02:00
parent d259417d47
commit a8a1632eb6
2 changed files with 32 additions and 1 deletions

View File

@ -121,4 +121,4 @@
validate: "haproxy -c -f %s"
notify:
- Restart HAProxy
become: true
become: true

31
tasks/update-hydra.yml Normal file
View File

@ -0,0 +1,31 @@
---
# Simple task to update the package/container cadoles-pod-hydra only.
- name: Install hydra package
ansible.builtin.apt:
name:
- cadoles-pod-hydra-v1={{ cadoles_pod_hydra_v1_package_version }}
update_cache: yes
state: present
become: true
- name: Configure cadoles-pod-hydra-v1
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- src: cadoles-pod-hydra-v1.conf.j2
dest: /etc/cadoles-pod-hydra-v1.conf
mode: u=rw,g=r
notify:
- Restart cadoles-pod-hydra-v1
become: true
- 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