mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-04-08 11:50:29 -07:00
Replace main download
This commit is contained in:
parent
e530ccdc31
commit
ccf773057b
5 changed files with 46 additions and 29 deletions
|
@ -19,7 +19,12 @@ Dependencies
|
||||||
|
|
||||||
The roles depends on:
|
The roles depends on:
|
||||||
|
|
||||||
* the `redhat_csp_download` role from [middleware_automation.redhat_csp_download](https://github.com/ansible-middleware/redhat-csp-download) collection if Red Hat Single Sign-on zip have to be downloaded from RHN.
|
* [middleware_automation.common](https://github.com/ansible-middleware/common)
|
||||||
|
* [ansible-posix](https://docs.ansible.com/ansible/latest/collections/ansible/posix/index.html)
|
||||||
|
|
||||||
|
To install all the dependencies via galaxy:
|
||||||
|
|
||||||
|
ansible-galaxy collection install -r requirements.yml
|
||||||
|
|
||||||
|
|
||||||
Versions
|
Versions
|
||||||
|
|
|
@ -300,10 +300,6 @@ argument_specs:
|
||||||
default: "7.6.0"
|
default: "7.6.0"
|
||||||
description: "Red Hat Single Sign-On version"
|
description: "Red Hat Single Sign-On version"
|
||||||
type: "str"
|
type: "str"
|
||||||
sso_rhn_id:
|
|
||||||
default: "104539"
|
|
||||||
description: "Customer Portal product ID for Red Hat SSO"
|
|
||||||
type: "str"
|
|
||||||
sso_archive:
|
sso_archive:
|
||||||
default: "rh-sso-{{ sso_version }}-server-dist.zip"
|
default: "rh-sso-{{ sso_version }}-server-dist.zip"
|
||||||
description: "Red Hat SSO install archive filename"
|
description: "Red Hat SSO install archive filename"
|
||||||
|
@ -316,14 +312,6 @@ argument_specs:
|
||||||
default: "{{ sso_dest }}/rh-sso-{{ sso_version.split('.')[0] }}.{{ sso_version.split('.')[1] }}"
|
default: "{{ sso_dest }}/rh-sso-{{ sso_version.split('.')[0] }}.{{ sso_version.split('.')[1] }}"
|
||||||
description: "Installation path for Red Hat SSO"
|
description: "Installation path for Red Hat SSO"
|
||||||
type: "str"
|
type: "str"
|
||||||
sso_rhn_url:
|
|
||||||
default: 'https://access.redhat.com/jbossnetwork/restricted/softwareDownload.html?softwareId='
|
|
||||||
description: "Base download URI for customer portal"
|
|
||||||
type: "str"
|
|
||||||
sso_download_url:
|
|
||||||
default: "{{ sso_rhn_url }}{{ sso_rhn_id }}"
|
|
||||||
description: "Full download URI for Red Hat SSO"
|
|
||||||
type: "str"
|
|
||||||
sso_apply_patches:
|
sso_apply_patches:
|
||||||
default: False
|
default: False
|
||||||
description: "Install Red Hat SSO most recent cumulative patch"
|
description: "Install Red Hat SSO most recent cumulative patch"
|
||||||
|
@ -333,7 +321,7 @@ argument_specs:
|
||||||
description: "Enable Red Hat Single Sign-on installation"
|
description: "Enable Red Hat Single Sign-on installation"
|
||||||
type: "str"
|
type: "str"
|
||||||
sso_offline_install:
|
sso_offline_install:
|
||||||
default: True
|
default: False
|
||||||
description: "Perform an offline install"
|
description: "Perform an offline install"
|
||||||
type: "bool"
|
type: "bool"
|
||||||
sso_service_name:
|
sso_service_name:
|
||||||
|
@ -352,7 +340,7 @@ argument_specs:
|
||||||
default: "rh-sso-{{ sso_patch_version }}-patch.zip"
|
default: "rh-sso-{{ sso_patch_version }}-patch.zip"
|
||||||
description: "Red Hat SSO patch archive filename"
|
description: "Red Hat SSO patch archive filename"
|
||||||
type: "str"
|
type: "str"
|
||||||
sso_patch_rhn_id:
|
sso_product_category:
|
||||||
default: "104867"
|
 default: "core.service.rhsso"
|
||||||
description: "Customer Portal product ID for Red Hat SSO latest cumulative patch"
|
 description: "JBossNetwork API category for Single Sign-On"
|
||||||
type: "str"
|
 type: "str"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
collections:
|
collections:
|
||||||
- middleware_automation.redhat_csp_download
|
- middleware_automation.common
|
||||||
|
- ansible.posix
|
||||||
|
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
role_name: keycloak
|
role_name: keycloak
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
run_once: yes
|
||||||
when:
|
when:
|
||||||
- archive_path is defined
|
- archive_path is defined
|
||||||
- archive_path.stat is defined
|
- archive_path.stat is defined
|
||||||
|
@ -84,21 +85,43 @@
|
||||||
- not sso_enable is defined or not sso_enable
|
- not sso_enable is defined or not sso_enable
|
||||||
- not keycloak_offline_install
|
- not keycloak_offline_install
|
||||||
|
|
||||||
- name: Perform download from RHN
|
- name: Perform download from RHN using JBoss Network API
|
||||||
middleware_automation.redhat_csp_download.redhat_csp_download:
|
|
||||||
url: "{{ keycloak_rhsso_download_url }}"
|
|
||||||
dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
|
||||||
username: "{{ rhn_username }}"
|
|
||||||
password: "{{ rhn_password }}"
|
|
||||||
no_log: "{{ omit_rhn_output | default(true) }}"
|
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
run_once: yes
|
||||||
when:
|
when:
|
||||||
- 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
|
||||||
- sso_enable is defined and sso_enable
|
- sso_enable is defined and sso_enable
|
||||||
- not keycloak_offline_install
|
- not keycloak_offline_install
|
||||||
- keycloak_rhn_url in keycloak_download_url
|
block:
|
||||||
|
- name: Retrieve product download using JBoss Network API
|
||||||
|
middleware_automation.common.product_search:
|
||||||
|
client_id: "{{ rhn_username }}"
|
||||||
|
 client_secret: "{{ rhn_password }}"
|
||||||
|
 product_type: DISTRIBUTION
|
||||||
|
product_version: "{{ sso_version }}"
|
||||||
|
 product_category: "{{ sso_product_category }}"
|
||||||
|
register: rhn_products
|
||||||
|
no_log: "{{ omit_rhn_output | default(true) }}"
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: yes
|
||||||
|
|
||||||
|
- name: Determine install zipfile from search results
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '[^/]*/{{ sso_archive }}$') }}"
|
||||||
|
 delegate_to: localhost
