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 45d9d88
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:

Check failure on line 72 in ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Yamllint

72:11 [trailing-spaces] trailing spaces

Check failure on line 72 in ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[trailing-spaces]

Trailing spaces
url: https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-{{ antContribVersion }}/ant-contrib-{{ antContribVersion }}-bin.tar.gz?viasf=1

Check failure on line 73 in ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Yamllint

73:163 [trailing-spaces] trailing spaces

Check failure on line 73 in ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[trailing-spaces]

Trailing spaces
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 45d9d88

Please sign in to comment.