Sample Puppet Deployment using r10k, dynamic environments and hiera to manage macs. No puppet master needed.
This example uses dayglojesus's 'managedmac' module: https://github.com/dayglojesus/managedmac which is well documented here. http://dayglojesus.github.io/managedmac/
The Hiera data is public here (with scrambled passwords etc): https://github.com/groob/hieradata_public
The environment repo is here: https://github.com/whitby/puppet-environment
# Step 1 install puppet, facter and hiera on a mac
# Step 2 install these gems
# r10k required to deploy the modules
# CFPropertyList and sqlite3 gems needed by the managedmac module
sudo /usr/bin/gem install r10k CFPropertyList sqlite3
# step 3 r10k will read the r10k.yaml config file and deploy the correct repositiories into /etc/puppet/
sudo r10k deploy environment -c ./r10k.yaml -pv
# hiera.yaml needs to be in the right place for puppet to read data from hiera.
sudo ln -s /etc/puppet/environments/production/hiera.yaml /etc/puppet/hiera.yaml
# use puppet apply
sudo /usr/bin/puppet apply -v --environment production --environmentpath=/etc/puppet/environments /etc/puppet/environments/production/manifests/site.pp --debug
- @glarizza's post on r10k, hiera, roles and profiles http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-1/
- r10k: https://github.com/adrienthebo/r10k
- @adrienthebo has some great blog posts on r10k and dynamic environments with puppet. http://somethingsinistral.net/
- Use Hiera to assign classes to nodes: http://docs.puppetlabs.com/hiera/1/puppet.html#assigning-classes-to-nodes-with-hiera-hierainclude
- Jordan Sissel has an example on how to run puppet in standalone mode with configuration applied entirely based on facts instead of assigning classes to nodes or using an ENC. https://github.com/jordansissel/puppet-examples/tree/master/nodeless-puppet/
In our environment I tag each machine with a custom fact like "role=teacher_laptop". hiera uses %{role} in it's hierarchy.
One note re: sqlite3 gem, needed to run
sudo xcodebuild -license
to have it properly build native extensions(I was avoiding installing GUI Xcode and accepting the EULA that way)