Posts Tagged ‘tips’

All about IT Outsourcing: Are you ready? [Infographic]

Thursday, May 19th, 2016

Outsourcing your IT is a big decision and can have many consequences for your organization.  Therefore it is very important that you make sure you are ready for it, and that you go into business with the right company. That is why we created an Infographic to help you determine if IT Outsourcing is the right solution for you. Find out about the benefits of IT Outsourcing and the factors you need to consider when choosing an IT Outsourcing company.

Find out about Our Approach, Our Services or Our Solutions

Puppet on puppetmaster, some tips

Wednesday, January 26th, 2011

We often run a puppet on the puppetmaster which connects to the local puppetmaster. In the past, I’ve run into some problems, so I thought it best to write down a couple of tips to keep in mind when setting this up. These helped me out in the past:

  • Have a separate SSL dir for the puppetmaster and the client. The following snippet shows how to do that:
    ssldir = /var/lib/puppet/ssl
    ssldir = /var/lib/puppet-server/ssl
    ssldir = /var/lib/puppet-server/ssl

    The addition to puppetca is needed because it needs to know where to sign the certificates. Of course, if you run 2.6 or higher, you need to replace puppetd with agent, puppetmasterd with mast and puppetca with… ca I think.

  • Explicitely set the certname and the certdnsnames for the puppetmaster, as follows:
    certname = puppet
    certdnsnames =

That’s it. Hope it helps someone. You’re going to need to remove all old ssl dirs after you changed this and regenerate the certificates.

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

Tuesday, November 9th, 2010

A small example on how you can make apt-get update only run if a) the machine rebooted and b) something changed in /etc/apt. We use cron-apt to run an update every night, to keep the machine up-to-date, so this is really all we need. If you need to add a repository before you can install a package (say, you want to install a package from the Kumina Debian Repository), you can now do it in one puppet run, if you make sure your package resource depends on apt-get update. This is the code:

# Run apt-get update when anything beneath /etc/apt/ changes
exec { "apt-get update":
command => "/usr/bin/apt-get update",
onlyif => "/bin/sh -c '[ ! -f /var/cache/apt/pkgcache.bin ] || /usr/bin/find /etc/apt/* -cnewer /var/cache/apt/pkgcache.bin | /bin/grep . > /dev/null'",

Update aug 2 2011: Thanks to Enrique’s comment (see in the comments), we’ve made the script slightly prettier. Thanks Enrique!

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("<%= scope.lookupvar(mule) %>")

	notify { "Found interface $donkey":; }

do_this { $ifs:; }

This will output:

$ sudo puppet net.pp 
notice: Found interface
notice: //Do_this[eth0]/Notify[Found interface]/message: defined 'message' as 'Found interface'
notice: Found interface
notice: //Do_this[eth1]/Notify[Found interface]/message: defined 'message' as 'Found interface'

GlassFish 3.0.1’s pkg tool using Debian’s Python packages

Friday, July 23rd, 2010

While setting up GlassFish 3.0.1 for a customer on Debian Lenny using 64 bit machines, I ran into the problem that the update tool shipped with GlassFish (OpenSolaris‘s pkg tool) uses a Python interpreter which is part of the package. That Python interpreter however is 32 bit, which requires the ia32 libraries to be installed. Worse, it requires lididn in 32 bit, which is not part of the default Debian packages, so I had to get that one from the (very nice) Debian Multimedia repository. Although that’s a quick fix to get stuff working, we rather not use these repositories on production machines, due to security concerns and the like. Also, upgrades are easier if you only use the standard Debian repositories.

So I decided to see if I could get it working with the Debian supplied Python interpreter. One problem is that there’s a shared object file written in C which is part of the pkg application. That file is a 32 bit ELF too. So we’re going to download that source and recompile it for 64 bit. If you’re on a 32 bit system, you can skip that step (although it doesn’t hurt to do it anyway). First, we need to install the following packages: