Posts Tagged ‘puppet-tips-and-tricks’

Puppet Tips&Tricks: Running apt-get update only when needed

Tuesday, November 9th, 2010

How to only run apt-get update from puppet if it’s necessary.

More...

Puppet Tips&Tricks: Variable variables

Wednesday, September 1st, 2010

Sometimes you want to use variable variables, for instance when you want to iterate over all the ipaddress_* facts that facter found. Using something like ${ipaddress_$if} doesn’t work, though. Inline_template to the rescue! Thanks to Volcane on IRC, this is a possible solution: $ifs = split($interfaces,”,”) define do_this { $mule = “ipaddress_${name}” $donkey = inline_template(“<%= […]

More...

WordPress MU and /etc/hosts file

Monday, July 12th, 2010

Sometimes you need to hack up some code to work around some network problems. Sometimes you’re not very proud of it, but you want to share your solution nonetheless. This is one of those ugly solutions…

More...

Puppet Tips&Tricks: checking if a value is present in an array

Thursday, June 17th, 2010

Although it’s going to be easier in puppet 2.6, this helps you if you want to check if a certain value is present in a puppet array and perform actions based on that.

More...

Puppet Tips&Tricks: testing your regsubst replacings

Monday, March 15th, 2010

How to test the regex you built for your regsubst invocation. In IRB.

More...

Puppet Tips&Tricks: Converting booleans to numbers

Monday, March 8th, 2010

A ruby function to be used with puppet for converting boolean values to numerical values. Useful for nagios, for example.

More...

Puppet Tips&Tricks: Getting the version from a package

Monday, March 1st, 2010

Creating a fact which contains the installed version of a package.

More...

Puppet Tips&Tricks: debugging includes and inheritance

Monday, February 22nd, 2010

Some tips on simple debugging puppet manifests or modules.

More...