Skip to content

Commit

Permalink
isolate homebrew operations from curl role
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <sxa@redhat.com>
  • Loading branch information
sxa committed Feb 28, 2024
1 parent 63d7307 commit dd02ef3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Build_Tool_Packages:
- automake # for compiling freetype on JDK8u
- cmake # OpenJ9
- coreutils
- curl
- gnupg
- gnu-sed
- gnu-tar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@
curl_latest: 7.79.1
tags: curl

- name: Set Mac homebrew path (x64)
set_fact:
homebrew_path: /usr/local/bin
when: ansible_distribution == "MacOSX" and ansible_architecture == "x86_64"

- name: Set Mac homebrew path (Arm64)
set_fact:
homebrew_path: /opt/homebrew/bin
when: ansible_distribution == "MacOSX" and ansible_architecture == "arm64"

- name: Download curl {{ curl_latest }}
get_url:
url: https://github.com/curl/curl/releases/download/curl-7_79_1/curl-{{ curl_latest }}.tar.gz
Expand Down Expand Up @@ -103,35 +93,7 @@
- ((not curl_version.stdout) or ((curl_version.stdout) and (curl_version.stdout is version_compare(curl_oldest, operator='lt', strict=True))))
tags: curl

- name: Get macOS version
shell: sw_vers -productVersion
register: macos_version
changed_when: false
when:
- ansible_distribution == "MacOSX"
tags: curl

- name: Set macos version
set_fact:
macos_version_number: "{{ macos_version.stdout.split('.')[0] }}.{{ macos_version.stdout.split('.')[1] }}"
when:
- ansible_distribution == "MacOSX"
tags: curl

- name: Install latest version of curl for MacOS
become: yes
become_user: "{{ ansible_user }}"
homebrew:
name: curl
state: latest
path: "{{ homebrew_path }}"
when:
- ansible_distribution == "MacOSX"
- "macos_version_number is version('10.13', '>')"
- ((not curl_version.stdout) or ((curl_version.stdout) and (curl_version.stdout is version_compare(curl_oldest, operator='lt', strict=True))))
tags: curl

- name: Find install directory MacOS
- name: Find curl install directory on macos
shell: ls -la /usr/local/Cellar/curl/7.*/bin/curl | awk '{print $9}'
register: curl_install_dir
changed_when: false
Expand All @@ -140,7 +102,7 @@
- "macos_version_number is version('10.13', '>')"
tags: curl

- name: Create /usr/local/bin/curl symlink MacOS
- name: Create /usr/local/bin/curl symlink on macos
file:
src: '{{ curl_install_dir.stdout }}'
dest: /usr/local/bin/curl
Expand Down

0 comments on commit dd02ef3

Please sign in to comment.