Chapter 5. Manage Sandbox Environments with Test Kitchen

For the rest of this book, we’re going to want to deploy to sandbox environments that closely simulate a production environment. Running Chef on your local development workstation, like we did in Chapter 4, is not the best approach. Your development workstation probably doesn’t match your production operating environment. Even if your development workstation does match your production environment, you probably don’t want to take the risk of running untested Chef code locally. Untested Chef code might make unintended configuration changes to your local development environment. Neither is it a good idea to run your experimental Chef code in your production environment before it is validated, for similar reasons.

We’ll use Test Kitchen to create a sandbox environment that simulates a production environment. Test Kitchen works in concert with two other tools, Vagrant and VirtualBox, to produce a sandbox locally in a virtual machine. This sandbox environment is a safe, isolated place in which to experiment with Chef.

The CentOS 6 operating system will be used in our sandbox environment. CentOS is a free operating system compatible with RedHat Enterprise Linux. RedHat Enterprise Linux is a popular choice for a production environment. CentOS is a compatible variant of RedHat intended for open source projects. CentOS does not require the purchase of a commercial license for use. The skills you will learn in this book aren’t ...

Get Learning Chef now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.