<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Default directory Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/default-directory/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/default-directory/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:49:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>What is the significance of the default directory under chef cookbook /templates?</title>
		<link>https://www.scmgalaxy.com/tutorials/what-is-the-significance-of-the-default-directory-under-chef-cookbook-templates/</link>
					<comments>https://www.scmgalaxy.com/tutorials/what-is-the-significance-of-the-default-directory-under-chef-cookbook-templates/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 26 Jul 2017 06:39:53 +0000</pubDate>
				<category><![CDATA[Chef]]></category>
		<category><![CDATA[Chef Client]]></category>
		<category><![CDATA[Chef cookbook]]></category>
		<category><![CDATA[Chef Guide]]></category>
		<category><![CDATA[Chef templates]]></category>
		<category><![CDATA[Chef Tutorials]]></category>
		<category><![CDATA[Default directory]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2017/07/26/what-is-the-significance-of-the-default-directory-under-chef-cookbook-templates/</guid>

					<description><![CDATA[<p>&#160; What is the significance of the default directory under chef cookbook /templates? A cookbook is frequently designed to work [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-the-significance-of-the-default-directory-under-chef-cookbook-templates/">What is the significance of the default directory under chef cookbook /templates?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img fetchpriority="high" decoding="async" class="size-full wp-image-2878 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/07/chef-cookbook-templates.png" alt="" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/07/chef-cookbook-templates.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/07/chef-cookbook-templates-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></div>
<p>&nbsp;</p>
<div>What is the significance of the default directory under chef cookbook /templates?</div>
<div></div>
<div>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.</div>
<div></div>
<p>&nbsp;</p>
<div><strong>The pattern for template specificity depends on two things: the lookup path and the source. The first pattern that matches is used:</strong></div>
<div></div>
<div>/host-$fqdn/$source</div>
<div>/$platform-$platform_version/$source</div>
<div>/$platform/$source</div>
<div>/default/$source</div>
<div>/$source</div>
<div></div>
<p>&nbsp;</p>
<div><strong>Use an array with the source property to define an explicit lookup path. For example:</strong></div>
<div>template &#8216;/test&#8217; do</div>
<div>  source [&#8220;#{node.chef_environment}.erb&#8221;, &#8216;default.erb&#8217;]</div>
<div>end</div>
<div></div>
<p>&nbsp;</p>
<div><strong>The following example emulates the entire file specificity pattern by defining it as an explicit path:</strong></div>
<div>template &#8216;/test&#8217; do</div>
<div>  source %W{</div>
<div>    host-#{node[&#8216;fqdn&#8217;]}/test.erb</div>
<div>    #{node[&#8216;platform&#8217;]}-#{node[&#8216;platform_version&#8217;]}/test.erb</div>
<div>    #{node[&#8216;platform&#8217;]}/test.erb</div>
<div>    default/test.erb</div>
<div>  }</div>
<div>end</div>
<div></div>
<p>&nbsp;</p>
<div><strong>A cookbook may have a /templates directory structure like this:</strong></div>
<div>/templates/</div>
<div>  windows-6.2</div>
<div>  windows-6.1</div>
<div>  windows-6.0</div>
<div>  windows</div>
<div>  default</div>
<div></div>
<p>&nbsp;</p>
<div><strong>and a resource that looks something like the following:</strong></div>
<div>template &#8216;C:\path\to\file\text_file.txt&#8217; do</div>
<div>  source &#8216;text_file.txt&#8217;</div>
<div>  mode &#8216;0755&#8217;</div>
<div>  owner &#8216;root&#8217;</div>
<div>  group &#8216;root&#8217;</div>
<div>end</div>
<div></div>
<p>&nbsp;</p>
<div><strong>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:</strong></div>
<div>/templates</div>
<div>  windows-6.2/text_file.txt</div>
<div>  windows-6.1/text_file.txt</div>
<div>  windows-6.0/text_file.txt</div>
<div>  windows/text_file.txt</div>
<div>
<p>  default/text_file.txt</p>
<p><strong>Reference</strong><br />
<a href="https://docs.chef.io/resource_template.html" target="_blank" rel="noopener">https://docs.chef.io/resource_template.html</a></p>
</div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-the-significance-of-the-default-directory-under-chef-cookbook-templates/">What is the significance of the default directory under chef cookbook /templates?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/what-is-the-significance-of-the-default-directory-under-chef-cookbook-templates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
