Code review comments

This commit is contained in:
root 2022-01-14 13:54:10 -06:00
commit ce26ceeed0
7 changed files with 65 additions and 44 deletions

View file

@ -2,11 +2,13 @@
- assert:
that:
- 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 or rhsso_source_download_url is defined
- keycloak_rhsso_enable
quiet: true
- set_fact:
rhn_download_url: "{{ keycloak_rhsso_base_url }}{{ rhn_id_file }}"
rhn_download_url: "{{ keycloak_rhsso_base_url }}{{ rhsso_rhn_id }}"
when:
- rhsso_rhn_id is defined
- name: "Check zipfile dest directory {{ zipfile_dest }}"
stat:
@ -24,6 +26,8 @@
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- rhn_username is defined
- rhn_password is defined
- rhsso_rhn_id is defined
- name: "Copy zipfile from source like Nexus etc : {{ rhsso_source_download_url }}"
@ -39,9 +43,9 @@
- 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: {{ zip_file_local_path }}"
ansible.builtin.copy:
src: "{{ rhsso_zip_file_local_path }}"
src: "{{ zip_file_local_path }}"
dest: "{{ zipfile_dest }}"
owner: "{{ keycloak_service_user }}"
group: "{{ keycloak_service_group }}"
@ -50,7 +54,7 @@
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- rhsso_zip_file_local_path is defined
- zip_file_local_path is defined
- name: "Check zipfile dest directory {{ zipfile_dest }}"
stat:

View file

@ -74,11 +74,11 @@
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- not keycloak_zip_file_local_path is defined
- not keycloak_rhsso_enable and not zip_file_local_path is defined
- name: "Copy zipfile from local source: {{ keycloak_zip_file_local_path }}"
- name: "Copy zipfile from local source: {{ zip_file_local_path }}"
ansible.builtin.copy:
src: "{{ keycloak_zip_file_local_path }}"
src: "{{ zip_file_local_path }}"
dest: "{{ keycloak_dest }}"
owner: "{{ keycloak_service_user }}"
group: "{{ keycloak_service_group }}"
@ -87,7 +87,7 @@
- archive_path is defined
- archive_path.stat is defined
- not archive_path.stat.exists
- keycloak_zip_file_local_path is defined
- not keycloak_rhsso_enable and zip_file_local_path is defined
- name: extract Keycloak archive on target
unarchive:
@ -105,9 +105,9 @@
- block:
- assert:
that:
- rhsso_rhn_id is defined or rhsso_zip_file_local_path is defined or rhsso_source_download_url is defined
- rhsso_rhn_id is defined or zip_file_local_path is defined
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 located on Ansible node"
- name: create download directory
file:
@ -117,9 +117,8 @@
group: "{{ keycloak_service_group }}"
mode: 0750
- include_tasks: download_from_rhn.yml
- include_tasks: get_rhsso.yml
vars:
rhn_id_file: "{{ rhsso_rhn_id | default(None) }}"
zipfile_dest: "{{ keycloak_dest }}/{{ keycloak_rhsso_archive }}"
work_dir: "{{ keycloak_dest }}"
target_dir: "{{ keycloak_jboss_home }}"