Puppet Camp Atlanta 2014: r10k Puppet Workflow

Download Puppet Camp Atlanta 2014: r10k Puppet Workflow

Post on 07-Jul-2015

975 views

Category:

Software

0 download

Embed Size (px)

TRANSCRIPT

<ul><li> 1. r10k Puppet workflowwhat it is, and why you should be doing it</li></ul> <p> 2. Bob RaseyLinuxing for 15 yearsPuppeting for about 18 months 3. Puppet workflow?Config management is now code.Best practices for code meansversion controlcode reviewenvironmentsYoure doing this, right? 4. PuppetWhat is this version control?Modules live in directories.How to do environments?What about Puppet Forge modules?What about Hiera data? 5. HieraNo more hard-coded things! 6. HieraMore code!Lives in its own repository.Also, environments. 7. GitEnvironments - how?one repo per?environment = commit SHA?branches? 8. Puppet Forge modulesYou 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. ComplexityCustom Puppet modules - devCustom Puppet modules - testCustom Puppet modules - productionPuppet Forge modules - devPuppet Forge modules - testPuppet Forge modules - productionHiera data - devHiera data - testHiera data - production??? 10. Please tell me youre not going to write somebash / ssh / rsync / cron magic to do this... 11. r10kRuby gemWritten by Adrien TheboDoes all the things 12. r10kTwo methods do everything:sync Git repos/branches with directoriescustom Puppetry - checkhieradata - checkenvironments - checkPuppetfilePuppet Forge - check 13. r10k - GitEnvironments = Git branches.Git repo = a directory.Git branches = directories under that. 14. r10k - PuppetfilePuppetfile is like a Ruby gemfile.Describes modules to install.Good for Puppet Forge modules. 15. ConfigurationIn your Puppet modules repoa branch for each environmentIn each branch (environment)Puppetfile describing Forge modulesenvironment.confmanifests directory with site.ppdist directory contains custom Puppet modules 16. Git repoNote: no modules directory!Because r10k populates it on the serveraccording to whats in the Puppetfile.Put custom modules in dist. 17. ConfigurationOn the Puppet Master/etc/r10k.yaml/etc/puppet/puppet.conf edits 18. Puppet MasterContents of /etc/puppet/environments.albatross module deployed in testing, butnot production.puppetlabs-motd too. 19. ConfigurationOn the node/etc/puppet/puppet.confenvironment = testing 20. Puppet workflowEverything should live in gitUse pull requests (code review)Use pre-commit hooks (syntax, style)Test config changes in devPromote code changesStart thinking like a developer 21. Other stuffMasterless Puppet via PuppetfileJenkins build triggered by change in repoDynamic environments 22. Contactbrasey@gmail.com 23. Further readingAdrien 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.mkdhttps://docs.puppetlabs.com/puppet/latest/reference/environments_configuring.htmlPuppetfile r10k:https://github.com/adrienthebo/r10k/blob/master/doc/puppetfile.mkd </p>