hashicorp/puppet-bootstrap — pull request #7 by glarizza (2013-01-31 22:06:58+00:00)
Title: Make centos_6_x.sh idempotent

Previously, in the case where Puppet were already installed (whether you had
already booted the VM and were doing a `vagrant provision` again or whether
the box already had Puppet installed), the centos_6_x.sh provisioning script
would exit with a non-zero status:

```
package puppetlabs-release-6-6.noarch is already installed
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
```

This is coming from `rpm -i ${repo_path} >/dev/null` which is exiting non-zero.
Exiting non-zero prohibits any other provisioners from running, which requires
you to destroy and re-create the VM or comment out this line in order to run
`vagrant provision` again.

This commit adds a check for Puppet using `which puppet` and redirecting
output to /dev/null. If Puppet is already installed, that message is echoed
and the script exits zero.