Puppet Puppet is an open source (with enterprise version and support available) client/server tool from Puppet Labs to facilitate the configuration and management of computer systems. Written in ruby and available on many platforms, it offers a DSL that allows the "programming" of operational tasks across many. Name Last modified Size Description; Parent Directory - 10.10/ 2015-09-14 11:50:58: 4.0KiB.
Puppet is an open source (with enterprise version and support available) client/server tool from Puppet Labs to facilitate the configuration and management of computer systems.
Written in ruby and available on many platforms, it offers a DSL that allows the 'programming' of operational tasks across many machines.
The DSL covers abstracting the computer resources in a extensible way, and providing structure like class, modules and graphs that a configuration language can manipulate.
The server is called puppet master. It controls a puppet agent installed on client machines that are to be managed. In addition of master and agent, there are puppet apply for stand alone use and puppet resource for accessing the Puppet resource abstraction layer.
Its extensibility makes it future proof and there are providers (implements a resource abstraction in Puppet) for many platforms like Virtual box VMs and Amazon EC2.
The communication between clients and server is secured using SSL certificates.
This post is mainly for me so I can remember how I did install Puppet on Mac OS X and to allow me to repeat it on many mac systems.
The install basically boils down to running a script I put on Gist (assuming you want to install Puppet 2.7.11 with Facter 1.6.6 on a startup disk called Macintosh HD):
The remainder of the post describes the gory details. I'll keep this post updated as I learn more about the idiosyncrasies of Puppet on Mac.
I've tested these instructions on Mac OS X Lion (10.7.3) and Mac OS X Snow Leopard (10.6.8).
For Mac OS X, there is a .pkg available for Facter and Puppet downlable from Puppet Lab web site:
There are several versions available on that site.
For the purpose of this post, we will consider version 1.6.6 and 2.7.11 for Facter and Puppet respectively.
Puppet depends on Facter, so you need both. These are Mac OS X package on the site above.
There is another blog post [1] describing a way to install Puppet from source but the source links didn't work for me when I tried.
Unpack the dmg
Install the pkg
Create the puppet group and user
In other systems, the packaging may include the creation of the necessary puppet user and group.
The packages for Mac OS X don't do that. Although it's possible to create these when starting the puppet master with the --mkusers options, I prefer create then before hand during installation.
Create directories
Change permission on directories
Create puppet.conf
There are several sections, each relevant only to different puppet subcommands except for [main] which is global.
If puppet is running on a client ensure the server property is set to the machine running puppet master instead of local hostname as here.
Putting it all together
As I needed to install Puppet on more than one mac, I've made a script, inspired by trevmex's tutorial [1], with all the steps together:
(Some of the steps uses sudo, so login password will be asked)
In the example above I've passed the version of Facter, the version of Puppet and my system disk as parameter to the script.
Create a hello world puppet class
Create the file /etc/puppet/manifests/site.pp with the following content:
Create the file /etc/puppet/manifests/nodes.pp with the following content:
Run the example:
you should see something like:
Testing on the same computer
Run the puppet master
You should see something like:
Run the puppet agent in a separate shell by typing:
You should see something like:
Between computers (or virtual machines)
install Puppet using the shell script above.
If you run the agent as above, you'll get this error:
on the server, ensure puppet master is running, then
![Puppet Puppet](/uploads/1/2/8/3/128353724/197850698.jpg)
on the client machine, ensure puppet.conf has the server property set to the hostname of the server (or use --server in the command below) and do:
sudo puppet agent –waitforcert 60 –test --debug --no-daemonize
then on the server, on the a different shell than the on running puppet master, do:
until the command above is run on the server, the client will output the following message:
Then when the command to issue a certificate is run on the server, the server will output:
and the client will output:
Revoking a client's privilege to connect to the Puppet master
the client certificate's name is the lowercase hostname
To revoke a client's certificate and thus deny it's connection attempts, it's a two steps process.
First on the server, revoke the certificates:
Then on the client, remove the certificates:
In some circumstances, you will need to use the following command to completely remove the client certificate from the master:
Ruby errors:
If you encounter one of the following errors:
it's probably because you've got rvm installed.
You can make the problem go away by using system ruby:
Puppet6/
I'm not happy about that solution, but I haven't find a better way so far.
Error about plugins when running the puppet agent:
If you see this error in the agent log:
The puppet master log would correspondingly display this:
ensure you've set pluginsync to false in the puppet.conf: pluginsync = false
Certificates errors:
so far, I solved them by deleting the /etc/puppet/ssl directory on client and master
- use --debug and --verbose options to puppet commands
- use --configprint to dump the value of a config property. E.g: puppet apply --configprint modulepath
- use the notify keyword in your classes to print custom debug information
- check the documentation
Puppet5/
[1] http://trevmex.com/post/850520511/bootstrapping-puppet-on-mac-os-x
Language guide: http://docs.puppetlabs.com/guides/language_guide.html
Modules and classes: http://docs.puppetlabs.com/learning/modules1.html
Core Types Cheat sheet: http://docs.puppetlabs.com/puppet_core_types_cheatsheet.pdf
install_puppet_mac.sh
#!/usr/bin/env bash |
set -o errtrace |
set -o errexit |
facter_version=$1 |
puppet_version=$2 |
target_volume=$3 |
echo'About to install Facter $facter_version and Puppet $puppet_version on target volume $target_volume' |
start_date=$(date '+%Y-%m-%d%:%H:%M:%S') |
echo'mkdir /private/tmp/$start_date ; cd /private/tmp/$start_date' |
mkdir /private/tmp/$start_date;cd /private/tmp/$start_date |
echo'curl -O http://downloads.puppetlabs.com/mac/facter-$facter_version.dmg' |
curl -O http://downloads.puppetlabs.com/mac/facter-$facter_version.dmg |
echo'curl -O http://downloads.puppetlabs.com/mac/puppet-$puppet_version.dmg' |
curl -O http://downloads.puppetlabs.com/mac/puppet-$puppet_version.dmg |
echo'hdiutil attach facter-$facter_version.dmg' |
hdiutil attach facter-$facter_version.dmg |
echo'hdiutil attach puppet-$puppet_version.dmg' |
hdiutil attach puppet-$puppet_version.dmg |
echo'sudo installer -package /Volumes/facter-$facter_version/facter-$facter_version.pkg -target $target_volume' |
sudo installer -package /Volumes/facter-$facter_version/facter-$facter_version.pkg -target '$target_volume' |
echo'sudo installer -package /Volumes/puppet-$puppet_version/puppet-$puppet_version.pkg -target $target_volume' |
sudo installer -package /Volumes/puppet-$puppet_version/puppet-$puppet_version.pkg -target '$target_volume' |
echo'Creating directories in /var and /etc - needs sudo' |
sudo mkdir -p /var/lib/puppet |
sudo mkdir -p /etc/puppet/manifests |
sudo mkdir -p /etc/puppet/ssl |
if [ $(dscl . -list /Groups | grep puppet | wc -l)= 0 ];then |
echo'Creating a puppet group - needs sudo' |
max_gid=$(dscl . -list /Groups gid | awk '{print $2}'| sort -ug | tail -1) |
new_gid=$((max_gid+1)) |
sudo dscl . create /Groups/puppet |
sudo dscl . create /Groups/puppet gid $new_gid |
fi |
if [ $(dscl . -list /Users | grep puppet | wc -l)= 0 ];then |
echo'Creating a puppet user - needs sudo' |
max_uid=$(dscl . -list /Users UniqueID | awk '{print $2}'| sort -ug | tail -1) |
new_uid=$((max_uid+1)) |
sudo dscl . create /Users/puppet |
sudo dscl . create /Users/puppet UniqueID $new_uid |
sudo dscl . -create /Users/puppet PrimaryGroupID $new_gid |
fi |
echo'Creating /etc/puppet/puppet.conf - needs sudo' |
sudo sh -c 'echo '[main] |
pluginsync = false |
server = `hostname` |
[master] |
vardir = /var/lib/puppet |
libdir = $vardir/lib |
ssldir = /etc/puppet/ssl |
certname = `hostname` |
[agent] |
vardir = /var/lib/puppet |
libdir = $vardir/lib |
ssldir = /etc/puppet/ssl |
certname = `hostname` |
' > /etc/puppet/puppet.conf' |
echo'Changing permissions - needs sudo' |
sudo chown -R puppet:puppet /var/lib/puppet |
sudo chown -R puppet:puppet /etc/puppet |
echo'Cleaning up' |
hdiutil detach /Volumes/facter-$facter_version |
hdiutil detach /Volumes/puppet-$puppet_version |
cd /private/tmp |
rm -rf ./$start_date |
Shadow Puppet Edu On The App Store
commented Jan 9, 2013
You'll want to escape the $vardir variable (eg $vardir) or you'll end up with vardir = /lib in your puppet.conf |
commented Feb 9, 2013
For people wanting a hassle free installation without delving into too much details just follow http://docs.puppetlabs.com/guides/installation.html#mac-os-x |
Hello Puppets Download
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment