Puppet SuSE

Version 2 (Anonymous, 03/13/2010 08:01 pm)

1 1
# Puppet on SuSE/opensuse
2 1
3 1
There should not be many particular issues with Puppet on SuSE and
4 1
opensuse linux.
5 1
6 1
**Warning**: This was tested on opensuse 10.1 and 10.2. It should
7 1
work for previous versions and for SLES as well, but I have such no
8 1
machine available to test.
9 1
10 1
## Installation
11 1
12 1
To install puppet add the repository for appropriate version at
13 1
[http://software.opensuse.org/download/system:/management/](http://software.opensuse.org/download/system:/management/)
14 1
in yast sources and install puppet.
15 1
16 1
    yast -i install puppet
17 1
18 1
In opensuse 10.2 I recommend using new package manager *zypper*
19 1
20 1
    zypper sa http://software.opensuse.org/download/system:/management/openSUSE_10.2
21 1
    zypper update
22 1
    zypper install puppet
23 1
24 1
Note that packages already provide *initscripts* so you can start
25 1
*puppet* and enable it at startup with
26 1
27 1
    service puppet start
28 1
    chkconfig puppet on
29 1
30 1
On the server where you want to run *puppetmaster*, you have to
31 1
install *puppet-server* package as well
32 1
33 1
    yast -i puppet-server
34 1
35 1
and start and enable *puppetmaster* daemon
36 1
37 1
    service puppetmaster start
38 1
    chkconfig puppetmaster on
39 1
40 1
You can now proceed to
41 1
[[Installation\_Guide#BuildingtheServer|Installation Guide]] .
42 1
43 1
## Configuration
44 1
45 1
There are two places for configuration. Global configuration can be
46 1
set in */etc/puppet/puppet.conf* and this is described in
47 1
[[Documentation\_Start#Configuration|Documentation Start]] .
48 1
49 1
To pass parameters to deamons run by the initscripts, you can edit
50 1
the file */etc/sysconfig/puppet*. Most common use is to specify the
51 1
server.
52 1
53 1
    # /etc/sysconfig/puppet
54 1
    
55 1
    # puppet server (--server option)
56 1
    PUPPET_SERVER="puppetmaster.example.com"
57 1
    
58 1
    # where to log (--logdest option)
59 1
    PUPPET_LOG=/var/log/puppet.log
60 1
61 1
For configuring the server edit */etc/sysconfig/puppetmaster*
62 1
63 1
    # /etc/sysconfig/puppetmaster
64 1
    
65 1
    # where to look for the manifests (--manifest option)
66 1
    PUPPETMASTER_MANIFEST="/etc/puppet/manifests/site.pp"
67 1
    
68 1
    # where to log (--logdest option)
69 1
    PUPPETMASTER_LOG="/var/log/puppetmaster.log"
70 1
    
71 1
    # any other options passed to puppetmasterd directly 
72 1
    PUPPETMASTER_EXTRA_OPTS=""
73 1
74 1
Look at [[Configuration Reference]] for more configuration
75 1
options.
76 1
77 1
## Package Providers
78 1
79 1
The only package providers for SuSE are *rpm*, *yum* and *rug*
80 1
(from version 0.22.4). *Yum* seems to be more than sufficient. But
81 1
if you would like to see some other PM like *yast*, *rug* or
82 1
*zypper* supported, please file a feature request or better still
83 1
write and submit a provider, it's not that difficult :-).
84 1
85 1
*Note: As of version 0.22.4 **rug** is default provider for SuSE.*
86 1
87 1
### Yum
88 1
89 1
*yum* is a package manager providing dependency resolving and other
90 1
advanced features and is supported by puppet. Especially useful is
91 1
in combination with *yumrepo* puppet type which allows one to
92 1
configure package repositories. To use *yum*, first install it
93 1
94 1
    yast -i yum
95 1
96 1
On SuSE *yum* comes without default repository locations, so you
97 1
have to add that by hand. You can use [[Type Reference]] type for
98 1
that. Include the following into your manifests
99 1
100 1
    Yumrepo { gpgcheck=>true, enabled=>true }
101 1
    
102 1
    yumrepo {
103 1
      "SL-10.2":
104 1
        descr=>"openSuSE Linux 10.2",
105 1
        baseurl=>"http://download.opensuse.org/distribution/10.2/inst-source/suse/";
106 1
      "SL-10.2-update":
107 1
        descr=>"openSuSE Linux 10.2 updates",
108 1
        baseurl=>"http://download.suse.com/update/10.2/"
109 1
    }
110 1
111 1
Here you can find urls for
112 1
[package repositories](http://en.opensuse.org/Package_Repositories).
113 1
114 1
Now you can make *yum* default PM(package manager) simply by
115 1
adding
116 1
117 1
    case $operatingsystem {
118 1
      suse: {Package{ provider => yum }}
119 1
    }
120 1
121 1
somewhere in your *site.pp*. You can also use [[Type Reference]]
122 1
type to manage package sources.
123 1
124 1
## /etc/init.d script:
125 1
126 1
If you installed from source and need the init script for
127 1
puppet-server, you can extract it from the SuSE rpm with this
128 1
command:
129 1
130 1
    rpm2cpio puppet-server-0.24.8-2.1.x86_64.rpm | cpio -ivd ./etc/init.d/puppet-server
131 1
132 1
then copy the file to /etc/init.d/.