Skip to content

Commit

Permalink
Make offline patches optional (with warning message)
Browse files Browse the repository at this point in the history
  • Loading branch information
guidograzioli authored and rpelisse committed Dec 12, 2024
1 parent dc391c3 commit bc9141d
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions roles/jws/tasks/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,38 @@
ansible.builtin.assert:
that:
- filename is exists
fail_msg: "An offline install was requested but the zipfile {{ filename }} was not found"
fail_msg: "An offline install was requested but the native components zipfile {{ filename }} was not found"
when: jws_native
vars:
filename: "{{ jws_archive_repository }}/{{ jws_native_zipfile }}"
- name: "Check patch zipfile exists"
ansible.builtin.assert:
that:
- filename is exists
fail_msg: "An offline install was requested but the zipfile {{ filename }} was not found"
when: jws_apply_patches
vars:
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + '-application-server.zip' }}"
- name: "Check native patch zipfile exists"
ansible.builtin.assert:
that:
- filename is exists
fail_msg: "An offline install was requested but the zipfile {{ filename }} was not found"
when: jws_apply_patches and jws_native
vars:
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + \
(jws_version.startswith('6') | ternary('-optional-native-components-RHEL', '-application-server-RHEL')) + \
(jws_native_rhel_version | default(ansible_facts['distribution_major_version'])) + \
'-' + jws_patch_native_arch + '.zip' }}"
- name: Check patch zipfile
block:
- name: "Check patch zipfile exists"
ansible.builtin.assert:
that:
- filename is exists
fail_msg: "An offline install was requested but the patch zipfile {{ filename }} was not found"
when: jws_apply_patches
vars:
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + '-application-server.zip' }}"
rescue:
- name: "Display patch file not present warning"
ansible.builtin.debug:
msg: "WARNING: The offline installation will continue without installing a patch"
- name: Check native patch zipfile
block:
- name: "Check native patch zipfile exists"
ansible.builtin.assert:
that:
- filename is exists
fail_msg: "An offline install was requested but the native components patch zipfile {{ filename }} was not found"
when: jws_apply_patches and jws_native
vars:
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + \
(jws_version.startswith('6') | ternary('-optional-native-components-RHEL', '-application-server-RHEL')) + \
(jws_native_rhel_version | default(ansible_facts['distribution_major_version'])) + \
'-' + jws_patch_native_arch + '.zip' }}"
rescue:
- name: "Display patch file not present warning"
ansible.builtin.debug:
msg: "WARNING: The offline installation will continue without installing a native components patch"

0 comments on commit bc9141d

Please sign in to comment.