diff --git a/changelogs/fragments/1679-homebrew_search_path.yml b/changelogs/fragments/1679-homebrew_search_path.yml new file mode 100644 index 0000000000..fa2d995891 --- /dev/null +++ b/changelogs/fragments/1679-homebrew_search_path.yml @@ -0,0 +1,8 @@ +--- +bugfixes: + - homebrew - add default search path for ``brew`` on Apple silicon hardware + (https://github.com/ansible-collections/community.general/pull/1679). + - homebrew_cask - add default search path for ``brew`` on Apple silicon hardware + (https://github.com/ansible-collections/community.general/pull/1679). + - homebrew_tap - add default search path for ``brew`` on Apple silicon hardware + (https://github.com/ansible-collections/community.general/pull/1679). diff --git a/plugins/modules/packaging/os/homebrew.py b/plugins/modules/packaging/os/homebrew.py index d13a27d60d..21dea647f5 100644 --- a/plugins/modules/packaging/os/homebrew.py +++ b/plugins/modules/packaging/os/homebrew.py @@ -38,7 +38,7 @@ options: - "A ':' separated list of paths to search for 'brew' executable. Since a package (I(formula) in homebrew parlance) location is prefixed relative to the actual path of I(brew) command, providing an alternative I(brew) path enables managing different set of packages in an alternative location in the system." - default: '/usr/local/bin' + default: '/usr/local/bin:/opt/homebrew/bin' type: path state: description: @@ -76,7 +76,7 @@ notes: ''' EXAMPLES = ''' -# Install formula foo with 'brew' in default path (C(/usr/local/bin)) +# Install formula foo with 'brew' in default path - community.general.homebrew: name: foo state: present @@ -871,7 +871,7 @@ def main(): elements='str', ), path=dict( - default="/usr/local/bin", + default="/usr/local/bin:/opt/homebrew/bin", required=False, type='path', ), diff --git a/plugins/modules/packaging/os/homebrew_cask.py b/plugins/modules/packaging/os/homebrew_cask.py index 2286d35564..feb1ba68fe 100644 --- a/plugins/modules/packaging/os/homebrew_cask.py +++ b/plugins/modules/packaging/os/homebrew_cask.py @@ -32,7 +32,7 @@ options: path: description: - "':' separated list of paths to search for 'brew' executable." - default: '/usr/local/bin' + default: '/usr/local/bin:/opt/homebrew/bin' type: path state: description: @@ -779,7 +779,7 @@ def main(): elements='str', ), path=dict( - default="/usr/local/bin", + default="/usr/local/bin:/opt/homebrew/bin", required=False, type='path', ), diff --git a/plugins/modules/packaging/os/homebrew_tap.py b/plugins/modules/packaging/os/homebrew_tap.py index 3fbf6b3394..d31da48523 100644 --- a/plugins/modules/packaging/os/homebrew_tap.py +++ b/plugins/modules/packaging/os/homebrew_tap.py @@ -218,7 +218,7 @@ def main(): brew_path = module.get_bin_path( 'brew', required=True, - opt_dirs=['/usr/local/bin'] + opt_dirs=['/usr/local/bin', '/opt/homebrew/bin'] ) taps = module.params['name']