In Config management, and in Puppet there are several ways to complete your tasks, in this post I will list a set of tools which will make your puppet setup more organized.
In the early days of Puppet there were a lack of standards and deployment routines, people used the manifestsdir and modules amongst each other, the code were stored in a single svn or git repository. Although this would work – keeping modules up to date were hard.
Say hi to [r10k] (https://web.archive.org/web/20161014040209/https://github.com/acidprime/r10k)
r10k in my opinion is the greatest community contribution to puppet so far, it allows you to easily manage your environments and have separate repositories for your modules.
The major advantages are:
– You will be able to update modules
– Share modules on both github, the forge and between puppet deployments’
– Test modules in different environments
Say hi to puppet-Jenkins
When we have all our modules seperated in different git repositories we can make jenkins syntax check the code, create sweet graphs, generate documentation(!) and run rspec tests of our manifests.
Say hi to rspec
As our code base grows, and modules are dependant on other modules, the case of testing our code becomes more and more important, this is not only related to Puppet code, this is relevant to other languages as well. To get you started on rspec, [go to this great blog posting] (https://web.archive.org/web/20141021211102/http://spredzy.wordpress.com/2013/04/02/create-puppet-modules-with-solid-foundations/)
Say hi to puppet-lint
[Puppet-lint] (https://puppet-lint.com) is a great way to help you follow standards in the syntax of the language, which will help others to more easily read your code. Here is an example where I call a lint test from rspec.
Say hi to documentation
Documentation will help you and your co-workers if you have to take a look at an old module which you do not remember exactly what did, or if its a new module and others are looking in to what this module may do. With Jenkins we can generate HTML documentation from the rdoc.
How to document…is [documented here] (https://web.archive.org/web/20161014040209/http://docs.puppetlabs.com/guides/style_guide.html#puppet-doc)comments powered by Disqus