Local path installation support

This commit is contained in:
root 2022-01-11 01:34:06 -06:00
commit 4217ba6e7f
6 changed files with 126 additions and 18 deletions

View file

@ -2,9 +2,7 @@
- assert:
that:
- zipfile_dest is defined
- rhn_id_file is defined
- rhn_username is defined
- rhn_password 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
quiet: true
- set_fact:
@ -26,11 +24,25 @@
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- not rhsso_zip_file_local_path is defined
- name: "Copy zipfile from local source: {{ rhsso_zip_file_local_path }}"
ansible.builtin.copy:
src: "{{ rhsso_zip_file_local_path }}"
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_zip_file_local_path is defined
- name: "Check zipfile dest directory {{ zipfile_dest }}"
stat:
path: "{{ zipfile_dest }}"
register: path_to_downloaded_artefact
register: path_to_downloaded_artifact
- block:
- file:
@ -68,8 +80,8 @@
when:
- target_dir_state.stat.exists
when:
- path_to_downloaded_artefact is defined
- path_to_downloaded_artefact.stat is defined
- path_to_downloaded_artefact.stat.exists
- path_to_downloaded_artifact is defined
- path_to_downloaded_artifact.stat is defined
- path_to_downloaded_artifact.stat.exists
- target_dir is defined
- work_dir is defined

View file

@ -74,6 +74,20 @@
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- not keycloak_zip_file_local_path is defined
- name: "Copy zipfile from local source: {{ keycloak_zip_file_local_path }}"
ansible.builtin.copy:
src: "{{ keycloak_zip_file_local_path }}"
dest: "{{ keycloak_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
- keycloak_zip_file_local_path is defined
- name: extract Keycloak archive on target
unarchive:
@ -91,9 +105,9 @@
- block:
- assert:
that:
- rhsso_rhn_id is defined
- rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined
quiet: true
fail_msg: "Can't install RHSSO without RHN ID."
fail_msg: "Can't install RHSSO without either RHN ID or RHSSO zip file local path"
- name: create download directory
file:
@ -105,7 +119,7 @@
- include_tasks: download_from_rhn.yml
vars:
rhn_id_file: "{{ rhsso_rhn_id }}"
rhn_id_file: "{{ rhsso_rhn_id | default(None) }}"
zipfile_dest: "{{ keycloak_dest }}/{{ keycloak_rhsso_archive }}"
work_dir: "{{ keycloak_dest }}"
target_dir: "{{ keycloak_jboss_home }}"