Using Puppet with Fabric

Fabric describes itself as a “library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks”. To get this work done, Fabric uses what are called “fabfiles’, which is just some python stored in a file called fabfile.py. In terms of execution, it works a lot like Rake from the Ruby world. You have a base command, in this case fab and each task is read from the fabfile.py and executed on request. Nothing too earth shattering. ...

2014-08-14 · zach

PkgNG on FreeBSD with Puppet

I’ve recently discovered FreeBSD’s new package manager and it looks poised to become the default package manager soon in FreeBSD 10. After watching the video from BSDCAN I realized that there was some pretty serious effort going into the project, but still a bit rough around the edges. Some wiki reading later, I was ready to dive in. More sources of information seem to be springing up about this new package manager, and though it does not solve all of the issues surrounding package management in FreeBSD such as custom options on your ports, it sure is a vast improvement from previous tools that are available for FreeBSD for my use cases. ...

2012-06-12 · zach

Generate Permutations of Puppet Resources

Here is a Puppet module that is a bit of a meta-module. Its only purpose is to create other resources by computing the permutations of parameters and generating new resources. The reason this is useful, is that it allows you to create lots of similar resources that might have some common and some unique parameters. Consider the following PXE example: permute { "Debian Installers": resource => 'pxe::installer', unique => { arch => ["amd64","i386"], ver => ["squeeze","wheezy"], os => "debian" }, common => { file => "os_<%= os %>", kernel => "images/<%= os %>/<%= ver %>/<%= arch %>/linux", append => "initrd=images/<%= os %>/<%= ver %>/<%= arch %>/initrd.gz text", }, } For every key in the unique parameter hash, a resource will be created for every combination of things. The keys in the common parameter hash will get passed through ERB before the resource is created. This allows you to do interesting things like the above that allow you to determine the values of the parameters before the resource is generated. ...

2012-05-12 · zach