From 45d9d8885e8e2e223cade8b5b05e0af14705b6fa Mon Sep 17 00:00:00 2001 From: Mahdi Ardekanian Date: Sun, 29 Sep 2024 21:09:30 -0400 Subject: [PATCH] unixPB: improves `Ant-Contrib` role compatibility It helps improve `Ant-Contrib` role by replacing wget with get_url module. Also when extracting, on macos the `unarchive` module might fails as it asks for gtar but default macos tar is `bsdtar`. The workaround is to run it as command on macos machines. Signed-off-by: mahdi@ibm.com --- .../roles/Ant-Contrib/tasks/main.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml index 2e0898dd42..2fa5a8fde0 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml @@ -69,11 +69,9 @@ tags: ant-contrib - name: Download ant-contrib (macOS) and (Solaris) - command: wget https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-{{ antContribVersion }}/ant-contrib-{{ antContribVersion }}-bin.tar.gz -O /tmp/ant-contrib-{{ antContribVersion }}-bin.tar.gz - retries: 3 - delay: 5 - register: antContrib_download - until: antContrib_download is not failed + get_url: + url: https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-{{ antContribVersion }}/ant-contrib-{{ antContribVersion }}-bin.tar.gz?viasf=1 + dest: /tmp/ant-contrib-{{ antContribVersion }}-bin.tar.gz when: - not antcontrib_status.stat.exists - ansible_distribution == "MacOSX" or ansible_distribution == "Solaris" @@ -84,7 +82,16 @@ src: /tmp/ant-contrib-{{ antContribVersion }}-bin.tar.gz dest: /tmp/ copy: False - when: not antcontrib_status.stat.exists + when: + - not antcontrib_status.stat.exists + - ansible_distribution != "MacOSX" + tags: ant-contrib + +- name: Extract ant-contrib MACOS + command: tar -xvf /tmp/ant-contrib-{{ antContribVersion }}-bin.tar.gz -C /tmp + when: + - not antcontrib_status.stat.exists + - ansible_distribution == "MacOSX" tags: ant-contrib - name: Move ant-contrib.jar to ant lib folder