Chef variables

Chef is a powerful configuration management tool that turns infrastructure into code. With the help of Chef, Users can easily manage, configure and deploy the resources across the network from the central location of the environment (cloud, on-premises, or hybrid).

Working with Variables

Local variables can be defined inside recipes as regular Ruby local variables. The example below shows how to create a local variable

package  = "vim"

apt_package package do

 action :install

end

Local variables have a scope limitation so they can only be used within the file they are defined. To create a variable that is globally accessible by any of our cookbooks or recipe, we need to use a custom attribute.


Relevant Blogs:

chef adding nodes 

Testing cookbook with Test kitchen 

Manage linux package in puppet 

Zabbix Custom scripts

Recent Comments

No comments

Leave a Comment