kitchen-puppet-example for testing puppet using test kitchen and Inspec.
This demonstration sets up an SSH server on a Vagrant instance running on your local machine.
- Have ruby installed, you'll need that - see the main README for RVM instructions.
- Have vagrant installed and in the PATH.
- Have virtualbox installed.
- Run the following commands:
gem install bundler
bundle
bundle exec kitchen list
This will return a list of the instances you can test on using test-kitchen if everything is correctly installed. You can use test-kitchen to create an instance, converge it with puppet, and test that puppet configured the instance properly using Inspec:
bundle exec kitchen create default-ubuntu-1604
bundle exec kitchen converge default-ubuntu-1604
bundle exec kitchen verify default-ubuntu-1604
The kitchen test
command does this all, then destroys the instance:
bundle exec kitchen test default-ubuntu-1604
This uses https://github.com/chef/inspec/tree/master/examples/kitchen-puppet mostly unmodified (once inspec/inspec#2972 gets merged)