Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Cask task fails #9

Closed
anthonygreen opened this issue Jun 9, 2015 · 8 comments
Closed

Cask task fails #9

anthonygreen opened this issue Jun 9, 2015 · 8 comments

Comments

@anthonygreen
Copy link

TASK: [geerlingguy.homebrew | Get list of apps installed with cask.] ********** 
failed: [io] => {"changed": false, "cmd": "brew cask list", "failed": true, "rc": 2}
msg: [Errno 2] No such file or directory
@geerlingguy
Copy link
Owner

It seems this may be a problem with cask / the OS environment rather than this role (it's working for me on 10.10.3 and also on a fresh/clean VM running 10.10.2)... is there anything helpful in this upstream issue? Homebrew/homebrew-cask#4667

@geerlingguy
Copy link
Owner

Also, did you override the homebrew_taps variable in your own playbook?

It should at least have:

homebrew_taps:
  - caskroom/cask

@anthonygreen
Copy link
Author

The destination machine has OSX 10.10.2

The playbook is

- hosts: io
  roles:
  - { role: geerlingguy.homebrew }

sshing into the machine I can run brew cask tasks without issues

@anthonygreen
Copy link
Author

Getting the same error following an upgrade to 10.10.3

@anthonygreen
Copy link
Author

I'm encountering the same issue with a Vagrant OSX image

ESTABLISH CONNECTION FOR USER: vagrant
REMOTE_MODULE command brew cask list
EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/greena28/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 localhost /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1434016348.08-262225023919227 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1434016348.08-262225023919227 && echo $HOME/.ansible/tmp/ansible-tmp-1434016348.08-262225023919227'
PUT /var/folders/sm/vgbwtrps3yv2yl79n43t_f916ldxgl/T/tmpZeM1uc TO /Users/vagrant/.ansible/tmp/ansible-tmp-1434016348.08-262225023919227/command
EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/greena28/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 localhost /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /Users/vagrant/.ansible/tmp/ansible-tmp-1434016348.08-262225023919227/command; rm -rf /Users/vagrant/.ansible/tmp/ansible-tmp-1434016348.08-262225023919227/ >/dev/null 2>&1'

failed: [test] => {"changed": false, "cmd": "brew cask list", "failed": true, "rc": 2}
msg: [Errno 2] No such file or directory

FATAL: all hosts have already failed -- aborting

@anthonygreen
Copy link
Author

NB The ansible module for homebrew does work

- homebrew: name=brew-cask state=present

@fhickman
Copy link

fhickman commented Jul 8, 2015

I had this same problem. It looks like it is due to the 'command' module not finding 'brew' on whatever path it is using. If you change the command to '/usr/local/bin/brew cask list', it should work.

@geerlingguy
Copy link
Owner

Added new variable in commit above, so this role should be a bit more robust in situations where the $PATH doesn't include /usr/local/bin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants