2022-07-19 14:26:08 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Add required utilities
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
|
|
|
- gpg
|
|
|
|
- wget
|
|
|
|
- openssl
|
|
|
|
update_cache: yes
|
|
|
|
state: present
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|
2022-07-19 14:26:08 +02:00
|
|
|
|
|
|
|
- name: Add LetsEncrypt missing intermediate certificates
|
|
|
|
command: "bash -c 'wget -O- --no-check-certificate https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash'"
|
|
|
|
args:
|
|
|
|
creates: /etc/ssl/certs/lets-encrypt-e1.pem.pem
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|
2022-07-19 14:26:08 +02:00
|
|
|
|
|
|
|
- name: Add cadoles-pod debian repository key
|
|
|
|
ansible.builtin.apt_key:
|
|
|
|
url: "{{ cadoles_pod_debian_repository_key_url }}"
|
|
|
|
state: present
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|
2022-07-19 14:26:08 +02:00
|
|
|
|
|
|
|
- name: Configure cadoles-pod debian repository
|
|
|
|
ansible.builtin.apt_repository:
|
|
|
|
repo: "deb {{ cadoles_pod_debian_repository_url }} {{ cadoles_pod_debian_repository }} main"
|
|
|
|
state: present
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|
2022-07-19 14:26:08 +02:00
|
|
|
|
2022-08-16 15:41:08 +02:00
|
|
|
- name: Ensure sysctl configuration
|
|
|
|
ansible.posix.sysctl:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
sysctl_set: yes
|
|
|
|
with_items:
|
|
|
|
- name: fs.inotify.max_user_instances
|
|
|
|
value: 128
|
|
|
|
- name: fs.inotify.max_user_watches
|
|
|
|
value: 204800
|
2022-08-16 16:38:36 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|
2022-08-16 15:41:08 +02:00
|
|
|
|
2023-10-25 11:38:08 +02:00
|
|
|
- name: Install HAProxy
|
2022-07-19 14:26:08 +02:00
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
2022-07-21 14:19:23 +02:00
|
|
|
- haproxy={{ haproxy_package_version }}
|
2022-07-19 14:26:08 +02:00
|
|
|
update_cache: yes
|
2022-07-21 14:19:23 +02:00
|
|
|
state: present
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|
2022-07-19 14:26:08 +02:00
|
|
|
|
2023-10-25 11:38:08 +02:00
|
|
|
- name: Install Hydra
|
|
|
|
include_tasks:
|
|
|
|
file: ./install-hydra.yml
|
|
|
|
apply:
|
|
|
|
tags: [ hydra-only ]
|
|
|
|
tags: [ hydra-only ]
|
2022-07-21 11:21:56 +02:00
|
|
|
|
2023-10-25 11:38:08 +02:00
|
|
|
- name: Install hydra-dispatcher
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
|
|
|
- cadoles-pod-hydra-dispatcher-v1={{ cadoles_pod_hydra_dispatcher_v1_package_version }}
|
|
|
|
update_cache: yes
|
|
|
|
state: present
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2022-07-19 14:26:08 +02:00
|
|
|
|
|
|
|
- name: Configure cadoles-pod-hydra-dispatcher-v1
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
2022-08-03 21:06:02 +02:00
|
|
|
mode: "{{ item.mode }}"
|
2022-07-19 14:26:08 +02:00
|
|
|
with_items:
|
|
|
|
- src: cadoles-pod-hydra-dispatcher-v1.conf.j2
|
|
|
|
dest: /etc/cadoles-pod-hydra-dispatcher-v1.conf
|
2022-08-03 21:06:02 +02:00
|
|
|
mode: u=rw,g=r
|
2022-07-19 14:26:08 +02:00
|
|
|
- src: hydra-dispatcher-apps.yml.j2
|
|
|
|
dest: /etc/hydra-dispatcher/conf.d/apps.yml
|
2022-08-03 21:06:02 +02:00
|
|
|
mode: u=rw,g=r,o=r
|
2022-07-19 14:26:08 +02:00
|
|
|
notify:
|
|
|
|
- Restart cadoles-pod-hydra-dispatcher-v1
|
2022-07-21 10:04:17 +02:00
|
|
|
become: true
|
2022-07-19 14:26:08 +02:00
|
|
|
|
|
|
|
- name: Configure passwordless authentification if enabled
|
|
|
|
ansible.builtin.include_tasks: hydra-passwordless.yml
|
|
|
|
when: enable_hydra_passwordless
|
|
|
|
|
|
|
|
- name: Configure SAML authentification if enabled
|
|
|
|
ansible.builtin.include_tasks: hydra-saml.yml
|
|
|
|
when: enable_hydra_saml
|
|
|
|
|
2022-08-10 17:46:19 +02:00
|
|
|
- name: Configure OIDC authentification if enabled
|
|
|
|
ansible.builtin.include_tasks: hydra-oidc.yml
|
|
|
|
when: enable_hydra_oidc
|
|
|
|
|
2022-08-25 20:32:15 +02:00
|
|
|
- name: Configure LDAP authentification if enabled
|
|
|
|
ansible.builtin.include_tasks: hydra-ldap.yml
|
|
|
|
when: enable_hydra_ldap
|
|
|
|
|
2023-12-04 09:22:04 +01:00
|
|
|
- name: Configure WebAuthn authentification if enabled
|
|
|
|
ansible.builtin.include_tasks: hydra-webauthn.yml
|
|
|
|
when: enable_hydra_webauthn
|
|
|
|
|
2022-08-02 16:56:06 +02:00
|
|
|
- name: Start OIDC Test app if enabled
|
|
|
|
ansible.builtin.include_tasks: start-oidc-test.yml
|
2023-10-25 11:38:08 +02:00
|
|
|
when: enable_oidc_test_app and not install_only
|
2022-08-02 16:56:06 +02:00
|
|
|
|
|
|
|
- name: Stop OIDC Test app if disabled
|
|
|
|
ansible.builtin.include_tasks: stop-oidc-test.yml
|
2023-10-25 11:38:08 +02:00
|
|
|
when: not enable_oidc_test_app and not install_only
|
2023-02-13 11:42:36 +01:00
|
|
|
|
|
|
|
- name: Configure HAProxy
|
|
|
|
template:
|
|
|
|
src: haproxy.cfg.j2
|
|
|
|
dest: /etc/haproxy/haproxy.cfg
|
|
|
|
validate: "haproxy -c -f %s"
|
|
|
|
notify:
|
|
|
|
- Restart HAProxy
|
2023-10-16 13:54:11 +02:00
|
|
|
become: true
|
2023-10-25 11:38:08 +02:00
|
|
|
tags: [ hydra-only ]
|