<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Jonas Genannt - puppet</title>
    <link>http://blog.brachium-system.net/</link>
    <description>Weblog of an System Engineer</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.1 - http://www.s9y.org/</generator>
    
    <image>
        <url>http://blog.brachium-system.net/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Jonas Genannt - puppet - Weblog of an System Engineer</title>
        <link>http://blog.brachium-system.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Server Manager with Puppet configuration keys</title>
    <link>http://blog.brachium-system.net/archives/113-Server-Manager-with-Puppet-configuration-keys.html</link>
            <category>puppet</category>
    
    <comments>http://blog.brachium-system.net/archives/113-Server-Manager-with-Puppet-configuration-keys.html#comments</comments>
    <wfw:comment>http://blog.brachium-system.net/wfwcomment.php?cid=113</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.brachium-system.net/rss.php?version=2.0&amp;type=comments&amp;cid=113</wfw:commentRss>
    

    <author>nospam@example.com (Jonas Genannt)</author>
    <content:encoded>
    With this post I will explain you the Puppet Configuration Key feature at the &lt;a href=&quot;http://blog.brachium-system.net/archives/110-ServerHardware-documenation.html&quot;&gt;server manager&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
With the puppet configuration key feature you can store configuration data used in puppet classes at your database. You can also store configuration data on server groups and add servers to that group.&lt;br /&gt;
&lt;br /&gt;
Yes - it&#039;s working like ripienaar&#039;s great &lt;a href=&quot;http://www.devco.net/archives/2009/08/31/complex_data_and_puppet.php&quot;&gt;extlookup&lt;/a&gt; but with database.&lt;br /&gt;
&lt;br /&gt;
For this example I have got two hosts:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;valentina.brachium-system.net&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;web01.brachium-system.net&lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;Both hosts are saved on the server manager. &lt;br /&gt;
&lt;br /&gt;
We have some puppet configuration keys at server manager:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:46 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;702&quot; height=&quot;141&quot;  src=&quot;http://blog.brachium-system.net/uploads/puppet_cfg_keys.jpg&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
The first server &lt;b&gt;valentina.brachium-system.net&lt;/b&gt; has got the following puppet key configuration:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:47 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;620&quot; height=&quot;156&quot;  src=&quot;http://blog.brachium-system.net/uploads/valentina_puppet_cfg_keys.jpg&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second server &lt;b&gt;web01.brachium-system.net&lt;/b&gt; has got the following puppet key configuration:&lt;br /&gt;
&lt;!-- s9ymdb:48 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;602&quot; height=&quot;128&quot;  src=&quot;http://blog.brachium-system.net/uploads/web01.stg_puppet_cfg_keys.jpg&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are using this puppet manifest:&lt;br /&gt;
&lt;blockquote&gt;# Configuration for dblookup from servermgmt:&lt;br /&gt;
$dblook_host = &quot;localhost&quot;&lt;br /&gt;
$dblook_user = &quot;servermgmt&quot;&lt;br /&gt;
$dblook_pass = &quot;servermgmt&quot;&lt;br /&gt;
$dblook_db   = &quot;servermgmt&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class ssh::server {&lt;br /&gt;
            $ssh_server_password_authentication = dblookup(&#039;ssh_server_password_authentication&#039;)&lt;br /&gt;
            $ssh_server_root_login = dblookup(&#039;ssh_server_root_login&#039;)&lt;br /&gt;
            notice(&quot;ssh_server_password_authentication: $ssh_server_password_authentication&quot;)&lt;br /&gt;
            notice(&quot;ssh_server_root_login: $ssh_server_root_login&quot;)&lt;br /&gt;
            file { &quot;/etc/ssh/sshd_config&quot;:&lt;br /&gt;
                    content =&gt; template(&quot;/home/jonas/puppet/templates/sshd_config.erb&quot;)&lt;br /&gt;
           }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
node default {&lt;br /&gt;
        $pkg_install_subversion = dblookup(&#039;pkg_install_subversion&#039;)&lt;br /&gt;
        notice(&quot;We are the server: ${fqdn}&quot;)&lt;br /&gt;
        notice(&quot;pkg_install_subversion: $pkg_install_subversion&quot;)&lt;br /&gt;
        include ssh::server&lt;br /&gt;
        package {&quot;subversion&quot;:&lt;br /&gt;
                ensure =&gt; dblookup(&#039;pkg_install_subversion&#039;)&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We run that manifest on the server &lt;b&gt;valentina&lt;/b&gt;:&lt;br /&gt;
&lt;blockquote&gt;notice: Scope(Node[default]): We are the server: valentina.brachium-system.net&lt;br /&gt;
notice: Scope(Node[default]): pkg_install_subversion: present&lt;br /&gt;
notice: Scope(Class[ssh::server]): ssh_server_password_authentication: yes&lt;br /&gt;
notice: Scope(Class[ssh::server]): ssh_server_root_login: no&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We run that manifest on the server &lt;b&gt;web01&lt;/b&gt;:&lt;br /&gt;
&lt;blockquote&gt;notice: Scope(Node[default]): We are the server: web01.stg.brachium-system.net&lt;br /&gt;
notice: Scope(Node[default]): pkg_install_subversion: absent&lt;br /&gt;
notice: Scope(Class[ssh::server]): ssh_server_password_authentication: no&lt;br /&gt;
notice: Scope(Class[ssh::server]): ssh_server_root_login: yes&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
You can see on the verbose output from puppet, the information is fetched from the database - if the server has got no own value for one key, the default value is used.&lt;br /&gt;
&lt;br /&gt;
You can get the source at &lt;a href=&quot;http://github.com/hggh/servermgmt&quot;&gt;http://github.com/hggh/servermgmt&lt;/a&gt; 
    </content:encoded>

    <pubDate>Mon, 15 Feb 2010 21:47:35 +0100</pubDate>
    <guid isPermaLink="false">http://blog.brachium-system.net/archives/113-guid.html</guid>
    
</item>

</channel>
</rss>