Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

run_list and env_run_list explanined in chef role

run-list
A run-list defines all of the information necessary for Chef to configure a node into the desired state. A run-list may include roles and/or recipes.

A run-list must be in one of the following formats: fully qualified, cookbook, or default. Both roles and recipes must be in quotes, for example:

[code]’role[NAME]’
‘recipe[COOKBOOK::RECIPE]’
‘recipe[COOKBOOK::RECIPE],COOKBOOK::RECIPE,role[NAME]'[/code]

env_run_list
When you specify the env_run_list in role and the chef-client will pick up the _default run-list if env_run_list[environment_name] is null or nonexistent. env_run_list is only for roles.The env run list is an override, so it totally replaces the default non-env run list if the env matches.

[code]{
“name”: “webserver”,
“default_attributes”: {
},
“json_class”: “Chef::Role”,
“env_run_lists”: {
“production”: [],
“preprod”: [],
“test”: [ “role[base]”, “recipe[apache]” “recipe[apache::copy_test_configs]” ],
“dev”: [ “role[base]”, “recipe[apache]”, “recipe[apache::copy_dev_configs]” ]
},
“run_list”: [ “role[base]”, “recipe[apache]” ],
“description”: “The webserver role”,
“chef_type”: “role”,
“override_attributes”: {
}
}[/code]

where:

  • “webserver” is the name of the role
  • “env_run_lists” is a hash of per-environment run-lists for production, preprod, test, and dev
  • “production” and “preprod” use the default run-list because they do not have a per-environment run-list
  • “run_list” defines the default run-list

Reference
https://docs.chef.io/run_lists.html
https://railsware.com/blog/2013/09/26/getting-started-with-chef-server-part-2/

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x