Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isolate homebrew operations from curl role #3420

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 6 additions & 0 deletions collections/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# Required by AWX for the homebrew and zypper operations
# in curl/GIT_Source roles
collections:
- name: community.general
source: https://galaxy.ansible.com
Loading