Building packages automatically from source
Packages aren't always available, or convenient to create, for the software you need to manage with Puppet. A source install (downloading the program source files and compiling them on the target machine) is sometimes the only way to get what you need.
If you have to build a program from source, Puppet can help with this process. The general procedure is to automate the following steps:
Download the source tarball
Unpack the tarball
Configure and build the program
Install the program
How to do itβ¦
In this example we'll build the popular load testing tool Httperf (there's no need to do this for production, as there's a distro package available in Ubuntu, but it's a pretty straightforward example of a source install):
Modify your
manifests/nodes.pp file
as follows:node 'cookbook' { exec { 'install-httperf': cwd => '/root', command => '/usr/bin/wget https://httperf.googlecode.com/files/httperf-0.9.0.tar.gz && /bin/tar xvzf httperf...