1.

Why are the environments used in Chef?

Answer»

Setting up environments is an important part of infrastructure management. We know that for the successful development of any product we need different environments like a development environment, testing environment, production environment, etc. The concept of environments in Chef is the extrapolation of the same. We at times want our Chef nodes to CONVERGE to a testing environment or a production environment configurations. Hence we can have a particular configuration for a testing environment and different configuration for the production environment. This switching of node behaviour is achieved through Chef environment settings. Environments help administrators to easily identify the stage where the particular node is a part of.

If we don’t declare any environments the Chef assumes the nodes to be in “_default” environment. MINIMUM one environment exists in an organisation. Environment attributes have higher precedence than default attributes of a node. Environment data COULD be stored in Ruby format or JSON format. An environment could be created as follows:

  • Using Chef Management console at Chef Server
  • Using the KNIFE tool
  • Creating a ruby file in an environments subfolder of chef-repo
  • Creating a JSON file in chef-repo
  • Using Chef INFRA Server REST API


Discussion

No Comment Found