Open cdayjr opened 3 years ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @Akasurde @danieljaouen @enriclluelles @indrajitr @kyleabenson @martinm82 click here for bot help
I'm seeing the same error's with Google Chrome
google_chrome.yml
---
- name: Install Google Chrome Packages through Homebrew
# https://formulae.brew.sh/cask/google-chrome
when: ansible_distribution == 'MacOSX'
homebrew:
name: google-chrome
state: present
Ansible output without chrome already installed
TASK [common : Install Google Chrome Packages through Homebrew] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Warning: No checksum defined for cask 'google-chrome', skipping verification."}
PLAY RECAP ************************************************************************************
localhost : ok=6 changed=0 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
Ansible output with chrome already installed
TASK [common : Install Google Chrome Packages through Homebrew] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Warning: Cask 'google-chrome' is already installed.\n\nTo re-install google-chrome, run:\n brew reinstall --cask google-chrome"}
PLAY RECAP ************************************************************************************
localhost : ok=6 changed=0 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
brew info google-chrome
==> google-chrome: 105.0.5195.125 (auto_updates)
https://www.google.com/chrome/
/opt/homebrew/Caskroom/google-chrome/105.0.5195.125 (61.7KB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/google-chrome.rb
==> Name
Google Chrome
==> Description
Web browser
==> Artifacts
Google Chrome.app (App)
==> Analytics
install: 18,368 (30 days), 55,474 (90 days), 288,587 (365 days)
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.
SUMMARY
I have a cask that does not have a checksum, so when you install or upgrade it, it emits the following message but continues successfully:
When running in ansible, the tasks gets marked as failed and only this is picked up for the error message. I believe the task failure is because of this https://github.com/ansible-collections/community.general/blob/3b9c6d496bbb5b24e1281c59025903fea7d4718e/plugins/modules/packaging/os/homebrew_cask.py#L697-L705 - the check if a cask has been upgraded will never return true for a greedy
latest
->latest
, but I'm not sure why the error message is that warning when it doesn't affect the command competing at all.ISSUE TYPE
COMPONENT NAME
homebrew_cask
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Just running this on localhost, here's my system info:
STEPS TO REPRODUCE
Here's the full manual update command + results:
However, when I run the following task in ansible (note the homebrew tap
homebrew/cask-versions
is already installed before we get to this point):Note, you can get the error without
greedy: true
if it's not already upgraded, but you can always reproduce it with the flag so I left it in there.EXPECTED RESULTS
The task being marked as
changed
as an upgrade happened, even if it still shows thatlatest
can be upgraded tolatest
. But if not, I just don't want that unrelated warning message sent back as the failure message.ACTUAL RESULTS
without verbosity:
with verbosity
-vvvv
: