refactor offline install, rhsso patch install
parent
11fb2cc43b
commit
906ba3c577
|
@ -7,11 +7,17 @@ keycloak_download_url_9x: "https://downloads.jboss.org/keycloak/{{ keycloak_vers
|
||||||
keycloak_installdir: "{{ keycloak_dest }}/keycloak-{{ keycloak_version }}"
|
keycloak_installdir: "{{ keycloak_dest }}/keycloak-{{ keycloak_version }}"
|
||||||
|
|
||||||
### Configuration specific to Red Hat Single Sing-On
|
### Configuration specific to Red Hat Single Sing-On
|
||||||
keycloak_rhsso_enable: False
|
keycloak_rhsso_version: 7.5.0
|
||||||
keycloak_rhsso_version: 7.5
|
rhsso_rhn_id: "{{ rhsso_rhn_ids[keycloak_rhsso_version] }}"
|
||||||
keycloak_rhsso_archive: "rh-sso-{{ keycloak_rhsso_version }}-server-dist.zip"
|
keycloak_rhsso_archive: "rh-sso-{{ keycloak_rhsso_version }}-server-dist.zip"
|
||||||
keycloak_rhsso_installdir: "{{ keycloak_dest }}/rh-sso-{{ keycloak_rhsso_version }}"
|
keycloak_rhsso_installdir: "{{ keycloak_dest }}/rh-sso-{{ keycloak_rhsso_version | regex_replace('^([0-9])\\.([0-9]*).*', '\\1.\\2') }}"
|
||||||
keycloak_rhsso_base_url: 'https://access.redhat.com/jbossnetwork/restricted/softwareDownload.html?softwareId='
|
keycloak_rhn_url: 'https://access.redhat.com/jbossnetwork/restricted/softwareDownload.html?softwareId='
|
||||||
|
keycloak_rhsso_download_url: "{{ keycloak_rhn_url }}{{ rhsso_rhn_id }}"
|
||||||
|
|
||||||
|
### keycloak/rhsso choice: by default install rhsso if rhn credentials are defined
|
||||||
|
keycloak_rhsso_enable: "{{ True if rhsso_rhn_id is defined and rhn_username is defined and rhn_password is defined else False }}"
|
||||||
|
# whether to install from local archive; filename must be keycloak_archive or keycloak_rhsso_archive depending on keycloak_rhsso_enable
|
||||||
|
keycloak_offline_install: False
|
||||||
|
|
||||||
### Install location and service settings
|
### Install location and service settings
|
||||||
jvm_package: java-1.8.0-openjdk-devel
|
jvm_package: java-1.8.0-openjdk-devel
|
||||||
|
@ -27,7 +33,7 @@ keycloak_service_group: keycloak
|
||||||
keycloak_service_pidfile: "/run/keycloak.pid"
|
keycloak_service_pidfile: "/run/keycloak.pid"
|
||||||
keycloak_service_logfile: "{{ keycloak_dest }}/keycloak.log"
|
keycloak_service_logfile: "{{ keycloak_dest }}/keycloak.log"
|
||||||
|
|
||||||
### Keycloak configuration settings
|
### Common configuration settings
|
||||||
keycloak_bind_address: 0.0.0.0
|
keycloak_bind_address: 0.0.0.0
|
||||||
keycloak_host: localhost
|
keycloak_host: localhost
|
||||||
keycloak_http_port: 8080
|
keycloak_http_port: 8080
|
||||||
|
|
|
@ -5,19 +5,14 @@
|
||||||
- keycloak_rhsso_enable
|
- keycloak_rhsso_enable
|
||||||
quiet: true
|
quiet: true
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
rhn_download_url: "{{ keycloak_rhsso_base_url }}{{ rhsso_rhn_id }}"
|
|
||||||
when:
|
|
||||||
- rhsso_rhn_id is defined
|
|
||||||
|
|
||||||
- name: "Check zipfile dest directory {{ zipfile_dest }}"
|
- name: "Check zipfile dest directory {{ zipfile_dest }}"
|
||||||
stat:
|
stat:
|
||||||
path: "{{ zipfile_dest }}"
|
path: "{{ zipfile_dest }}"
|
||||||
register: archive_path
|
register: archive_path
|
||||||
|
|
||||||
- name: "Download zipfile from RHN: {{ rhn_download_url }}"
|
- name: "Download zipfile from RHN: {{ keycloak_rhsso_download_url }}"
|
||||||
redhat_csp_download:
|
redhat_csp_download:
|
||||||
url: "{{ rhn_download_url }}"
|
url: "{{ keycloak_rhsso_download_url }}"
|
||||||
dest: "{{ zipfile_dest }}"
|
dest: "{{ zipfile_dest }}"
|
||||||
username: "{{ rhn_username }}"
|
username: "{{ rhn_username }}"
|
||||||
password: "{{ rhn_password }}"
|
password: "{{ rhn_password }}"
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
- name: Validate credentials
|
- name: Validate credentials
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- (rhn_username is defined and rhsso_rhn_id is defined) or rhsso_rhn_id is not defined
|
- (rhn_username is defined and keycloak_rhsso_enable) or not keycloak_rhsso_enable or keycloak_offline_install
|
||||||
- (rhn_password is defined and rhsso_rhn_id is defined) or rhsso_rhn_id is not defined
|
- (rhn_password is defined and keycloak_rhsso_enable) or not keycloak_rhsso_enable or keycloak_offline_install
|
||||||
quiet: True
|
quiet: True
|
||||||
fail_msg: "Cannot install Red Hat SSO without RHN credentials. Check rhn_username and rhn_password are defined"
|
fail_msg: "Cannot install Red Hat SSO without RHN credentials. Check rhn_username and rhn_password are defined"
|
||||||
success_msg: "{{ 'Installing Red Hat Single Sign-On' if rhsso_rhn_id is defined else 'Installing keycloak.org' }}"
|
success_msg: "{{ 'Installing Red Hat Single Sign-On' if keycloak_rhsso_enable else 'Installing keycloak.org' }}"
|
||||||
|
|
||||||
- name: Set required packages facts
|
- name: Set required packages facts
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
keycloak_admin_password:
|
keycloak_admin_password:
|
||||||
|
|
||||||
# internal variables below
|
# internal variables below
|
||||||
|
rhsso_rhn_ids:
|
||||||
|
'7.5.0': '101971'
|
||||||
|
'7.5.1': '103836'
|
||||||
|
|
||||||
# locations
|
# locations
|
||||||
keycloak_url: "http://{{ keycloak_host }}:{{ keycloak_http_port }}"
|
keycloak_url: "http://{{ keycloak_host }}:{{ keycloak_http_port }}"
|
||||||
|
|
Loading…
Reference in New Issue