Problems with Current Approach of Developing Cookbooks
- Every time a correction is made to the cookbook, version is changed and new version is uploaded to chef server
- This leads to incorrect cookbooks for some versions.
- Solution is to upload only stable cookbook versions to chef server.
- The Answer to solve this is Test Kitchen.
Test Kitchen
-
This is testing environment for chef cookbook development.
-
Workflow
- Develop Cookbook
- Test cookbook
- Uplod cookbook to chef server
-
Test Kitchen has drivers. Driver is the virtual environment where the servers are created. Driver Examples are
- AWS
- Azure
- Docker
- Vagrant
-
In Test Kitchen,
- a test vm gets created using the driver configure.
- In this Test VM Chef Zero/Chef solo (Chef server and chef node on same machine)
- Run list gets executed and logs, results are shared.
-
Whenever you create a cookbook, kitchen.yml file is created. This is the configuration file for test kitchen.
-
In kitchen.yml file the default configuration will be using driver vagrant.
Test Kitchen Setup for AWS Test Environments
- To configure Test Kitchen for AWS Refer Here