Officially supported Opscode Homebrew provider


#1

There was talk before Chef 0.10 about adding a Homebrew package provider to Chef - it can be found in this ticket: http://tickets.opscode.com/browse/CHEF-1250

It seems that the introduction of the chef-homebrew cookbook (found here: https://github.com/mathie/chef-homebrew) was deemed the solution and this ticket was marked ‘fixed’.

Homebrew has grown in popularity quite a bit. I’d like to open the discussion back up again about potentially adding a Homebrew provider to Chef core. This doesn’t need to be the default provider for package on OSX as CHEF-1250 suggests.

Alternatively, if a Homebrew provider in Chef core isn’t what the community wants, maybe we should have an officially supported Homebrew LWRP in opscode-cookbooks. The chef-homebrew project on Github hasn’t been updated in quite some time and has a number of pristine pull requests waiting to be merged in. Some of them are pretty old, like this one from Seth https://github.com/mathie/chef-homebrew/pull/2.

I will perform the work either way we choose.

Thoughts?


Jamie Winsor
@resetexistence


#2

On Monday, April 2, 2012 at 10:59 PM, Jamie Winsor wrote:

There was talk before Chef 0.10 about adding a Homebrew package provider to Chef - it can be found in this ticket: http://tickets.opscode.com/browse/CHEF-1250

It seems that the introduction of the chef-homebrew cookbook (found here: https://github.com/mathie/chef-homebrew) was deemed the solution and this ticket was marked ‘fixed’.

Homebrew has grown in popularity quite a bit. I’d like to open the discussion back up again about potentially adding a Homebrew provider to Chef core. This doesn’t need to be the default provider for package on OSX as CHEF-1250 suggests.

Alternatively, if a Homebrew provider in Chef core isn’t what the community wants, maybe we should have an officially supported Homebrew LWRP in opscode-cookbooks. The chef-homebrew project on Github hasn’t been updated in quite some time and has a number of pristine pull requests waiting to be merged in. Some of them are pretty old, like this one from Seth https://github.com/mathie/chef-homebrew/pull/2.

I will perform the work either way we choose.

Thoughts?

Looks like there were just some issues with the patch that didn’t get ironed out. As long as the patch has tests and makes it easy to not install packages as root, I’d be happy to have it.

Changing defaults is always tough, since it could break people’s existing code and make it difficult for them to get security updates. But this just means that a point release is not the best time to do it; I could see making homebrew the default in Chef 0.11, and would be in favor doing so.


Dan DeLeo


Jamie Winsor
@resetexistence
https://github.com/reset


#3

On a related note, is there a good way to branch on package provider? I’d like to maintain MacPorts support, even if I’m the only one using it.


http://josephholsten.com

On Apr 3, 2012, at 5:59, Jamie Winsor jamie@vialstudios.com wrote:

There was talk before Chef 0.10 about adding a Homebrew package provider to Chef - it can be found in this ticket: http://tickets.opscode.com/browse/CHEF-1250

It seems that the introduction of the chef-homebrew cookbook (found here: https://github.com/mathie/chef-homebrew) was deemed the solution and this ticket was marked ‘fixed’.

Homebrew has grown in popularity quite a bit. I’d like to open the discussion back up again about potentially adding a Homebrew provider to Chef core. This doesn’t need to be the default provider for package on OSX as CHEF-1250 suggests.

Alternatively, if a Homebrew provider in Chef core isn’t what the community wants, maybe we should have an officially supported Homebrew LWRP in opscode-cookbooks. The chef-homebrew project on Github hasn’t been updated in quite some time and has a number of pristine pull requests waiting to be merged in. Some of them are pretty old, like this one from Seth https://github.com/mathie/chef-homebrew/pull/2.

I will perform the work either way we choose.

Thoughts?


Jamie Winsor
@resetexistence
https://github.com/reset


#4

You can set the default provider you want by hand in a recipe early in
the run list:
Chef::Platform.platforms[:mac_os_x][:default][:package] =
Chef::Provider::package::Macports

or use the resource directly:
macports_package “foo”

On Wed, Apr 4, 2012 at 4:53 PM, Joseph Holsten joseph@josephholsten.com wrote:

On a related note, is there a good way to branch on package provider? I’d
like to maintain MacPorts support, even if I’m the only one using it.


http://josephholsten.com

On Apr 3, 2012, at 5:59, Jamie Winsor jamie@vialstudios.com wrote:

There was talk before Chef 0.10 about adding a Homebrew package provider to
Chef - it can be found in this
ticket: http://tickets.opscode.com/browse/CHEF-1250

It seems that the introduction of the chef-homebrew cookbook (found
here: https://github.com/mathie/chef-homebrew) was deemed the solution and
this ticket was marked ‘fixed’.

Homebrew has grown in popularity quite a bit. I’d like to open the
discussion back up again about potentially adding a Homebrew provider to
Chef core. This doesn’t need to be the default provider for package on OSX
as CHEF-1250 suggests.

Alternatively, if a Homebrew provider in Chef core isn’t what the community
wants, maybe we should have an officially supported Homebrew LWRP in
opscode-cookbooks. The chef-homebrew project on Github hasn’t been updated
in quite some time and has a number of pristine pull requests waiting to be
merged in. Some of them are pretty old, like this one from
Seth https://github.com/mathie/chef-homebrew/pull/2.

I will perform the work either way we choose.

Thoughts?


Jamie Winsor
@resetexistence
https://github.com/reset


#5

Great for internal and one-off recipes, but I’m talking about writing a recipe that plays nice with both providers. For example, MacPorts and homebrew have different names for equivalent MySQL packages.

I essentially want to write:

case node.platform
when /mac_os_x/
case node.provider[:package]
when :homebrew

when :macports

end
when …
end


http://josephholsten.com

On Apr 4, 2012, at 14:27, Jesse Nelson spheromak@gmail.com wrote:

You can set the default provider you want by hand in a recipe early in
the run list:
Chef::Platform.platforms[:mac_os_x][:default][:package] =
Chef::Provider::package::Macports

or use the resource directly:
macports_package “foo”

On Wed, Apr 4, 2012 at 4:53 PM, Joseph Holsten joseph@josephholsten.com wrote:

On a related note, is there a good way to branch on package provider? I’d
like to maintain MacPorts support, even if I’m the only one using it.


http://josephholsten.com

On Apr 3, 2012, at 5:59, Jamie Winsor jamie@vialstudios.com wrote:

There was talk before Chef 0.10 about adding a Homebrew package provider to
Chef - it can be found in this
ticket: http://tickets.opscode.com/browse/CHEF-1250

It seems that the introduction of the chef-homebrew cookbook (found
here: https://github.com/mathie/chef-homebrew) was deemed the solution and
this ticket was marked ‘fixed’.

Homebrew has grown in popularity quite a bit. I’d like to open the
discussion back up again about potentially adding a Homebrew provider to
Chef core. This doesn’t need to be the default provider for package on OSX
as CHEF-1250 suggests.

Alternatively, if a Homebrew provider in Chef core isn’t what the community
wants, maybe we should have an officially supported Homebrew LWRP in
opscode-cookbooks. The chef-homebrew project on Github hasn’t been updated
in quite some time and has a number of pristine pull requests waiting to be
merged in. Some of them are pretty old, like this one from
Seth https://github.com/mathie/chef-homebrew/pull/2.

I will perform the work either way we choose.

Thoughts?


Jamie Winsor
@resetexistence
https://github.com/reset


#6

if node.platform == "mac_os_x"
case Chef::Platform.platforms[:mac_os_x][:default][:package]
when Chef::Provider::package::Macports

when Chef::Provider::Package::Homebrew
....

end
end

should get you there

On Wed, Apr 4, 2012 at 11:51 PM, Joseph Holsten
joseph@josephholsten.com wrote:

Great for internal and one-off recipes, but I’m talking about writing a recipe that plays nice with both providers. For example, MacPorts and homebrew have different names for equivalent MySQL packages.

I essentially want to write:

case node.platform
when /mac_os_x/
case node.provider[:package]
when :homebrew

when :macports

end
when …
end


http://josephholsten.com

On Apr 4, 2012, at 14:27, Jesse Nelson spheromak@gmail.com wrote:

You can set the default provider you want by hand in a recipe early in
the run list:
Chef::Platform.platforms[:mac_os_x][:default][:package] =
Chef::Provider::package::Macports

or use the resource directly:
macports_package “foo”

On Wed, Apr 4, 2012 at 4:53 PM, Joseph Holsten joseph@josephholsten.com wrote:

On a related note, is there a good way to branch on package provider? I’d
like to maintain MacPorts support, even if I’m the only one using it.


http://josephholsten.com

On Apr 3, 2012, at 5:59, Jamie Winsor jamie@vialstudios.com wrote:

There was talk before Chef 0.10 about adding a Homebrew package provider to
Chef - it can be found in this
ticket: http://tickets.opscode.com/browse/CHEF-1250

It seems that the introduction of the chef-homebrew cookbook (found
here: https://github.com/mathie/chef-homebrew) was deemed the solution and
this ticket was marked ‘fixed’.

Homebrew has grown in popularity quite a bit. I’d like to open the
discussion back up again about potentially adding a Homebrew provider to
Chef core. This doesn’t need to be the default provider for package on OSX
as CHEF-1250 suggests.

Alternatively, if a Homebrew provider in Chef core isn’t what the community
wants, maybe we should have an officially supported Homebrew LWRP in
opscode-cookbooks. The chef-homebrew project on Github hasn’t been updated
in quite some time and has a number of pristine pull requests waiting to be
merged in. Some of them are pretty old, like this one from
Seth https://github.com/mathie/chef-homebrew/pull/2.

I will perform the work either way we choose.

Thoughts?


Jamie Winsor
@resetexistence
https://github.com/reset