hashicorp/puppet-bootstrap — pull request #21 by danieldreier (2014-01-02 22:08:58+00:00)
Title: Unified multi-distro puppet installer

This is a single script that installs puppet on multiple linux distros, and a vagrantfile to simplify testing. No hard feelings if you don't want to go in this direction. The script is currently tested on centos 6.4, centos 6.5, ubuntu 12.04, debian 6 and 7, and the latest arch.

There are a number of improvements over the current scripts:
- Success messages are actually based on tests of whether puppet and facter are installed, not simply echo statements at the end of the script
- Script is idempotent, composed of idempotent functions
- Dependencies are handled via native package management
- Relatively simple to extend to other distributions
- Cleans up downloaded files when finished with them
- Tests for absence of things before installing them, so it runs very quickly if puppet is already installed
- Can identify debian distro codename even if lsb_release is not installed

I realize this is quite a bit larger and has a lot more moving parts than the existing scripts, so no hard feelings if you don't want to use this. I wrote it because I have several multi-distro puppet manifests that I need to test frequently and it's nice to be able to reduce the number of places where I re-implement distro detection logic.

The vagrantfile simply kicks off the installer as a simple form of testing. Since the script exits with an error if puppet isn't detected at the end of the install, you can just run a "vagrant up" and come back a few minutes later to see if any of the distros errored out. Not the must robust testing but an improvement.