O'Reilly logo

Mastering Chef by Mayank Joshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing environments

There are multiple ways to manage environments in Chef. They are described in the following subsections.

Using Knife

Knife can be used to create, edit, delete, show information about a particular environment, or list all available environments. It can be used to push the configuration concerned with an environment through a file containing code written using Ruby DSL and eventually this file can be maintained in the version control system.

Creating a new environment

The knife environment create ENVIRONMENT_NAME command can be used to create a new environment. Let's use it to create a new environment called production and see the command in action:

$ knife environment create production

As soon as you execute this command, an editor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required