8. Puppet Forge modules
You should be using them.
How do you promote through environments?
Do you really want to manage them?
Git fork?
static copy?
pin to Git commit SHA? How?
9. Complexity
Custom Puppet modules - dev
Custom Puppet modules - test
Custom Puppet modules - production
Puppet Forge modules - dev
Puppet Forge modules - test
Puppet Forge modules - production
Hiera data - dev
Hiera data - test
Hiera data - production
???
10. Please tell me you’re not going to write some
bash / ssh / rsync / cron magic to do this...
11. r10k
Ruby gem
Written by Adrien Thebo
Does all the things
12. r10k
Two methods do everything:
sync Git repos/branches with directories
custom Puppetry - check
hieradata - check
environments - check
Puppetfile
Puppet Forge - check
13. r10k - Git
Environments = Git branches.
Git repo = a directory.
Git branches = directories under that.
14. r10k - Puppetfile
Puppetfile is like a Ruby gemfile.
Describes modules to install.
Good for Puppet Forge modules.
15. Configuration
In your Puppet modules repo
a branch for each environment
In each branch (environment)
Puppetfile describing Forge modules
environment.conf
manifests directory with site.pp
dist directory contains custom Puppet modules
16. ├──
│ └──
├──
├──
│ └──
└──
Git repo
Note: no modules directory!
Because r10k populates it on the server
according to what’s in the Puppetfile.
Put custom modules in dist.
20. Puppet workflow
Everything should live in git
Use pull requests (code review)
Use pre-commit hooks (syntax, style)
Test config changes in dev
Promote code changes
Start thinking like a developer
21. Other stuff
Masterless Puppet via Puppetfile
Jenkins build triggered by change in repo
Dynamic environments
23. Further reading
Adrien Thebo on creating r10k:
http://somethingsinistral.net/blog/rethinking-puppet-deployment/
Gary Larizza on doing r10k:
http://garylarizza.com/blog/2014/08/31/r10k-plus-directory-environments/
Configuring Directory Environments on the Puppet Master:
https://github.com/adrienthebo/r10k/blob/master/doc/dynamic-environments/master-configuration.mkd
https://docs.puppetlabs.com/puppet/latest/reference/environments_configuring.html
Puppetfile r10k:
https://github.com/adrienthebo/r10k/blob/master/doc/puppetfile.mkd