If you have some commands that you want to run before everything else, it can be annoying to add a require statement to every resource (as Puppet doesn’t execute things in order). Luckily you can get around this using stages. stage { ‘preinstall’: before => Stage[‘main’] } class apt_get_update { file { ‘/etc/apt/sources.list’: ensure => […]
Puppet
Puppet Tip: Set global exec path
Here’s a quick tip you might not know about. In Puppet, you can set a global path option for all Exec resources. This saves you from having to prefix all of your commands with the absolute path. Just throw this at the top of your file: Exec { path => [‘/usr/sbin’, ‘/usr/bin’, ‘/sbin’, ‘/bin’] } […]
Don’t use symlinks in Vagrant for config files
I’ve been building a lot of Vagrant machines lately, and I’m learning a few things to make the process easier/optimal. One of the things I recently discovered was that you should avoid using symlinks for your config files, if you’re using a provisioner like Puppet. I had gotten into the habit of just symlinking config […]