<?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; management</title>
	<atom:link href="http://www.mogilowski.net/lang/en-us/tag/management/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 2</title>
		<link>http://www.mogilowski.net/lang/en-us/2009/07/03/servermanagement-with-puppet-%e2%80%93-part-2</link>
		<comments>http://www.mogilowski.net/lang/en-us/2009/07/03/servermanagement-with-puppet-%e2%80%93-part-2#comments</comments>
		<pubDate>Fri, 03 Jul 2009 18:02:59 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=441</guid>
		<description><![CDATA[Now we want to create a clear strukture for the puppet configuration files. The config in Part 1 is only a simple example to test the configuration. In this example we want to create the user &#8220;sebastian&#8221; and &#8220;demo&#8221; on all servers with a specific password. 1. Templates &#8221;/etc/puppet/manifests/templates.pp&#8221;: This files defines various classes of [...]]]></description>
			<content:encoded><![CDATA[<p><br />
<span lang="en-us">Now we want to create a clear strukture for the puppet configuration files. The config in Part 1 is only a simple example to test the configuration. In this example we want to create the user &#8220;sebastian&#8221; and &#8220;demo&#8221; on all servers with a specific password.</span></p>
<h3>1. Templates &#8221;/etc/puppet/manifests/templates.pp&#8221;:</h3>
<p><br />
<span lang="en-us">This files defines various classes of server configurations. Those classes collects configurations to allocate it with servers (nodes).</span></p>
<pre>
#
# templates.pp
#

class baseclass {
    include user::admins
}</pre>
<h3>2. Modules &#8221;/etc/puppet/manifests/modules.pp&#8221;:</h3>
<p><br />
<span lang="en-us">For serveral softwareconfigurations you can use puppet modules. There are a lot of modules available for the most applications. Here you see some of them:</span><br />
<a href="http://git.puppet.immerda.ch" target="_blank">http://git.puppet.immerda.ch</a> oder<br />
<a href="http://reductivelabs.com/trac/puppet/wiki/PuppetModules" target="_blank">http://reductivelabs.com/trac/puppet/wiki/PuppetModules</a></p>
<pre>
#
# modules.pp
#

import "common"
import "user"</pre>
<h3>3. Nodes &#8221;/etc/puppet/manifests/nodes.pp&#8221;:</h3>
<p><br />
<span lang="en-us">In this file you define the single servers and allocate them with the templates. The node &#8220;default&#8221; match to each server which is connected to the puppetmaster.</span></p>
<pre>
#
# nodes.pp
#

node default {

}

node 'puppetmaster.domain.local' {
    include baseclass
}

node 'pc1.domain.local' {
    include baseclass
}

node 'pc2.domain.local' {
    include baseclass
}</pre>
<h3>4. Site &#8221;/etc/puppet/manifests/site.pp&#8221;:</h3>
<p><br />
<span lang="en-us">Now import the single files in the main configuration file of the puppetmaster.</span></p>
<pre>
#
# site.pp
#

import "modules.pp"
import "templates.pp"
import "nodes.pp"</pre>
<h3><br />
<span lang="en-us">5. Installation / download the puppet modules:</span></h3>
<p><br />
<span lang="en-us">In the &#8220;modules.pp&#8221; file we use 2 modules. Install this modules with git:</span></p>
<pre>
aptitude install git-core
git clone git://git.puppet.immerda.ch/module-common.git /etc/puppet/modules/common
git clone git://git.puppet.immerda.ch/module-user.git /etc/puppet/modules/user</pre>
<h3><br />
<span lang="en-us">6. Create users</span></h3>
<p><strong>&#8220;/etc/puppet/modules/user/manifests/admins.pp&#8221;:</strong></p>
<pre>
#
# admins.pp
#

class user::admins inherits user::virtual {

realize (
    User["sebastian"],
    User["demo"]
)
User["sebastian"]{ groups =&#62; admin }
User["demo"]{ groups =&#62; admin }

}</pre>
<p><strong>&#8220;/etc/puppet/modules/user/manifests/virtual.pp&#8221;:</strong></p>
<pre>
#
# virtual.pp
#

class user::virtual {

    @user { "sebastian":
        ensure          => present,
        uid               => 1000,
        gid               => "users",
        comment       => "Sebastian",
        home            => "/home/sebastian",
        shell             =>"/bin/bash",
        managehome => true,
        password       => 'ENCRYPTED PASSWORD',
    }

    @user { "demo":
        ensure          => present,
        uid               => 1001,
        gid               => "users",
        comment       => "Demo",
        home            => "/home/demo",
        shell             => "/bin/bash",
        managehome => true,
        password      => 'ENCRYPTED PASSWORD',
    }

}</pre>
<p><br />
<span lang="en-us">You get the &#8220;ENCRYPTED PASSWORD&#8221; from the &#8220;<em>/etc/shadow</em>&#8221; for example.</span></p>
<p><br />
<span lang="en-us">Or you can create this encrypted password with the howto in this Blog:</span><br />
<a href="http://www.raskas.be/blog/2007/09/15/manual-encrypting-your-shadow-password" target="_blank">http://www.raskas.be/blog/2007/09/15/manual-encrypting-your-shadow-password</a></p>
<p><br />
<span lang="en-us">For the sake of completeness:</span></p>
<pre>echo "CLEAR PASSWORD" &#124; perl -nle 'print crypt($_, "\$1\$".join "", (".", "/", 0..9, "A".."Z", "a".."z")[rand 64, rand 64, rand 64, rand 64, rand 64, rand 64, rand 64, rand 64]);'</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2009/07/03/servermanagement-with-puppet-%e2%80%93-part-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Servermanagement with puppet &#8211; Part 1</title>
		<link>http://www.mogilowski.net/lang/en-us/2009/06/22/servermanagement-with-puppet-part-1</link>
		<comments>http://www.mogilowski.net/lang/en-us/2009/06/22/servermanagement-with-puppet-part-1#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:35:42 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=404</guid>
		<description><![CDATA[The Environment: Hosts: puppetmaster: The puppetmaster pc1: The first testclient pc2: The second testclient Domain: domain.local Note: I used Ubuntu 9.04 in all servers. Puppetmaster installation aptitude install puppetmaster Activate fileserver for the local network (&#8221;/etc/puppet/fileserver.conf&#8221;): [files] path /etc/puppet/files allow *.domain.local [plugins] path /etc/puppet/files allow *.domain.local Note:You can allow a subnet, too. (&#8221;allow 192.168.0.0/24&#8221;). Edit [...]]]></description>
			<content:encoded><![CDATA[<p><br />
<span lang="en-us"><strong>The Environment:</strong></span></p>
<p>Hosts:<br />
puppetmaster: <span lang="en-us">The puppetmaster</span><br />
pc1: <span lang="en-us">The first testclient</span><br />
pc2: <span lang="en-us">The second testclient</span></p>
<p>Domain: domain.local</p>
<p><br />
<span lang="en-us"><strong>Note:</strong> <em>I used Ubuntu 9.04 in all servers.</em></span></p>

<h3><span lang="en-us">Puppetmaster installation</span></h3>
<pre>aptitude install puppetmaster</pre>
<p><br />
<span lang="en-us">Activate fileserver for the local network (<em>&#8221;/etc/puppet/fileserver.conf&#8221;</em>):</span></p>
<pre>
[files]
path /etc/puppet/files
allow *.domain.local

[plugins]
path /etc/puppet/files
allow *.domain.local</pre>
<p><br />
<span lang="en-us"><strong>Note:</strong><em>You can allow a subnet, too. (</em><em>&#8221;allow 192.168.0.0/24&#8221;).</em></span></p>
<p><br />
<span lang="en-us">Edit / Create the site file <em>&#8221;/etc/puppet/manifests/site.pp&#8221;</em>:</span></p>
<p><br />
<span lang="en-us">This is puppets main configuration file. To test the configuration, we want to copy a file from the puppetmaster to the clients.</span></p>
<pre>
#
# site.pp
#

class filetest {
   file { '/etc/testfile':
      source =&#62; "puppet://puppetmaster.domain.local/files/etc/testfile"
   }
}

node default {
   include filetest
}</pre>
<p><span lang="en-us">Now create the testfile and the directories:</span></p>
<pre>
mkdir -p /etc/puppet/files/etc
vim /etc/puppet/files/etc/testfile</pre>
<p><br />
<span lang="en-us">Choose a content for this file &#8220;Hello World&#8221; for example.</span></p>
<pre>/etc/init.d/puppetmaster restart</pre>

<h3><span lang="en-us">Client Installation</span></h3>
<pre>aptitude install puppet</pre>

<h3><span lang="en-us">Connect the puppet client to the server</span></h3>
<p><br />
<span lang="en-us">Add the following content to the puppet configuration file <em>/etc/puppet/puppet.conf</em> to connect the client to the server.</span></p>
<pre>
[puppetd]
server=puppetmaster.domain.local
</pre>
<pre>/etc/init.d/puppet restart</pre>
<p><br />
<span lang="en-us">On the puppetmaster:</span></p>
<pre>puppetca --list
puppetca --sign pc1.domain.local</pre>
<p><br />
<span lang="en-us">A restart of puppet is the fastet way to test the configuration:</span></p>
<pre>/etc/init.d/puppet restart</pre>
<p><br />
<span lang="en-us">Now you should see the file <em>/etc/testfile</em> on each client.</span></p>
<p><br />
<span lang="en-us">In the next part of this howto, we will use some modules with puppet and create an example configuration for pratical use.</span></p>
<h3>Links:</h3>
<p><a title="Part 1" href="http://www.debian-administration.org/articles/526" target="_blank">An introduction to using Puppet Teil 1</a><br />
<a title="Part 2" href="http://www.debian-administration.org/articles/528" target="_blank">An introduction to using Puppet Teil 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2009/06/22/servermanagement-with-puppet-part-1/feed</wfw:commentRss>
		<slash:comments>2</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 29/48 queries in 0.031 seconds using apc
Object Caching 554/554 objects using apc
Content Delivery Network via cdn.mogilowski.net

Served from: www.mogilowski.net @ 2012-02-05 02:23:49 -->
