Book Image

Mastering Chef Provisioning

By : Earl Waud
Book Image

Mastering Chef Provisioning

By: Earl Waud

Overview of this book

This book will show you the best practices to describe your entire infrastructure as code. With the help of this book you can expand your knowledge of Chef because and implement robust and scalable automation solutions. You can automate and document every aspect of your network, from the hardware to software, middleware, and all your containers. You will become familiar with the Chef’s Chef Provisioning tool. You will be able to make a perfect model system where everything is represented as code beneath your fingertips. Make the best possible use of your resources, and deliver infrastructure as code, making it as versionable, testable and repeatable as application software
Table of Contents (17 chapters)
Mastering Chef Provisioning
Credits
Foreword
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Integration testing with Kitchen and ServerSpec


Now we are going to move to the cookbooks-as-artifacts model of testing. This is full integration testing, and we are going to look to the Test Kitchen framework as the tool for this type of test. Kitchen is another tool that is included as part of the installation of ChefDK, so there is no additional work to install it. Kitchen allows you to easily deploy a new system, install Chef, download the run-list cookbooks, and converge the node instance to fully test the functionality of our policies, roles, cookbooks, and so on.

To explore using Test Kitchen, let's imagine that we want to create a cookbook that will set up a web server to present our new application's website to users. The best way to approach this from a test-driven development aspect is to consider the desired results from the user's point of view. The user does not care that we have a web server installed and running; they only care about getting an appropriate response from our...