Search code examples
jenkinsgitlabpuppetpuppet-enterprise

validating puppet in jenkins


I would like to run puppet-parser-validate, and puppet-lint on my existing puppet orchestration. We will be creating a Jenkins job which is triggered by a gitlab push. The project structure is as follows:

puppet
--certs
--environments
----beta0-10
----production
----staging
--json
--manifests
--modules
----builds
----master
----node
--scripts

I don't know where to include testing files to run puppet-pareser-validate/puppet-lint against anything that ends with .pp ('*.pp').

We are utilizing a Jenkins server.

https://ask.puppet.com/question/6568/puppet-jenkins-integration/

^^ This currently exists, and I have noted, but where does it run?


Solution

  • You can do it with help of systems such as Rake. Rake is sophisticated test runner written in Ruby and is a standard way of running test.

    You can see example of Rake files when you generate new Puppet module with puppet module generate companyname-modulename command. In root directory of your project you will find Rakefile where you will see default configuration. In default configuration you can see that validation task is already done and ready to use. Just make sure that paths are ok.

    To run validation task you need to make sure that gems mentionded in Gemfile are installed. You can do it with bundle install. To run validation task just run bundle exec rake validate.