<?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>Lior Gradstein's Blog &#187; ruby</title>
	<atom:link href="http://www.gradstein.info/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gradstein.info</link>
	<description></description>
	<lastBuildDate>Thu, 13 May 2010 09:46:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Synchronization methods of a file with Puppet</title>
		<link>http://www.gradstein.info/ruby/synchronization-methods-of-a-file-with-puppet/</link>
		<comments>http://www.gradstein.info/ruby/synchronization-methods-of-a-file-with-puppet/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 12:39:32 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[puppet]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[reductivelabs]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=37</guid>
		<description><![CDATA[Usually, to synchronize a file with remote hosts, using puppet, one would use the following pattern:
file &#123; &#34;/etc/init.d/pvfs2-server&#34;:
&#160; &#160; &#160; owner =&#62; root, group =&#62; root, 
&#160; &#160; &#160; mode =&#62; 755, 
&#160; &#160; &#160; source =&#62; &#34;puppet:///files/pvfs2-server&#34; &#160; &#160;
&#125;
(using &#8220;source&#8221; to copy data as-is, and using &#8220;template(&#8220;filename&#8221;) to use a template structure as data).
Or, [...]]]></description>
			<content:encoded><![CDATA[<p>Usually, to synchronize a file with remote hosts, using <a href="http://reductivelabs.com/trac/puppet/" class="liexternal">puppet</a>, one would use the following pattern:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span> <span style="color: #483d8b;">&quot;/etc/init.d/pvfs2-server&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; owner =&gt; root, group =&gt; root, <br />
&nbsp; &nbsp; &nbsp; mode =&gt; <span style="color: #ff4500;">755</span>, <br />
&nbsp; &nbsp; &nbsp; source =&gt; <span style="color: #483d8b;">&quot;puppet:///files/pvfs2-server&quot;</span> &nbsp; &nbsp;<br />
<span style="color: black;">&#125;</span></div>
<p>(using &#8220;source&#8221; to copy data as-is, and using &#8220;template(&#8220;filename&#8221;) to use a template structure as data).</p>
<p>Or, if one wishes to directly set the content of the target file:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span> <span style="color: #483d8b;">&quot;/etc/init.d/pvfs2-server&quot;</span>:<br />
&nbsp; &nbsp;owner =&gt; root, group =&gt; root, <br />
&nbsp; &nbsp;mode =&gt; <span style="color: #ff4500;">755</span>, <br />
&nbsp; &nbsp;source =&gt; <span style="color: #483d8b;">&quot;puppet:///files/pvfs2-server&quot;</span> &nbsp; &nbsp;<br />
<span style="color: black;">&#125;</span></div>
<p>Please note that on the first line, for example &#8216;file { &#8220;/etc/mpd.conf&#8221;:&#8217;), the &#8220;/etc/mpd.conf&#8221; is a merge of two functionalities/concepts: Usually, the syntax is clear and simple:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span> mon_fichier_mpd_conf:<br />
&nbsp; &nbsp; &nbsp;path =&gt; <span style="color: #483d8b;">&quot;/etc/mpd.conf&quot;</span>,<br />
&nbsp; &nbsp; &nbsp;<span style="color: black;">&#91;</span>&#8230;<span style="color: black;">&#93;</span><br />
<span style="color: black;">&#125;</span></div>
<p>The first line is about the resource description. Its goal is to be able to reference to it a little later from another resources (Notify[], etc.). By putting directly the file path and name (I think it&#8217;s identified as a filename and not as a description because there are quotes, or maybe it&#8217;s because it begins with a slash?) you mege the &#8220;path&#8221; attribute with its description.<br />
On the other end, we&#8217;ll not be able to reference to it later, if you need to.</p>
<p>You may also need to synchronize a file that is not present in the repository (puppet:///files/*). That usually happens, for example, when that file is regenerated by an external program or an external action (like /etc/passwd).</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span><span style="color: #483d8b;">&quot;/etc/passwd&quot;</span>:<br />
&nbsp; &nbsp; &nbsp;owner =&gt; root, group =&gt; root, mode =&gt; <span style="color: #ff4500;">644</span>,<br />
&nbsp; &nbsp; &nbsp;content =&gt; <span style="color: #008000;">file</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;/etc/passwd&quot;</span><span style="color: black;">&#41;</span><br />
<span style="color: black;">&#125;</span></div>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/ruby/synchronization-methods-of-a-file-with-puppet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troll of the day: Why Ruby sucks and why Python rocks!</title>
		<link>http://www.gradstein.info/python/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/</link>
		<comments>http://www.gradstein.info/python/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 15:06:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/</guid>
		<description><![CDATA[I found a nicely written article about the problems with Ruby, written by a Ruby user, and why he found Python to be really good. There&#8217;s even a quote about Twisted!
And, there are a bunch of things available to a Python guy that Ruby just canâ€™t compete with that are of particular interest to me. [...]]]></description>
			<content:encoded><![CDATA[<p>I found a <a href="http://blog.cbcg.net/articles/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-then-its-bound-to-drizzown" class="liexternal">nicely written article</a> about the problems with Ruby, written by a Ruby user, and why he found Python to be really good. There&#8217;s even a quote about Twisted!<br />
<blockquote>And, there are a bunch of things available to a Python guy that Ruby just canâ€™t compete with that are of particular interest to me. Two that come to mind immediately are <a href="http://twistedmatrix.com/trac/" class="liexternal">Twisted</a> and <a href="http://www.stackless.com/" class="liexternal">Stackless Python</a>. The former was used by others at TurnTide for creating a really powerful <span class="caps">SMTP</span> testing tool and the latter was used by TurnTideâ€™s competitor <a href="http://www.ironport.com/" class="liexternal">IronPort</a> to build one of the industryâ€™s best MTAs.</p></blockquote>
<p>I didn&#8217;t knew that IronPort was done in Python, even in Stackless Python!</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