|
||||||
|
 run_once: yes
|
||||||
|

|
||||||
|
- name: Download Red Hat Single Sign-On
|
||||||
|
middleware_automation.common.product_download: # noqa risky-file-permissions delegated, uses controller host user
|
||||||
|
 client_id: "{{ rhn_username }}"
|
||||||
|
 client_secret: "{{ rhn_password }}"
|
||||||
|
 product_id: "{{ (rhn_filtered_products | first).id }}"
|
||||||
|
 dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
||||||
|
 no_log: "{{ omit_rhn_output | default(true) }}"
|
||||||
|
 delegate_to: localhost
|
||||||
|
 run_once: yes
|
||||||
|
|
||||||
- name: Download rhsso archive from alternate location
|
- name: Download rhsso archive from alternate location
|
||||||
ansible.builtin.get_url: # noqa risky-file-permissions delegated, uses controller host user
|
ansible.builtin.get_url: # noqa risky-file-permissions delegated, uses controller host user
|
||||||
|
@ -106,13 +129,14 @@
|
||||||
dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
run_once: yes
|
||||||
when:
|
when:
|
||||||
- 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
|
||||||
- sso_enable is defined and sso_enable
|
- sso_enable is defined and sso_enable
|
||||||
- not keycloak_offline_install
|
- not keycloak_offline_install
|
||||||
- not keycloak_rhn_url in keycloak_download_url
|
- keycloak_rhsso_download_url is defined
|
||||||
|
|
||||||
- name: Check downloaded archive
|
- name: Check downloaded archive
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
|
|
|
@ -19,5 +19,4 @@ galaxy_info:
|
||||||
- keycloak
|
- keycloak
|
||||||
- redhat
|
- redhat
|
||||||
- rhel
|
- rhel
|
||||||
- rhn
|
|
||||||
- sso
|
- sso
|
||||||
|
|
Loading…
Add table
Reference in a new issue