What is the significance of the default directory under chef cookbook /templates?
A cookbook is frequently designed to work across many platforms and is often required to distribute a specific template to a specific platform. This is a New in Chef Client 12.0. A cookbook can be designed to support the distribution of templates across platforms, while ensuring that the correct template ends up on each system.
The pattern for template specificity depends on two things: the lookup path and the source. The first pattern that matches is used:
/host-$fqdn/$source
/$platform-$platform_version/$source
/$platform/$source
/default/$source
/$source
Use an array with the source property to define an explicit lookup path. For example:
A cookbook may have a /templates directory structure like this:
/templates/
windows-6.2
windows-6.1
windows-6.0
windows
default
and a resource that looks something like the following:
template ‘C:\path\to\file\text_file.txt’ do
source ‘text_file.txt’
mode ‘0755’
owner ‘root’
group ‘root’
end
This resource would be matched in the same order as the /templates directory structure. For a node named host-node-desktop that is running Windows 7, the second item would be the matching item and the location:
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a>
Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>?
<strong>Please find my social handles as below;</strong>
<a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a>
<a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a>
<a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a>
<a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a>
<a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a>
<a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a>
<a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a>
<a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>
What is Chef? Chef is a powerful configuration management and automation tool that allows organizations to manage and automate the deployment, configuration, and maintenance of infrastructure. It…
What is Chef Compliance? Chef Compliance is a component of Chef, an automation platform used for configuration management, application deployment, and infrastructure as code (IaC). Chef Compliance…
Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at…
Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at…
Example of .kitchen.yml for driver_plugin vagrant with ubuntu for Chef Test Kitchen Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked…
How to test Chef recipes/cookbooks on your workstation with VAGRANT and VirtualBox using Test Kitchen Install Test Kitchen, VAGRANT and VirtualBox: Chef Test Kitchen: Test Kitchen is…