Closed simmel closed 9 years ago
What version of Chef are you using? What version of the homebrew cookbook?
In Chef 12, homebrew's package provider is the default for OS X. Can you try with Chef 12? The implementation of the upgrade action is different.
https://github.com/opscode/chef/blob/master/lib/chef/provider/package/homebrew.rb#L52-L60
This is fixed in #55.
"fixed" in that it isn't a problem using the homebrew provider in Chef 12.
(for the history: me and @jtimberman talked and resolved the issue on/over IRC. I'm just lagging to reply to this issue and close it. Thanks!)
According to http://docs.getchef.com/resource_homebrew_package.html#actions
package 'mysql' action :upgrade end
should install the package if it isn't installed, but this is not the case:Maybe running and parsing
brew info --json=v1 mtr
before installing or upgrading would be a solution? Then we could get rid of the whole stacktrace and the need to useignore_failure true
because we're installing applications which is already installed.If the 'installed' array is empty it's not installed:
and if it's not empty it lists the version installed: