Skip to content

Commit

Permalink
Merge pull request #89 from dennisse/fix-install-path
Browse files Browse the repository at this point in the history
 Stick to defaults - update homebrew_install_path
  • Loading branch information
geerlingguy authored Feb 5, 2024
2 parents 2726b78 + daa998a commit a32170b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions roles/homebrew/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Available variables are listed below, along with default values (see [`defaults/
The GitHub repository for Homebrew core.

homebrew_prefix: "{{ (ansible_machine == 'arm64') | ternary('/opt/homebrew', '/usr/local') }}"
homebrew_install_path: "{{ homebrew_prefix }}/Homebrew"
homebrew_install_path: "{{ homebrew_prefix }}{{ '/Homebrew' if ansible_machine != 'arm64' }}"

The path where Homebrew will be installed (`homebrew_prefix` is the parent directory). It is recommended you stick to the default, otherwise Homebrew might have some weird issues. If you change this variable, you should also manually create a symlink back to /usr/local so things work as Homebrew expects.
The path where Homebrew will be installed (`homebrew_prefix` is the parent directory). It is recommended you stick to the default, otherwise Homebrew might have some weird issues. If you change this variable, you should also manually create a symlink back to `/opt/homebrew` (or `/usr/local` if you're on an Intel-mac) so things work as Homebrew expects.

homebrew_brew_bin_path: /usr/local/bin
homebrew_brew_bin_path: {{ homebrew_prefix }}/bin

The path where `brew` will be installed.

Expand Down
2 changes: 1 addition & 1 deletion roles/homebrew/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
homebrew_repo: https://github.com/Homebrew/brew

homebrew_prefix: "{{ (ansible_machine == 'arm64') | ternary('/opt/homebrew', '/usr/local') }}"
homebrew_install_path: "{{ homebrew_prefix }}/Homebrew"
homebrew_install_path: "{{ homebrew_prefix }}{{ '/Homebrew' if ansible_machine != 'arm64' }}"
homebrew_brew_bin_path: "{{ homebrew_prefix }}/bin"

homebrew_installed_packages: []
Expand Down
5 changes: 5 additions & 0 deletions roles/homebrew/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
when: not homebrew_binary.stat.exists
become: true

- name: Add missing folder if not on Apple-chipset
set_fact:
homebrew_folders_base: "{{ homebrew_folders_base + ['Homebrew'] }}"
when: ansible_machine != 'arm64'

- name: Ensure proper homebrew folders are in place.
file:
path: "{{ homebrew_prefix }}/{{ item }}"
Expand Down
1 change: 0 additions & 1 deletion roles/homebrew/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
homebrew_folders_base:
- Cellar
- Homebrew
- Frameworks
- Caskroom
- bin
Expand Down

0 comments on commit a32170b

Please sign in to comment.