How are values from data bag JSON files accessed from ERB files in Chef templates.
I have a data bag file named chef-repo/data_bags/test.json
containing this data:
{
"id": "test",
"test": {
"name": "doel"
}
}
Within the chef-repo/cookcooks/test/templates/default.erb
I am seeing that <% @test.name %>
is accessed and is showing values accurately.
I'd like to understand where the instance variable @test
is assigned the value of the data bag within Chef.