Download source via url

main
root 2022-01-12 09:13:53 -06:00
parent 4217ba6e7f
commit ef81faefdf
5 changed files with 47 additions and 8 deletions

View File

@ -47,7 +47,7 @@ This is default way, no need to define any additional variables.
keycloak_zip_file_local_path: <local path of keycloak zip file> keycloak_zip_file_local_path: <local path of keycloak zip file>
``` ```
#### Install RHSSO from the Customer Portal, when the following variables are defined #### Install RHSSO from the Customer Support Portal, when the following variables are defined
``` ```
rhn_username: '<customer_portal_username>' rhn_username: '<customer_portal_username>'
@ -57,6 +57,14 @@ rhsso_rhn_id: '<sso_product_id>'
where `sso_product_id` is the ID for the specific Red Hat Single Sign-On version, ie. _101971_ will install version _7.5_) where `sso_product_id` is the ID for the specific Red Hat Single Sign-On version, ie. _101971_ will install version _7.5_)
#### Install RHSSO from remote sources like Nexus etc, when the following variables are defined
```
rhsso_source_download_url: '<url to downloand RHSSO zip file>'
```
where `sso_product_id` is the ID for the specific Red Hat Single Sign-On version, ie. _101971_ will install version _7.5_)
#### Install RHSSO from local source when the following variable is defined #### Install RHSSO from local source when the following variable is defined
``` ```

View File

@ -72,6 +72,11 @@ The following variables can be used to install Keycloak or Red Hat Single Sign-O
|`rhsso_zip_file_local_path` | Full local path of Red Hat Single Sign-On zip file | `tmp/rhsso/rh-sso-7.5-server-dist.zip` | |`rhsso_zip_file_local_path` | Full local path of Red Hat Single Sign-On zip file | `tmp/rhsso/rh-sso-7.5-server-dist.zip` |
|`keycloak_zip_file_local_path` | Full local path of Keycloak zip file | `/tmp/keycloak/keycloak-16.1.0.zip` | |`keycloak_zip_file_local_path` | Full local path of Keycloak zip file | `/tmp/keycloak/keycloak-16.1.0.zip` |
The following variable can be used to install Red Hat Single Sign-On from source via url, auth support is not added right now.
| Variable | Description | Default |
|:---------|:------------|:---------|
|`rhsso_source_download_url` | URL to download Red Hat Single Sign-On zip file from | `http://localhost:8081/nexus/rhsso/rh-sso-7.5-server-dist.zip` |
Dependencies Dependencies
------------ ------------
@ -133,6 +138,20 @@ The following is an example playbook that makes use of the role to install Red H
keycloak_admin_password: "changeme" keycloak_admin_password: "changeme"
``` ```
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from source url
```yaml
---
- hosts: keycloak
tasks:
- name: Keycloak Role
include_role:
name: keycloak
vars:
keycloak_admin_password: "changeme"
rhsso_source_download_url: "<REPLACE with - Source download url>" # This should be the full of remote source rhsso zip file
```
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from local path The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from local path
```yaml ```yaml
@ -147,7 +166,6 @@ The following is an example playbook that makes use of the role to install Red H
rhsso_zip_file_local_path: "/tmp/rhsso/rh-sso-7.5-server-dist.zip" # This should be local path of rhsso zip file rhsso_zip_file_local_path: "/tmp/rhsso/rh-sso-7.5-server-dist.zip" # This should be local path of rhsso zip file
``` ```
License License
------- -------

View File

@ -6,7 +6,7 @@ keycloak_download_url: https://downloads.jboss.org/keycloak/{{ keycloak_version
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: "{{ True if rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined else False }}" keycloak_rhsso_enable: "{{ True if rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined or rhsso_source_download_url is defined else False }}"
keycloak_rhsso_version: 7.5 keycloak_rhsso_version: 7.5
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 }}"
@ -15,7 +15,7 @@ keycloak_rhsso_base_url: 'https://access.redhat.com/jbossnetwork/restricted/soft
### 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
keycloak_dest: /opt/keycloak keycloak_dest: /opt/keycloak
keycloak_jboss_home: "{{ keycloak_rhsso_installdir if rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined else keycloak_installdir }}" keycloak_jboss_home: "{{ keycloak_rhsso_installdir if rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined or rhsso_source_download_url is defined else keycloak_installdir }}"
keycloak_config_dir: "{{ keycloak_jboss_home }}/standalone/configuration" keycloak_config_dir: "{{ keycloak_jboss_home }}/standalone/configuration"
keycloak_config_standalone_xml: "keycloak.xml" keycloak_config_standalone_xml: "keycloak.xml"

View File

@ -2,7 +2,7 @@
- assert: - assert:
that: that:
- zipfile_dest is defined - zipfile_dest is defined
- (rhn_username is defined and rhn_password is defined and rhn_id_file is defined) or rhsso_zip_file_local_path is defined - (rhn_username is defined and rhn_password is defined and rhn_id_file is defined) or rhsso_zip_file_local_path is defined or rhsso_source_download_url is defined
quiet: true quiet: true
- set_fact: - set_fact:
@ -13,7 +13,7 @@
path: "{{ zipfile_dest }}" path: "{{ zipfile_dest }}"
register: archive_path register: archive_path
- name: "Install zipfile from RHN: {{ rhn_download_url }}" - name: "Download zipfile from RHN: {{ rhn_download_url }}"
redhat_csp_download: redhat_csp_download:
url: "{{ rhn_download_url }}" url: "{{ rhn_download_url }}"
dest: "{{ zipfile_dest }}" dest: "{{ zipfile_dest }}"
@ -24,7 +24,20 @@
- archive_path is defined - archive_path is defined
- archive_path.stat is defined - archive_path.stat is defined
- not archive_path.stat.exists - not archive_path.stat.exists
- not rhsso_zip_file_local_path is defined - rhsso_rhn_id is defined
- name: "Copy zipfile from source like Nexus etc : {{ rhsso_source_download_url }}"
get_url:
url: "{{ rhsso_source_download_url }}"
dest: "{{ zipfile_dest }}"
owner: "{{ keycloak_service_user }}"
group: "{{ keycloak_service_group }}"
mode: 0750
when:
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- rhsso_source_download_url is defined
- name: "Copy zipfile from local source: {{ rhsso_zip_file_local_path }}" - name: "Copy zipfile from local source: {{ rhsso_zip_file_local_path }}"
ansible.builtin.copy: ansible.builtin.copy:

View File

@ -105,7 +105,7 @@
- block: - block:
- assert: - assert:
that: that:
- rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined - rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined or rhsso_source_download_url is defined
quiet: true quiet: true
fail_msg: "Can't install RHSSO without either RHN ID or RHSSO zip file local path" fail_msg: "Can't install RHSSO without either RHN ID or RHSSO zip file local path"