Ask Your Question

Testing Puppet code and deployment

asked 2017-06-12 04:39:46 -0500

I am new to puppet world.. Based on my project we have written manifests to configure Azure VM accordingly. But customer is expecting some testing tools for both Manifest and deployment. Any one used some testing tools like RSpec,puppetlint,etc... Please suggest me a good testing tool for puppet. Puppet parser will do the basic syntax check but I am looking for a tool which check all sort of tesing.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-12 08:14:28 -0500

DarylW gravatar image

There are several different ways that you can test your puppet modules, and at different layers..

The simplest you already mentioned, which is puppet parser That makes sure that the puppet code can be correctly parsed, a.k.a. that it is syntactically correct.

The next step up is using rspec-puppet to test the behavior of your code... This could either be done at the individual module level, or you could use it for more complex setups where, if you are using the 'roles and profiles' pattern, you could bring in all of your modules, the hiera data, and a pre-seeded collection of facts to test that all of the data you are filling into your modules will correctly prodouce the expected catalog to apply to your systems. This only tests what puppet says it should do, but doesn't test that everything actually works, for that, you need integration tests.

The standard tool for doing puppet integration tests right now is beaker ( ), That is a tool designed to allow you to spin up multiple VMS/Docker containers, have them run your puppet configurations, and see if they can actually do what you expect (does the version of the package actually exist in your package repos? Is the configuration that you set up in puppet correct, and does the service launch as you expect it to? etc...)

edit flag offensive delete link more

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: 2017-06-12 04:39:46 -0500

Seen: 20 times

Last updated: Jun 12