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:
Testing cookbook with Test kitchen
Recent Comments
No comments
Leave a Comment
We will be happy to hear what you think about this post