2020-06-18 18:23:12 +02:00
|
|
|
---
|
2021-02-15 19:58:53 +01:00
|
|
|
- name: Manage the JCliff installation on Ubuntu/Debian
|
2020-06-19 12:50:10 +02:00
|
|
|
block:
|
2021-02-15 19:58:53 +01:00
|
|
|
- name: Download the jcliff distribution
|
|
|
|
unarchive:
|
|
|
|
remote_src: yes
|
|
|
|
src: 'https://github.com/bserdar/jcliff/releases/download/v{{ keycloak_jcliff_version }}/jcliff-{{ keycloak_jcliff_version }}-dist.tar.gz'
|
|
|
|
dest: '/opt'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
|
|
|
|
- name: Fix the jcliff executable permissions
|
|
|
|
file:
|
|
|
|
dest: '/opt/jcliff-{{ keycloak_jcliff_version }}/jcliff'
|
|
|
|
mode: '0755'
|
|
|
|
|
|
|
|
- name: Link to the executable
|
|
|
|
file:
|
|
|
|
src: '/opt/jcliff-{{ keycloak_jcliff_version }}/jcliff'
|
|
|
|
dest: /usr/bin/jcliff
|
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: Link to the shared resources
|
|
|
|
file:
|
|
|
|
src: '/opt/jcliff-{{ keycloak_jcliff_version }}'
|
|
|
|
dest: /usr/share/jcliff
|
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: Set the JBOSS_HOME as {{ jboss_home }} in the global environment profile
|
|
|
|
template:
|
|
|
|
src: jboss-env.sh.j2
|
|
|
|
dest: /etc/profile.d/jboss-env.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '0444'
|
|
|
|
|
|
|
|
when: ansible_distribution_file_variety == "Debian"
|
|
|
|
tags: [ keycloak, jcliff ]
|
|
|
|
|
|
|
|
- import_tasks: keycloak-install.yml
|
|
|
|
- import_tasks: keycloak-jdbc.yml
|
|
|
|
- import_tasks: keycloak-configuration.yml
|
2020-06-19 12:50:10 +02:00
|
|
|
|
2021-02-15 19:58:53 +01:00
|
|
|
- name: Manage the keycloak service
|
2020-06-19 19:10:02 +02:00
|
|
|
block:
|
2021-02-15 19:58:53 +01:00
|
|
|
- name: Install the keycloak properties file
|
|
|
|
template:
|
|
|
|
src: wildfly.properties.j2
|
|
|
|
dest: '{{ keycloak_properties_directory }}/wildfly.properties'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '0444'
|
2020-06-19 19:27:34 +02:00
|
|
|
notify: Restart Keycloak
|
2020-06-19 19:10:02 +02:00
|
|
|
|
|
|
|
- name: Install the keycloak systemd unit
|
|
|
|
template: src=keycloak.service.j2 dest=/etc/systemd/system/keycloak.service owner=root group=root mode=0644
|
2020-06-19 19:27:34 +02:00
|
|
|
notify: Restart Keycloak
|
2020-06-19 19:10:02 +02:00
|
|
|
register: keycloak_unit
|
2020-06-19 12:50:10 +02:00
|
|
|
|
|
|
|
- name: Reload systemd
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
2020-06-19 19:10:02 +02:00
|
|
|
when: keycloak_unit is changed
|
|
|
|
|
2021-02-15 19:58:53 +01:00
|
|
|
# - name: ensure that the keycloak service is running and enabled
|
|
|
|
# service: name=keycloak state=started enabled=yes
|
2020-06-19 12:50:10 +02:00
|
|
|
|
2020-06-19 19:10:02 +02:00
|
|
|
tags: [ 'keycloak', 'keycloak_service', 'keycloak_conf' ]
|
2020-06-19 12:50:10 +02:00
|
|
|
|