How to install packages from source code with Puppet?

Solution 1:

After trying few dead-ends and from @Mike Renfro comments I came up with following steps (feel free to improve it):

  1. Don't install packages from source code with Puppet (it takes too long and brings too many problems)

  2. Always create binary packages. It can be easily redistributed and tested.

  3. Set up your own repository - for Debian a good choice is reprepro, documentation seems to be awful, but there's a Puppet module for installing: puppet-reprepro. Adding new package is quite easy:

    $ reprepro -Vb . includedeb squeeze ~/packages/my_package.deb

  4. Create new packages with fpm. The process of building a package is surprisingly simple and much easier than writing it in Puppet script.

  5. Install packages simply with:

    package { "leiningen": ensure => present }

  6. You can simply get packages which are still in testing version deploy it with your local repository.

  7. Use hiera for machine-specific configuration, in manifests should be only generally reusable templates for certain tasks (like web-server, db-server, etc.)