Published on 12 December 2013 by

Our own Gary Larizza wrote another installment in his occasional series on types and providers. This time, he shows how to write a type and provider using Ruby, all in the spirit of making your Puppet code better:

I was working with a group who wanted to set a list of domains that would bypass their web proxy for a specific network interface on an OS X workstation. It sounds so simple, because it was. Due to the amount of time I had on-site, I wrote a class with some nasty exec statements, a couple of facts, and some conditional logic because that’s what you do when you’re in a hurry ... but it doesn’t make it right. When I left, I hacked up a type and provider, and it’s a GREAT example because you probably have a similar problem.

As with all his posts, plenty of code samples and some content that may be NSFW, if a little profanity about Puppet types and providers doesn't fly in your particular office.

Read the whole thing (or check out the kickoff entry if you missed it).

Learn More

Share via:
Posted in:

Add new comment

The content of this field is kept private and will not be shown publicly.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.