homebrew: fix incorrect handling of aliases (#9255)

* Add failing test (See commit description)

Second assert returns this:

changed: [localhost] => changed=true
  changed_pkgs:
  - sqlite3
  msg: 'Changed: 1, Unchanged: 1'
  unchanged_pkgs:
  - sqlite

* Extract proper package_name from brew info using alisases

* Add changelog fragment

* Fix pep8

* Make sure sqlite is uninstalled beforehand

* Use `package_result is (not) changed` syntax in assertions

* Register more explicit names

* Fix handling of casks
This commit is contained in:
Thibaut Decombe 2024-12-20 22:53:41 +01:00 committed by GitHub
commit 9452a2c8ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 83 additions and 28 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- homebrew - fix incorrect handling of aliased homebrew modules when the alias is requested (https://github.com/ansible-collections/community.general/pull/9255, https://github.com/ansible-collections/community.general/issues/9240).