Skip to content

Commit

Permalink
unixPB: improves Ant-Contrib role compatibility
Browse files Browse the repository at this point in the history
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: [email protected]
  • Loading branch information
mahdipub committed Sep 30, 2024
1 parent d483066 commit dd6d373
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit dd6d373

Please sign in to comment.