Ask Your Question

Understanding large config management (puppet/chef/ansible) git repos

asked 2016-05-02 22:33:11 -0500

thegripmaster gravatar image

This question is concerning methodology and approach in handling a git repo, especially related to configuration management like puppet/chef/ansible.

Imagine you take up a job as a "devops" engineer somewhere and you are given ownership of a large Puppet config management codebase which is in a git repo. The codebase maintains the whole infrastructure of the company. How would you go about understanding the codebase? (It is assumed you are well versed in Puppet)

Yes, I know you can set up vagrant and test the code there but the codebase could be huge with several hundred modules making it hard and time consuming. I could also work my way down by starting from the nodes -> roles -> profiles -> modules. Another way I would approach it would be going through the git log right from the very first commit.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-05-03 10:45:29 -0500

The answers are going to be personal; there's no right answer to this.

If me, I'll find one role that interests me, and figure out what it does. If it's huge, it's probably in your interest to focus on the bits where you already understand the technology being managed. If you're an expert in Nagios from a previous life, and there's a Nagios role, start there, understand how it works, see if you can guess why it does what it does, and yes, play with the tests that are there (Rspec-puppet, Beaker), and if there aren't any, what better way to learn the code than to write tests at the same time.

Now that's what I'll do, but others will no doubt approach the problem in other ways.

edit flag offensive delete link more


I second this approach, if no tests start with an rspec test of it { should compile } on every module and possibly a beaker test that just checks that the top level class exists. From there you start flushing out what parameters are needed, what interactions, etc..

DarylW gravatar imageDarylW ( 2016-05-04 22:24:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-05-02 22:33:11 -0500

Seen: 60 times

Last updated: May 03 '16