homebrew: Do not crash when package names include tap prefix. (#9803)

* homebrew:  Do not crash when package names include tap prefix.

Fixes #9777

* homebrew: PR #9803 minor update: removed trailing whitespace

* Update changelogs/fragments/9777-homebrew-fix-crash-when-packages-include-tap.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Apply suggestions from code review

Co-authored-by: Thibaut Decombe <68703331+UnknownPlatypus@users.noreply.github.com>

* Update plugins/modules/homebrew.py

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Thibaut Decombe <68703331+UnknownPlatypus@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
brad2014 2025-03-05 21:07:08 +01:00 committed by GitHub
commit c43289b8f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 5 deletions

View file

@ -95,3 +95,12 @@
- assert:
that:
- package_result is not changed
# This crashed on 4867eb4 - Ref: issue #9777
- name: Install cask using homelab/cask syntax
homebrew:
package: "homebrew/cask/{{ package_name }}"
state: present
update_homebrew: false
become: true
become_user: "{{ brew_stat.stat.pw_name }}"