<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Facter on Puppeteers Oy</title>
		<link>https://www.puppeteers.net/tags/facter/</link>
		<description>Recent content in Facter on Puppeteers Oy</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Fri, 18 Dec 2020 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://www.puppeteers.net/tags/facter/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Creating custom facts programmatically</title>
				<link>https://www.puppeteers.net/blog/creating-custom-facts-programmatically/</link>
				<pubDate>Fri, 18 Dec 2020 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/creating-custom-facts-programmatically/</guid>
				<description>&lt;p&gt;Writing static facts is fairly easy even with a low level of Ruby skills. Below is an example of a fact that returns true or false depending on whether the node has a /boot partition:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Facter.add(:has_bootfs) do&#xA;  setcode do&#xA;    if Facter.value(:mountpoints)[&amp;#39;/boot&amp;#39;].nil?&#xA;      false&#xA;    else&#xA;      true&#xA;    end&#xA;  end&#xA;end&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;p&gt;As you can see above the required information was already inside the &amp;ldquo;mountpoints&amp;rdquo; fact of Facter.&lt;/p&gt;&#xA;&lt;p&gt;Using the fact is easy:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
