Skip to content

homebrew: state 'latest' fails when name is using brew full_name #9533

Closed
@krilor

Description

Summary

After upgrading to 10.2.0, running homebrew using full name of package (including tap) results in error.
Reverting to 10.1.0 makes it run (but the the task is reported as "changed" even tho it was already installed).

Issue Type

Bug Report

Component Name

homebrew

Ansible Version

ansible [core 2.18.1]
  config file = None
  configured module search path = ['/home/kristoffer.lorentsen/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/kristoffer.lorentsen/.local/share/pipx/venvs/ansible/lib/python3.12/site-packages/ansible
  ansible collection location = /home/kristoffer.lorentsen/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/kristoffer.lorentsen/.local/bin/ansible
  python version = 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0] (/home/kristoffer.lorentsen/.local/share/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

Collection        Version
----------------- -------
community.general 10.2.0

Configuration

No response

OS / Environment

No response

Steps to Reproduce

    - name: tap
      community.general.homebrew_tap:
        name: hashicorp/tap
    - name: install
      community.general.homebrew:
        name: hashicorp/tap/terraform
        state: latest

Expected Results

No error

Actual Results

MSG:

MODULE FAILURE: No start of json char found
See stdout/stderr for the exact error

STDERR:

Traceback (most recent call last):
  File \"/home/kristoffer.lorentsen/.ansible/tmp/ansible-tmp-1736146452.6762075-32468-172223293657172/AnsiballZ_homebrew.py\", line 107, in <module>
    _ansiballz_main()
  File \"/home/kristoffer.lorentsen/.ansible/tmp/ansible-tmp-1736146452.6762075-32468-172223293657172/AnsiballZ_homebrew.py\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/home/kristoffer.lorentsen/.ansible/tmp/ansible-tmp-1736146452.6762075-32468-172223293657172/AnsiballZ_homebrew.py\", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.homebrew', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.homebrew', _modlib_path=modlib_path),
  File \"<frozen runpy>\", line 226, in run_module
  File \"<frozen runpy>\", line 98, in _run_module_code
  File \"<frozen runpy>\", line 88, in _run_code
  File \"/tmp/ansible_community.general.homebrew_payload__5_knkt6/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 889, in <module>
  File \"/tmp/ansible_community.general.homebrew_payload__5_knkt6/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 874, in main
  File \"/tmp/ansible_community.general.homebrew_payload__5_knkt6/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 424, in run
  File \"/tmp/ansible_community.general.homebrew_payload__5_knkt6/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 447, in _run
  File \"/tmp/ansible_community.general.homebrew_payload__5_knkt6/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 413, in _get_packages_info
  File \"/tmp/ansible_community.general.homebrew_payload__5_knkt6/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 393, in _extract_package_name
KeyError: 'pop from an empty set'

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugcallbackcallback pluginpluginsplugin (any type)traceback

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions