Skip to content

Commit bc9141d

Browse files
guidograziolirpelisse
authored andcommitted
Make offline patches optional (with warning message)
1 parent dc391c3 commit bc9141d

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

roles/jws/tasks/defaults.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,38 @@
8484
ansible.builtin.assert:
8585
that:
8686
- filename is exists
87-
fail_msg: "An offline install was requested but the zipfile {{ filename }} was not found"
87+
fail_msg: "An offline install was requested but the native components zipfile {{ filename }} was not found"
8888
when: jws_native
8989
vars:
9090
filename: "{{ jws_archive_repository }}/{{ jws_native_zipfile }}"
91-
- name: "Check patch zipfile exists"
92-
ansible.builtin.assert:
93-
that:
94-
- filename is exists
95-
fail_msg: "An offline install was requested but the zipfile {{ filename }} was not found"
96-
when: jws_apply_patches
97-
vars:
98-
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + '-application-server.zip' }}"
99-
- name: "Check native patch zipfile exists"
100-
ansible.builtin.assert:
101-
that:
102-
- filename is exists
103-
fail_msg: "An offline install was requested but the zipfile {{ filename }} was not found"
104-
when: jws_apply_patches and jws_native
105-
vars:
106-
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + \
107-
(jws_version.startswith('6') | ternary('-optional-native-components-RHEL', '-application-server-RHEL')) + \
108-
(jws_native_rhel_version | default(ansible_facts['distribution_major_version'])) + \
109-
'-' + jws_patch_native_arch + '.zip' }}"
91+
- name: Check patch zipfile
92+
block:
93+
- name: "Check patch zipfile exists"
94+
ansible.builtin.assert:
95+
that:
96+
- filename is exists
97+
fail_msg: "An offline install was requested but the patch zipfile {{ filename }} was not found"
98+
when: jws_apply_patches
99+
vars:
100+
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + '-application-server.zip' }}"
101+
rescue:
102+
- name: "Display patch file not present warning"
103+
ansible.builtin.debug:
104+
msg: "WARNING: The offline installation will continue without installing a patch"
105+
- name: Check native patch zipfile
106+
block:
107+
- name: "Check native patch zipfile exists"
108+
ansible.builtin.assert:
109+
that:
110+
- filename is exists
111+
fail_msg: "An offline install was requested but the native components patch zipfile {{ filename }} was not found"
112+
when: jws_apply_patches and jws_native
113+
vars:
114+
filename: "{{ jws_archive_repository + '/jws-' + jws_patch_version + \
115+
(jws_version.startswith('6') | ternary('-optional-native-components-RHEL', '-application-server-RHEL')) + \
116+
(jws_native_rhel_version | default(ansible_facts['distribution_major_version'])) + \
117+
'-' + jws_patch_native_arch + '.zip' }}"
118+
rescue:
119+
- name: "Display patch file not present warning"
120+
ansible.builtin.debug:
121+
msg: "WARNING: The offline installation will continue without installing a native components patch"

0 commit comments

Comments
 (0)