Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
guidograzioli committed Dec 4, 2023
1 parent a3db5f8 commit 1de05aa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
6 changes: 4 additions & 2 deletions roles/jbcs/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ jbcs_ssl_port: 443
jbcs_version: '2.4.57'
jbcs_distro: RHEL8
jbcs_arch: x86_64
jbcs_bundle_prefix: "jbcs-httpd24-httpd"

jbcs_bundle: "{{ jbcs_patch_bundle }}-{{ jbcs_version }}-{{ jbcs_distro }}-{{ jbcs_arch }}.zip"
jbcs_patch_bundle: "{{ jbcs_patch_bundle }}-{{ jbcs_version }}-SP[1-9][0-9]*-{{ jbcs_distro }}-{{ jbcs_arch }}.zip"

jbcs_bundle: "jbcs-httpd24-httpd-{{ jbcs_version }}-{{ jbcs_distro }}-{{ jbcs_arch }}.zip"
jbcs_patch_bundle: "jbcs-httpd24-httpd-{{ jbcs_version }}-SP[0-9]*-{{ jbcs_distro }}-{{ jbcs_arch }}.zip"
jbcs_patch: true
jbcs_zip_path: /opt/apps/

Expand Down
6 changes: 5 additions & 1 deletion roles/jbcs/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ argument_specs:
description: "Filename of JBCS install archive"
type: "str"
jbcs_patch_bundle:
default: "jbcs-httpd24-httpd-{{ jbcs_version }}-SP[0-9]*-{{ jbcs_distro }}-{{ jbcs_arch }}.zip"
default: "jbcs-httpd24-httpd-{{ jbcs_version }}-SP[1-9][0-9]*-{{ jbcs_distro }}-{{ jbcs_arch }}.zip"
description: "Filename of JBCS patch install archive"
type: "str"
jbcs_bundle_prefix:
default: "jbcs-httpd24-httpd"
description: "Filename prefix for JBCS install archives"
type: "str"
jbcs_zip_path:
# line 6 of jbcs/defaults/main.yml
default: "/opt/apps"
Expand Down
5 changes: 3 additions & 2 deletions roles/jbcs/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
register: local_path
delegate_to: localhost

- name: Check local downloaded archive
- name: Check local download archive
ansible.builtin.stat:
path: "{{ local_path.stat.path }}/{{ jbcs_bundle }}"
register: local_archive_path
Expand Down Expand Up @@ -94,7 +94,8 @@

- name: Determine install zipfile from search results
ansible.builtin.set_fact:
rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '.*/jbcs-httpd24-httpd-' + jbcs_version + '-' + jbcs_distro + '-' + jbcs_arch + '.zip') }}"
rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', \
'.*/' + [ jbcs_bundle_prefix, jbcs_version, jbcs_distro, jbcs_arch ] | join('-') + '.zip') }}"
delegate_to: localhost
run_once: true

Expand Down
10 changes: 5 additions & 5 deletions roles/jbcs/tasks/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
- name: Determine patch zipfiles from search results
ansible.builtin.set_fact:
rhn_filtered_products: "{{ rhn_products.results | map(attribute='file_path') | \
select('match', '^[^/]*/jbcs-httpd24-httpd-' + jbcs_version + '-SP[0-9]+-RHEL8-x86_64.zip$') | \
map('regex_replace','[^/]*/jbcs-httpd24-httpd-' + jbcs_version + '-SP([0-9]+)-.*','\\1' ) | \
select('match', '^[^/]*/' + jbcs_patch_bundle + '$') | \
map('regex_replace', '[^/]*/' + jbcs_bundle_prefix + '-' + jbcs_version + '-SP([1-9][0-9]*)-.*', '\\1' ) | \
list | unique }}"
delegate_to: localhost
run_once: true
Expand All @@ -35,8 +35,8 @@

- name: Determine latest patch version
ansible.builtin.set_fact:
rhn_filtered_products: "{{ rhn_products.results |
selectattr('file_path', 'match', '[^/]*/jbcs-httpd24-httpd-' + jbcs_version + '-' + latest_patch_version + '-RHEL8-x86_64.zip$') }}"
rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', \
'[^/]*/' + [ jbcs_bundle_prefix, jbcs_version, latest_patch_version, jbcs_distro, jbcs_arch ] | join('-') + '.zip$') }}"
delegate_to: localhost
run_once: true

Expand Down Expand Up @@ -69,7 +69,7 @@
delegate_to: localhost
run_once: true

- name: Check local downloaded archive
- name: Check local download archive
ansible.builtin.stat:
path: "{{ local_path.stat.path }}/{{ jbcs_patch_bundle }}"
register: local_archive_path
Expand Down

0 comments on commit 1de05aa

Please sign in to comment.