From a8a1632eb64d60c1e60319b62bdc7a26966938a1 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 16 Oct 2023 13:54:11 +0200 Subject: [PATCH] feat(hydra): adding tasks to only update hydra-v1. --- tasks/main.yml | 2 +- tasks/update-hydra.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tasks/update-hydra.yml diff --git a/tasks/main.yml b/tasks/main.yml index 7688536..9692b3e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -121,4 +121,4 @@ validate: "haproxy -c -f %s" notify: - Restart HAProxy - become: true \ No newline at end of file + become: true diff --git a/tasks/update-hydra.yml b/tasks/update-hydra.yml new file mode 100644 index 0000000..028aa24 --- /dev/null +++ b/tasks/update-hydra.yml @@ -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 -- 2.17.1