Skip to content

homebrew module: task fails on warning message #7044

Closed
@Fregf

Description

Summary

Given this Ansible task:

- community.general.homebrew:
        name:
          - android-studio
          - clion
          - cyberduck
          - intellij-idea-ce
          - keka
          - vscodium
        state: latest

If one of the packages is already the latest version, execution is stopped and the tasks fails:

fatal: [host.example.org]: FAILED! => changed=false 
  msg: 'Warning: Not upgrading android-studio, the latest version is already installed'

I expect this to be a non-fatal warning, and that it continues running the playbook.

Issue Type

Bug Report

Component Name

homebrew

Ansible Version

$ ansible --version
ansible [core 2.14.3]
  config file = /home/frederik/ig-macos/ansible.cfg
  configured module search path = ['/home/frederik/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/frederik/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /home/frederik/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 3.6.0  

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 6.4.0  

Configuration

$ ansible-config dump --only-changed
ANSIBLE_NOCOWS(/home/frederik/ig-macos/ansible.cfg) = True
CONFIG_FILE() = /home/frederik/ig-macos/ansible.cfg
DEFAULT_FORKS(/home/frederik/ig-macos/ansible.cfg) = 16
DEFAULT_HOST_LIST(/home/frederik/ig-macos/ansible.cfg) = ['/home/frederik/ig-macos/inventory']
DEFAULT_LOG_PATH(/home/frederik/ig-macos/ansible.cfg) = /home/frederik/ig-macos/ansible.log
DEFAULT_ROLES_PATH(/home/frederik/ig-macos/ansible.cfg) = ['/home/frederik/ig-macos/roles', '/etc/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/home/frederik/ig-macos/ansible.cfg) = yaml
DEFAULT_STRATEGY(/home/frederik/ig-macos/ansible.cfg) = free
DEFAULT_TIMEOUT(/home/frederik/ig-macos/ansible.cfg) = 60

OS / Environment

Debian 12

Steps to Reproduce

- community.general.homebrew:
        name:
          - android-studio
          - clion
          - cyberduck
          - intellij-idea-ce
          - keka
          - vscodium
        state: latest

Expected Results

When one of the packages is already up to date, it continues upgrading the other packages and this tasks succeeds.

Actual Results

fatal: [host.example.org]: FAILED! => changed=false 
  msg: 'Warning: Not upgrading android-studio, the latest version is already installed'

Execution stops at this point.

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 pluginhas_prmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions