get rid of rhn_ids dict

This commit is contained in:
Guido Grazioli 2022-12-13 15:31:08 +01:00
parent 9157f83f96
commit 2054082b40
No known key found for this signature in database
GPG key ID: 22C8C31EF2BC093B
3 changed files with 15 additions and 13 deletions

View file

@ -273,7 +273,7 @@ argument_specs:
description: "Red Hat Single Sign-On version"
type: "str"
sso_rhn_id:
default: "{{ sso_rhn_ids[sso_version].id }}"
default: "101971"
description: "Customer Portal product ID for Red Hat SSO"
type: "str"
sso_archive:
@ -316,7 +316,15 @@ argument_specs:
default: "Red Hat Single Sign-On"
description: "systemd description for Red Hat Single Sign-On"
type: "str"
sso_patch_version:
default: "7.5.3"
description: "Red Hat Single Sign-On latest cumulative patch version"
type: "str"
sso_patch_bundle:
default: "rh-sso-{{ sso_rhn_ids[sso_version].latest_cp.v }}-patch.zip"
default: "rh-sso-{{ sso_patch_version }}-patch.zip"
description: "Red Hat SSO patch archive filename"
type: "str"
sso_patch_rhn_id:
default: "104738"
description: "Customer Portal product ID for Red Hat SSO latest cumulative patch"
type: "str"

View file

@ -11,7 +11,7 @@
- name: Perform download from RHN
middleware_automation.redhat_csp_download.redhat_csp_download:
url: "{{ keycloak_rhn_url }}{{ sso_rhn_ids[keycloak_version].latest_cp.id }}"
url: "{{ keycloak_rhn_url }}{{ sso_patch_rhn_id }}"
dest: "{{ local_path.stat.path }}/{{ sso_patch_bundle }}"
username: "{{ rhn_username }}"
password: "{{ rhn_password }}"
@ -48,9 +48,9 @@
when:
- cli_result is defined
- cli_result.stdout is defined
- sso_rhn_ids[keycloak_version].latest_cp.v not in cli_result.stdout
- sso_patch_version not in cli_result.stdout
block:
- name: "Apply patch {{ sso_rhn_ids[keycloak_version].latest_cp.v }} to server"
- name: "Apply patch {{ sso_patch_version }} to server"
ansible.builtin.include_tasks: rhsso_cli.yml
vars:
query: "patch apply {{ patch_archive }}"
@ -78,10 +78,10 @@
- name: "Verify installed patch version"
ansible.builtin.assert:
that:
- sso_rhn_ids[keycloak_version].latest_cp.v not in cli_result.stdout
- sso_patch_version not in cli_result.stdout
fail_msg: "Patch installation failed"
success_msg: "Patch installation successful"
- name: "Skipping patch"
ansible.builtin.debug:
msg: "Latest cumulative patch {{ sso_rhn_ids[keycloak_version].latest_cp.v }} already installed, skipping patch installation."
msg: "Latest cumulative patch {{ sso_patch_version }} already installed, skipping patch installation."

View file

@ -1,11 +1,5 @@
---
# internal variables below
sso_rhn_ids:
'7.5.0': # noqa vars_in_vars_files_have_valid_names
id: '101971'
latest_cp:
id: '103836'
v: '7.5.1'
# locations
keycloak_url: "http://{{ keycloak_host }}:{{ keycloak_http_port }}"