Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homebrew_cask upgrade_all always returns changed #8707

Closed
1 task done
johnbyrneio opened this issue Aug 2, 2024 · 3 comments · Fixed by #8708
Closed
1 task done

homebrew_cask upgrade_all always returns changed #8707

johnbyrneio opened this issue Aug 2, 2024 · 3 comments · Fixed by #8708
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type)

Comments

@johnbyrneio
Copy link
Contributor

Summary

When setting upgrade_all: true on the homebrew_cask module, the task always returns 'changed'

The issue is here.

I'm not sure if the behavior changed when brew cask was deprecated, but brew upgrade --cask does not write anything to stdout if no packages are upgraded.

The homebrew module handles this by checking to see if stdout is blank. See here.

Issue Type

Bug Report

Component Name

homebrew_cask

Ansible Version

$ ansible --version
ansible [core 2.17.2]
  config file = /Users/john/.ansible/ansible.cfg
  configured module search path = ['/Users/john/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/john/.local/pipx/venvs/ansible-dev-tools/lib/python3.12/site-packages/ansible
  ansible collection location = /Users/john/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/john/.local/bin/ansible
  python version = 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] (/Users/john/.local/pipx/venvs/ansible-dev-tools/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /Users/john/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 9.2.0

Configuration

$ ansible-config dump --only-changed

OS / Environment

macOS Sonoma 14.6

Steps to Reproduce

- name: Upgrade Homebrew casks
  community.general.homebrew_cask:
    upgrade_all: true
    greedy: true

Expected Results

Task should not return changed if no packages are updated.

Actual Results

TASK [macos : Upgrade Homebrew casks] *****************************************************************************************************************************************************************************
changed: [localhost]

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Aug 2, 2024
@johnbyrneio
Copy link
Contributor Author

Submitted #8708 to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants