There are situations where you have data, which you do neither want to hard code in your recipes nor store as attributes in your cookbooks. Users, external servers, or database connections are examples of such data. Chef offers the so called data bags to manage arbitrary collections of data, which you can use with your cookbooks.
Let's see how we can create and use a data bag and its data bag items.
In the following example, we want to send HTTP requests. To be able to follow along with the example, you'll need an HTTP end point.
One way to establish an HTTP end point is to just run
nc –l 80 on any server accessible by your node and use its IP address below.
Another way to establish an HTTP end point, which shows us the ...