Managing Data bags in different environments
https://www.digitalocean.com/community/tutorials/how-to-use-roles-and-environments-in-chef-to-control-server-configurations


  For instance, if a node is in the "production" environment, you could
  want to run a special recipe in your "nginx" cookbook to bring that
  server up to production policy requirements. You could also have a
  recipe in the nginx cookbook meant to configure special changes for
  testing servers.


Example


name "web_server"
description "A role to configure our front-line web servers"
run_list "recipe[apt]", "recipe[nginx]"
env_run_lists "production" =&gt; ["recipe[nginx::config_prod]"], "testing" =&gt; ["recipe[nginx::config_test]"]