<?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>Sebastian Mogilowskis Blog &#187; facts</title>
	<atom:link href="http://www.mogilowski.net/lang/en-us/tag/facts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mogilowski.net</link>
	<description>Just another blog about administration, linux and other stuff</description>
	<lastBuildDate>Tue, 17 Jan 2012 13:42:30 +0000</lastBuildDate>
	<language>en-us</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Servermanagement with puppet – Part 4</title>
		<link>http://www.mogilowski.net/lang/en-us/2009/07/19/servermanagement-with-puppet-%e2%80%93-part-4</link>
		<comments>http://www.mogilowski.net/lang/en-us/2009/07/19/servermanagement-with-puppet-%e2%80%93-part-4#comments</comments>
		<pubDate>Sun, 19 Jul 2009 16:23:32 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[factor]]></category>
		<category><![CDATA[facts]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=448</guid>
		<description><![CDATA[Puppet facts Note: This article based on Part 1 &#8211; Part 3 of my puppet articles. Please read them first ! Factor allows to you add information from your nodes to your puppet configuration. Facts are available as variables. Execute the &#8220;facter&#8221; command and you get a full list of facts an their values: sebastian@pc1:~$ [...]]]></description>
			<content:encoded><![CDATA[<h3>Puppet facts</h3>
<p><span lang="en-us"><strong>Note:</strong> This article based on <a href="http://www.mogilowski.net/projects/" target="_blank">Part 1 &#8211; Part 3</a> of my puppet articles. Please read them first !</span></p>
<p><span lang="en-us">Factor allows to you add information from your nodes to your puppet configuration.</span><br />
<span lang="en-us">Facts are available as variables. Execute the &#8220;facter&#8221; command and you get a full list of facts an their values:</span></p>
<pre>sebastian@pc1:~$ facter
architecture =&#62; i386
domain =&#62; domain.local
facterversion =&#62; 1.5.1
fqdn =&#62; pc1.domain.local
hardwaremodel =&#62; i686
hostname =&#62; pc1
interfaces =&#62; eth0
ipaddress =&#62; 192.168.0.2
ipaddress_eth0 =&#62; 192.168.0.2
kernel =&#62; Linux
kernelrelease =&#62; 2.6.28-11-server
kernelversion =&#62; 2.6.28
lsbdistcodename =&#62; jaunty
lsbdistdescription =&#62; Ubuntu 9.04
lsbdistid =&#62; Ubuntu
lsbdistrelease =&#62; 9.04
macaddress =&#62; 00:0c:29:7a:37:37
macaddress_eth0 =&#62; 00:0c:29:7a:37:37
memoryfree =&#62; 417.25 MB
memorysize =&#62; 497.37 MB
netmask =&#62; 255.255.255.0
netmask_eth0 =&#62; 255.255.255.0
operatingsystem =&#62; Ubuntu
operatingsystemrelease =&#62; 9.04
processor0 =&#62; Intel(R) Xeon(TM) CPU 2.80GHz
processorcount =&#62; 1
ps =&#62; ps -ef
puppetversion =&#62; 0.24.5
rubysitedir =&#62; /usr/local/lib/site_ruby/1.8
rubyversion =&#62; 1.8.7
swapfree =&#62; 883.99 MB
swapsize =&#62; 883.99 MB
virtual =&#62; vmware</pre>
<p><span lang="en-us">You see that my &#8220;pc1&#8243; is a 32-Bit virtual machine with Ubuntu 9.04. Now we want to extend our &#8220;baseclass template&#8221; to install the vmware-tools on all virtual machines.</span></p>
<p><span lang="en-us">Edit &#8220;/etc/puppet/manifests/templates.pp&#8221;:</span></p>
<pre>#
# templates.pp
#

class baseclass {
include user::admins
include munin::client
include ntp

if $virtual == "vmware" {
include vmware::client
}
case $virtual {
vmware: { include vmware::client }
}

}</pre>
<p><span lang="en-us">Create vmware module:</span></p>
<pre>mkdir -p /etc/puppet/modules/vmware/manifests/</pre>
<p><span lang="en-us">Create &#8220;/etc/puppet/modules/vmware/manifests/init.pp&#8221; file:</span></p>
<pre>#
# init.pp
#

class vmware{

}</pre>
<p><span lang="en-us">Create &#8220;/etc/puppet/modules/vmware/manifests/client.pp&#8221; file:</span></p>
<pre>#
# client.pp
#

class vmware::client inherits vmware{

package { open-vm-tools: ensure =&#62; installed }

}</pre>
<p><span lang="en-us"><strong>Note:</strong> This is a simple example. If you have more than one operating system in your environment, you need the &#8220;operatingsystem&#8221; variable for a second condition.</span><br />
<a href="http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#conditionals" target="_blank">http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#conditionals</a></p>
<h3>Custom Facts</h3>
<p><span lang="en-us">You can also define your own facts in puppet.</span></p>
<p><a href="http://reductivelabs.com/trac/puppet/wiki/AddingFacts" target="_blank">http://reductivelabs.com/trac/puppet/wiki/AddingFacts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2009/07/19/servermanagement-with-puppet-%e2%80%93-part-4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 17/34 queries in 0.024 seconds using apc
Object Caching 476/487 objects using apc
Content Delivery Network via cdn.mogilowski.net

Served from: www.mogilowski.net @ 2012-02-05 02:13:41 -->
