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.
rajeshkumar created the topic: FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited u FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) Error gitlab-ctl reconfigure Starting Chef Client, version 11.12.2 Compiling Cookbooks… Recipe: gitlab::default * directory[/etc/gitlab] action create (up to date) ================================================================================ Recipe Compile Error in /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb ================================================================================ RuntimeError ———— External URL must include a FQDN…
run-list A run-list defines all of the information necessary for Chef to configure a node into the desired state. A run-list may include roles and/or recipes. A run-list must be in one of the following formats: fully qualified, cookbook, or default. Both roles and recipes must be in quotes, for example: [code]’role[NAME]’ ‘recipe[COOKBOOK::RECIPE]’ ‘recipe[COOKBOOK::RECIPE],COOKBOOK::RECIPE,role[NAME]'[/code] env_run_list…
Q1. What is Chef?Begin this answer by defining Chef. It is a powerful automation platform that provides a way to transforms infrastructure into code. Chef is a tool for which you write scripts that are used to automate processes. Q2. What is a Resource in Chef?My suggestion is to first define Resource. A Resource represents…
Why do we make a new cookbook dependent upon one or more different cookbooks? So that we don’t breach copyright So that we can make use of Berkshelf So we can avoid having to duplicate code (Ans) So that we can manage a node running Linux So that we can upload the cookbook to Chef…
Source – http://hub.scalr.com/blog/top-questions-on-server-configuration-management-tools-chef-puppet-and-ansible-2 As a quick recap, configuration management tools enable companies to standardize and automate their infrastructure. Through standardization, you can build systems that are platform independent (i.e. instead of relying on AMIs or provider specific toolsets). These tools also make it easy reproduce servers for scaling or testing, and recover from disaster quickly…
ScmGalaxy is the best contributor to Chef Courses, training, and certification. Our Chef Trainers and advisers are highly equipped with more than 15 years of rich experience in the Software industry. DevOps! Which has captured a unique position in the IT world and has become a crucial part of software engineering methodology. To better the…