Skip to content

Homebrew module incorrectly fails executing task when package is already installed #864

Closed
@mpereira

Description

@mpereira
SUMMARY
- name: Install wkhtmltopdf
  homebrew:
    name: homebrew/cask/wkhtmltopdf 
    state: present

results in

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [Install wkhtmltopdf] *****************************************************
fatal: [localhost]: FAILED! => changed=false 
  msg: |-
    Updating Homebrew...
    Warning: Cask 'wkhtmltopdf' is already installed.
  
    To re-install wkhtmltopdf, run:
      brew cask reinstall wkhtmltopdf

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
ISSUE TYPE
  • Bug Report
COMPONENT NAME

Homebrew module

ANSIBLE VERSION
$ ansible --version
ansible 2.9.13
  config file = /Users/mpereira/git/macbook-playbook/ansible.cfg
  configured module search path = ['/Users/mpereira/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/mpereira/Library/Python/3.8/lib/python/site-packages/ansible
  executable location = /Users/mpereira/Library/Python/3.8/bin/ansible
  python version = 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) [Clang 6.0 (clang-600.0.57)]
CONFIGURATION
$ ansible-config dump --only-changed
DEFAULT_STDOUT_CALLBACK(/Users/mpereira/git/macbook-playbook/ansible.cfg) = yaml
OS / ENVIRONMENT
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.5
BuildVersion:	19F101
STEPS TO REPRODUCE

Refer to summary.

EXPECTED RESULTS

I expect the task to complete successfully when a package is already installed and a homebrew task is executed with either state: present or state: latest.

ACTUAL RESULTS

The task fails, as shown in the summary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions