Over a million developers have joined DZone.

Puppet Homebrew Package Provider

· Agile Zone

Learn more about how DevOps teams must adopt a more agile development process, working in parallel instead of waiting on other teams to finish their components or for resources to become available, brought to you in partnership with CA Technologies.

I've become a big fan of homebrew package system on Macosx. I moved away from macports because it allows me to easily change the way packages are compiled: sometimes I need experimental versions of software or versions that are not in macports yet. Instead of compiling them in a separate place, I can now create my own formulas and still use the repository in case I need it: this is made possible because it's all based on git and allows you to merge your changes even if upstream packages get updated.


Enough raving about homebrew now. I'm currently exploring Puppet , it has builtin support for macports (or as it calls it darwinports) but not for my new love. I guess it was the perfect excuse to write my own provider.

On the puppet wiki I found a document describing in generic terms what you need to do to write a custom provider. It's probably me, but I didn't get it when I read. Therefore I dug into the code of other providers. I found the gem provider most useful, but that's probably because I'm familiar with the gem command and output to see how it works.

It will only work in new versions of puppet as it uses the new directory structure lib/puppet instead of lib/plugins. There was one gotcha for me. I assumed that I needed to put my provider, well in the directory modulename/puppet/provider/ . It turns out that you need to put it in a subdirectory of the type your are implementing the provider for : module/puppet/provider/package in my case.

Code is up on github : https://github.com/jedi4ever/puppet-homebrew .

I hope one day, this provider gets into the main puppet provider list :)


Discover the warning signs of DevOps Dysfunction and learn how to get back on the right track, brought to you in partnership with CA Technologies.


Published at DZone with permission of Patrick Debois, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}