Puppet Solaris
Version 9 (James Turnbull, 11/17/2010 01:41 am)
| 1 | 1 | # Running Puppet on Solaris |
|
|---|---|---|---|
| 2 | 1 | ||
| 3 | 1 | Solaris was an early development target for Puppet, hence Puppet's |
|
| 4 | 1 | support for the platform is mature and stable. |
|
| 5 | 1 | ||
| 6 | 1 | # Installation OpenSolaris? |
|
| 7 | 4 | Sebastian Kayser | |
| 8 | 4 | Sebastian Kayser | Note: Please make sure to use at least Facter 1.5.4, previous versions |
| 9 | 4 | Sebastian Kayser | had issues (#1555, #1761) determining the operatingsystemrelease fact. |
| 10 | 1 | ||
| 11 | 1 | Puppet and facter are available in pkg(5) format from Code Nursery, |
|
| 12 | 1 | so all you have to do is to add them as a package provider, and |
|
| 13 | 1 | then install the package. |
|
| 14 | 1 | ||
| 15 | 1 | # pkg set-publisher -O http://pkg.codenursery.com/ codenursery.com |
|
| 16 | 1 | # pkg install puppet |
|
| 17 | 1 | ||
| 18 | 1 | This installs two smf(5) services: |
|
| 19 | 1 | ||
| 20 | 1 | - svc:/network/puppet/client:default |
|
| 21 | 1 | - svc:/network/puppet/master:default |
|
| 22 | 1 | ||
| 23 | 1 | which both are disabled by default. They require |
|
| 24 | 1 | /etc/puppet/puppet.conf to be present, so before trying to enable |
|
| 25 | 1 | either of them you need to create that file. |
|
| 26 | 1 | ||
| 27 | 7 | Lars Tobias Skjong-Børsting | # Installation Solaris 8/9/10? |
| 28 | 7 | Lars Tobias Skjong-Børsting | |
| 29 | 7 | Lars Tobias Skjong-Børsting | Puppet requires both Facter and Ruby, neither of which will be found in a standard Solaris 8/9/10 installation. |
| 30 | 7 | Lars Tobias Skjong-Børsting | |
| 31 | 7 | Lars Tobias Skjong-Børsting | A good and easy way to install Puppet and its dependencies is to use the [OpenCSW archive](http://www.opencsw.org). The first step is to install [pkgutil](http://www.opencsw.org/packages/CSWpkgutil), which enables you to easily retrieve software from the OpenCSW repositories. |
| 32 | 7 | Lars Tobias Skjong-Børsting | |
| 33 | 7 | Lars Tobias Skjong-Børsting | Please follow the [instructions](http://www.opencsw.org/get-it/pkgutil) at the OpenCSW site |
| 34 | 7 | Lars Tobias Skjong-Børsting | to install pkgutil, then return here to continue installing |
| 35 | 7 | Lars Tobias Skjong-Børsting | [Puppet](http://www.opencsw.org/packages/CSWpuppet). |
| 36 | 7 | Lars Tobias Skjong-Børsting | |
| 37 | 7 | Lars Tobias Skjong-Børsting | With pkgutil installed, you can use it to install Puppet and it's dependencies: |
| 38 | 7 | Lars Tobias Skjong-Børsting | |
| 39 | 7 | Lars Tobias Skjong-Børsting | # /opt/csw/bin/pkgutil --yes --install puppet |
| 40 | 7 | Lars Tobias Skjong-Børsting | |
| 41 | 7 | Lars Tobias Skjong-Børsting | Note that this not only installs puppet, it also enables the |
| 42 | 7 | Lars Tobias Skjong-Børsting | puppet agent. This installs a SMF(5) service: |
| 43 | 7 | Lars Tobias Skjong-Børsting | |
| 44 | 7 | Lars Tobias Skjong-Børsting | # svcs svc:/network/puppetd:default |
| 45 | 7 | Lars Tobias Skjong-Børsting | |
| 46 | 7 | Lars Tobias Skjong-Børsting | You may disable it after installation: |
| 47 | 7 | Lars Tobias Skjong-Børsting | |
| 48 | 7 | Lars Tobias Skjong-Børsting | # svcadm disable puppetd |
| 49 | 7 | Lars Tobias Skjong-Børsting | |
| 50 | 1 | # Installation (Blastwave Package) |
|
| 51 | 1 | ||
| 52 | 1 | Puppet has Facter and Ruby as prerequisites, neither of which will |
|
| 53 | 1 | be found on a stock, default Solaris installation. |
|
| 54 | 1 | ||
| 55 | 1 | By far the easiest way to install puppet and its dependencies is to |
|
| 56 | 1 | use the blastwave (Community Software) archive, aka CSW |
|
| 57 | 1 | [http://www.blastwave.org](http://www.blastwave.org). The first |
|
| 58 | 1 | step is to install pkgutil, which allows you to retreive software |
|
| 59 | 1 | from the blastwave repositories. |
|
| 60 | 1 | ||
| 61 | 1 | Please follow the instructions located on the blastwave site |
|
| 62 | 1 | [http://www.blastwave.org/howto.html](http://www.blastwave.org/howto.html) |
|
| 63 | 1 | for installing pkgutil, then return here to continue installing |
|
| 64 | 1 | Puppet. |
|
| 65 | 1 | ||
| 66 | 1 | Now that you have pkgutil installed, you can use pkgutil to install |
|
| 67 | 1 | puppet. Pkgutil will resolve all of the dependencies, and install |
|
| 68 | 1 | those packages as well. |
|
| 69 | 1 | ||
| 70 | 1 | # /opt/csw/bin/pkgutil -U |
|
| 71 | 1 | # /opt/csw/bin/pkgutil --install puppet |
|
| 72 | 1 | ||
| 73 | 1 | Note that this not only installs puppet, it also turns on the |
|
| 74 | 1 | daemon which starts looking for a local puppet master server. To |
|
| 75 | 1 | stop this, after installation: |
|
| 76 | 1 | ||
| 77 | 1 | # svcadm disable puppetd |
|
| 78 | 1 | ||
| 79 | 1 | Note: At the moment blastwave is going through some internal |
|
| 80 | 1 | turmoil. This has caused Gary Law, the puppet solaris package |
|
| 81 | 1 | maintainer, to temporarily postpone updating the blastwave |
|
| 82 | 1 | repositories with the latest version of puppet. He has however |
|
| 83 | 1 | provided the packages from his personal website: |
|
| 84 | 1 | [http://garylaw.net/packages/](http://garylaw.net/packages/). For |
|
| 85 | 1 | more information check out Gary's post here: |
|
| 86 | 1 | [Gary's google groups post](http://groups.google.com/group/puppet-users/browse_thread/thread/4722c4119e4e9540/c064f4436c98e89d?lnk=gst&q=solaris#c064f4436c98e89d) |
|
| 87 | 1 | ||
| 88 | 1 | # Installation (Sunfreeware + )Ruby Gems? |
|
| 89 | 1 | ||
| 90 | 1 | This is an alternative method for installing Puppet on Solaris 10. |
|
| 91 | 1 | Rather than depending on Blastwave, which is an entire package |
|
| 92 | 1 | framework, I prefer the simplest installation with the least steps |
|
| 93 | 1 | and dependencies. |
|
| 94 | 1 | ||
| 95 | 1 | \1) Install Ruby from the |
|
| 96 | 1 | [Solaris Companion DVD](http://www.sun.com/software/solaris/freeware/) |
|
| 97 | 1 | or |
|
| 98 | 1 | [sunfreeware.com](ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/ruby-1.8.7p72-sol10-sparc-local.gz): |
|
| 99 | 1 | ||
| 100 | 1 | pkgadd -d /cdrom/Solaris_Software_Companion/Solaris_sparc/Packages/ SFWruby |
|
| 101 | 1 | ||
| 102 | 1 | \2) Download and install the latest |
|
| 103 | 1 | [RubyGems](http://www.rubygems.org) (Like perl's CPAN module, but |
|
| 104 | 1 | for Ruby): |
|
| 105 | 1 | ||
| 106 | 1 | $ wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz |
|
| 107 | 1 | $ gzcat rubygems-1.3.1.tgz | tar -xf - |
|
| 108 | 1 | $ cd rubygems-1.3.1 |
|
| 109 | 1 | $ /opt/sfw/bin/ruby setup.rb |
|
| 110 | 1 | ||
| 111 | 1 | \3) Install the latest Puppet and it's dependencies via Ruby |
|
| 112 | 1 | Gems?: |
|
| 113 | 1 | ||
| 114 | 1 | /opt/sfw/bin/gem update |
|
| 115 | 1 | /opt/sfw/bin/gem install puppet |
|
| 116 | 1 | ||
| 117 | 1 | Ruby Gems? will automatically download and install all packages and |
|
| 118 | 1 | pre-requisites. |
|
| 119 | 1 | ||
| 120 | 1 | \4) You'll have to write your own /etc/init.d/puppetd and |
|
| 121 | 1 | /etc/init.d/puppetmasterd scripts, or modify the Blastwave SMF |
|
| 122 | 1 | manifests. Other than that, puppet is pretty much installed. |
|
| 123 | 1 | ||
| 124 | 1 | # Installation (Cool Stack) |
|
| 125 | 1 | ||
| 126 | 1 | "Optimized Open Source Software Stack (Cool Stack) for the Sun |
|
| 127 | 1 | Solaris Operating System(TM). Cool Stack is a collection of some of |
|
| 128 | 1 | the most commonly used open source applications optimized for the |
|
| 129 | 1 | Sun Solaris OS" |
|
| 130 | 1 | ||
| 131 | 1 | 1) |
|
| 132 | 1 | [Download](https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=CoolStack-1.3.1Fin-G-F@CDS-CDS_SMI) |
|
| 133 | 1 | and install CSKruby package for your platform (Sparc or x86) |
|
| 134 | 1 | ||
| 135 | 1 | pkgadd -d CSKruby_1.3.1_sparc.pkg |
|
| 136 | 1 | ||
| 137 | 1 | \2) CSKruby will be installed to /opt/coolstack, so add that to |
|
| 138 | 1 | your default path. |
|
| 139 | 1 | ||
| 140 | 1 | export PATH=$PATH:/opt/coolstack/bin |
|
| 141 | 1 | ||
| 142 | 1 | \3) Install facter + puppet from Ruby Gem? -or- tarball |
|
| 143 | 1 | ||
| 144 | 1 | gem install facter |
|
| 145 | 1 | gem install puppet |
|
| 146 | 1 | ||
| 147 | 1 | OR |
|
| 148 | 6 | James Turnbull | $ wget http://puppetlabs.com/downloads/facter/facter-latest.tgz |
| 149 | 6 | James Turnbull | $ tar xvzf facter-1.5.8.tar.gz |
| 150 | 6 | James Turnbull | $ cd facter-1.5.8 |
| 151 | 1 | $ ./install.rb |
|
| 152 | 1 | ||
| 153 | 9 | James Turnbull | $ wget http://puppetlabs.com/downloads/puppet/puppet-2.6.3.tar.gz |
| 154 | 9 | James Turnbull | $ tar xvzf puppet-2.6.3.tar.gz |
| 155 | 9 | James Turnbull | $ cd puppet-2.6.3 |
| 156 | 1 | $ ./install.rb |
|
| 157 | 1 | ||
| 158 | 1 | \4) TODO: Will add SRV4 packaging instructions here \*soon\* |
|
| 159 | 1 | ||
| 160 | 1 | # Integrating Puppet with Jumpstart |
|
| 161 | 1 | ||
| 162 | 1 | ## Solaris 10 |
|
| 163 | 1 | ||
| 164 | 1 | post-install script: |
|
| 165 | 1 | ||
| 166 | 1 | #!/bin/sh |
|
| 167 | 1 | ||
| 168 | 1 | ### Setup |
|
| 169 | 1 | mkdir /a/jumpstart |
|
| 170 | 1 | mount jumpstartserver:/opt/solaris/jumpstart /a/jumpstart |
|
| 171 | 1 | ||
| 172 | 1 | ### Blastwave support |
|
| 173 | 1 | cd /a/jumpstart |
|
| 174 | 1 | cp root.profile /a/.profile |
|
| 175 | 1 | mkdir -p /a/usr/local/bin |
|
| 176 | 1 | cp wget-`uname -p`.bin /a/usr/local/bin/wget |
|
| 177 | 1 | chmod 755 /a/usr/local/bin/wget |
|
| 178 | 1 | mkdir -p /a/opt/csw |
|
| 179 | 1 | echo all | pkgadd -a admin.jumpstart -d pkg_get-3.8.1-all-CSW.pkg -R /a |
|
| 180 | 1 | cp /a/jumpstart/pkg-get.conf /a/opt/csw/etc |
|
| 181 | 1 | cp /a/var/pkg-get/admin-fullauto /a/var/pkg-get/admin |
|
| 182 | 1 | ||
| 183 | 1 | ### Ruby from Blastwave |
|
| 184 | 1 | cd /a/jumpstart |
|
| 185 | 1 | mkdir -p /a/usr/local/sbin |
|
| 186 | 1 | cp /a/jumpstart/ruby-install.sh /a/usr/local/sbin |
|
| 187 | 1 | chmod 700 /a/usr/local/sbin/ruby-install.sh |
|
| 188 | 1 | chroot /a /usr/local/sbin/ruby-install.sh |
|
| 189 | 1 | ||
| 190 | 1 | ### Facter and Puppet from garylaw.net |
|
| 191 | 1 | cp facter-1.3.8,REV=2007.09.23-SunOS5.8-all-CSW.pkg /a/tmp |
|
| 192 | 1 | cp puppet-0.23.2,REV=2007.09.23-SunOS5.8-all-CSW.pkg /a/tmp |
|
| 193 | 1 | cp admin.jumpstart /a/tmp |
|
| 194 | 1 | cp /a/jumpstart/puppet-install.sh /a/usr/local/sbin |
|
| 195 | 1 | chmod 700 /a/usr/local/sbin/puppet-install.sh |
|
| 196 | 1 | chroot /a /usr/local/sbin/puppet-install.sh |
|
| 197 | 1 | ||
| 198 | 1 | ## Puppet setup |
|
| 199 | 1 | cp puppetd.conf /a/etc/puppet |
|
| 200 | 1 | cd /a/var/svc/manifest/network |
|
| 201 | 1 | ln -s ../../../../opt/csw/var/svc/manifest/puppetd.xml . |
|
| 202 | 1 | cd /a/jumpstart |
|
| 203 | 1 | ||
| 204 | 1 | ### Teardown |
|
| 205 | 1 | cd / |
|
| 206 | 1 | umount /a/jumpstart |
|
| 207 | 1 | rmdir /a/jumpstart |
|
| 208 | 1 | ||
| 209 | 1 | root.profile |
|
| 210 | 1 | ||
| 211 | 1 | umask 022 |
|
| 212 | 1 | ||
| 213 | 1 | PATH=/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ucb:/opt/SUNWspro/bin:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/opt/csw/sbin |
|
| 214 | 1 | export PATH |
|
| 215 | 1 | ||
| 216 | 1 | MANPATH=/usr/man:/usr/dt/man:/usr/openwin/share/man:/usr/local/man:/opt/SUNWspro/man:/opt/csw/man |
|
| 217 | 1 | export MANPATH |
|
| 218 | 1 | ||
| 219 | 1 | PS1="`whoami`@`hostname`# " |
|
| 220 | 1 | export PS1 |
|
| 221 | 1 | ||
| 222 | 1 | admin.jumpstart |
|
| 223 | 1 | ||
| 224 | 1 | mail= |
|
| 225 | 1 | instance=unique |
|
| 226 | 1 | partial=nocheck |
|
| 227 | 1 | runlevel=nocheck |
|
| 228 | 1 | idepend=nocheck |
|
| 229 | 1 | rdepend=nocheck |
|
| 230 | 1 | space=nocheck |
|
| 231 | 1 | setuid=nocheck |
|
| 232 | 1 | conflict=nocheck |
|
| 233 | 1 | action=nocheck |
|
| 234 | 1 | basedir=default |
|
| 235 | 1 | ||
| 236 | 1 | pkg-get.conf |
|
| 237 | 1 | ||
| 238 | 1 | url=http://www.gtlib.gatech.edu/pub/blastwave/unstable |
|
| 239 | 1 | ||
| 240 | 1 | ruby-install.sh -- pkg-get running inside a chroot requires a |
|
| 241 | 1 | working mnttab, and openssl (one of the Ruby dependencies) requires |
|
| 242 | 1 | a working /dev/random and /dev/urandom. On my Solaris 10 Jumpstart |
|
| 243 | 1 | installs, /dev/random and /dev/urandom exist in the chroot, but are |
|
| 244 | 1 | symlinks to missing entries in /devices. |
|
| 245 | 1 | ||
| 246 | 1 | #!/bin/sh |
|
| 247 | 1 | ||
| 248 | 1 | /sbin/mount -F mntfs mnttab /etc/mnttab |
|
| 249 | 1 | mknod /devices/pseudo/random@0:random c 190 0 |
|
| 250 | 1 | mknod /devices/pseudo/random@0:urandom c 190 1 |
|
| 251 | 1 | ||
| 252 | 1 | PATH=$PATH:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/opt/csw/sbin |
|
| 253 | 1 | export PATH |
|
| 254 | 1 | pkg-get install ruby |
|
| 255 | 1 | ||
| 256 | 1 | puppet-install.sh -- these installs might not require a chroot, and |
|
| 257 | 1 | may work fine if installed similar to the pkg-get installation |
|
| 258 | 1 | above. |
|
| 259 | 1 | ||
| 260 | 1 | #!/bin/sh |
|
| 261 | 1 | /sbin/mount -F mntfs mnttab /etc/mnttab |
|
| 262 | 1 | cd /tmp |
|
| 263 | 1 | mkdir /etc/puppet |
|
| 264 | 1 | echo all | pkgadd -a admin.jumpstart -d \ |
|
| 265 | 1 | facter-1.3.8,REV=2007.09.23-SunOS5.8-all-CSW.pkg |
|
| 266 | 1 | echo all | pkgadd -a admin.jumpstart -d \ |
|
| 267 | 1 | puppet-0.23.2,REV=2007.09.23-SunOS5.8-all-CSW.pkg |
|
| 268 | 1 | ||
| 269 | 1 | puppet.conf |
|
| 270 | 1 | ||
| 271 | 1 | [puppetd] |
|
| 272 | 1 | # Make sure all log messages are sent to the right directory |
|
| 273 | 1 | # This directory must be writable by the puppet user |
|
| 274 | 1 | logdir=/opt/csw/var/puppet/log |
|
| 275 | 1 | vardir=/opt/csw/var/puppet |
|
| 276 | 1 | rundir=/opt/csw/var/puppet/run |
|
| 277 | 1 | server=puppetserver.domain |
|
| 278 | 1 | factsync=true |
|
| 279 | 1 | ||
| 280 | 1 | # Simple Puppetmaster install and configuration |
|
| 281 | 1 | ||
| 282 | 1 | To do |
|
| 283 | 1 | ||
| 284 | 1 | # Puppet on older versions of Solaris |
|
| 285 | 1 | ||
| 286 | 1 | Of course, blastwave will only work on Solaris 8+. However, Puppet |
|
| 287 | 1 | does work well with the Ruby from sunfreeware for at least Solaris |
|
| 288 | 1 | 2.6 and 7, and people have even had success compiling pkg-get for |
|
| 289 | 1 | use with those platforms by pointing it to the sunfreeware |
|
| 290 | 1 | repository - however, your mileage may vary with that (not tested |
|
| 291 | 1 | by the person writing this paragraph). Certainly, using sunfreeware |
|
| 292 | 1 | packages and native sun packages on their own works quite well. |
|
| 293 | 1 | ||
| 294 | 1 | # Minimal Solaris Puppet Client Installation Instructions |
|
| 295 | 1 | ||
| 296 | 1 | This assumes Solaris 10 or later, you are **root**, with **bash** |
|
| 297 | 1 | and **wget** installed and in your PATH:- |
|
| 298 | 1 | ||
| 299 | 1 | ## Step 1, install pkgutil |
|
| 300 | 1 | ||
| 301 | 1 | exec bash |
|
| 302 | 1 | wget -q -O - \ |
|
| 303 | 1 | http://ftp.math.purdue.edu/mirrors/opencsw.org/unstable/$(uname -p)/$(uname -r)/pkgutil-1.4,REV=2009.01.19-SunOS5.8-$(uname -p)-CSW.pkg.gz \ |
|
| 304 | 1 | | gunzip --stdout - > /tmp/pkgutil.pkg |
|
| 305 | 1 | yes | pkgadd -d /tmp/pkgutil.pkg all |
|
| 306 | 1 | /opt/csw/bin/pkgutil -U |
|
| 307 | 1 | ||
| 308 | 1 | ## Step 2, install puppet |
|
| 309 | 1 | ||
| 310 | 5 | Mark Phillips | /opt/csw/bin/pkgutil -yi CSWpuppet |
| 311 | 1 | ||
| 312 | 1 | This will install common, ruby, facter and any other required |
|
| 313 | 1 | dependencies, then puppet, and then start up puppetd with a blank |
|
| 314 | 1 | config (defaults to looking for a puppet server at |
|
| 315 | 1 | puppet.YOURDOMAIN) |
|
| 316 | 1 | ||
| 317 | 1 | ## More Detailed Solaris Puppet Client Installation Instructions |
|
| 318 | 1 | ||
| 319 | 1 | Installation of the Puppet infrastructure onto a client machine |
|
| 320 | 1 | requires a number of prerequisites to be met first. This procedure |
|
| 321 | 1 | outlines the installation process for these prerequisites and |
|
| 322 | 1 | ultimately Puppet itself on the Solaris 10 platform. Note: This |
|
| 323 | 1 | guide assumes that LDAPNodes is being used for node storage. If |
|
| 324 | 1 | not, omit any steps that relate to LDAP and do whatever is needed |
|
| 325 | 1 | for your node storage mechanism of choice. |
|
| 326 | 1 | ||
| 327 | 1 | All Blastwave packages are installed under: /opt/csw |
|
| 328 | 1 | ||
| 329 | 1 | ### Procedure |
|
| 330 | 1 | ||
| 331 | 1 | \1) Install Blastwave Support |
|
| 332 | 1 | ||
| 333 | 1 | # pkgadd -d http://www.blastwave.org/pkg_get.pkg |
|
| 334 | 1 | ||
| 335 | 1 | \2) Verify that the pkg-get configuration file is configured for |
|
| 336 | 1 | your region |
|
| 337 | 1 | ||
| 338 | 1 | \3) Install the complete wget package |
|
| 339 | 1 | ||
| 340 | 1 | # /opt/csw/bin/pkg-get -i wget |
|
| 341 | 1 | ||
| 342 | 1 | \4) Configure pkg-get to support automation. |
|
| 343 | 1 | ||
| 344 | 1 | # cp -p /var/pkg-get/admin-fullauto /var/pkg-get/admin |
|
| 345 | 1 | ||
| 346 | 1 | \5) Now we are going to install gnupg and an md5 utility so that we |
|
| 347 | 1 | can do some security validation of Blastwave packages. |
|
| 348 | 1 | ||
| 349 | 1 | # /opt/csw/bin/pkg-get -i gnupg textutils |
|
| 350 | 1 | ||
| 351 | 1 | \6) Next we will copy the Blastwave PGP public key to the local |
|
| 352 | 1 | host. |
|
| 353 | 1 | ||
| 354 | 1 | # /opt/csw/bin/wget --output-document=pgp.key http://www.blastwave.org/mirrors.html |
|
| 355 | 1 | ||
| 356 | 1 | Which should result in output like this: |
|
| 357 | 1 | ||
| 358 | 1 | --10:39:55-- http://www.blastwave.org/mirrors.html |
|
| 359 | 1 | => `pgp.key' |
|
| 360 | 1 | Resolving www.blastwave.org... 131.188.30.245 |
|
| 361 | 1 | Connecting to www.blastwave.org[131.188.30.245]:80... connected. |
|
| 362 | 1 | HTTP request sent, awaiting response... 200 OK |
|
| 363 | 1 | Length: 16,060 [text/html] |
|
| 364 | 1 | ||
| 365 | 1 | 100%[====================================>] 16,060 52.41K/s |
|
| 366 | 1 | ||
| 367 | 1 | 10:39:56 (52.33 KB/s) - `pgp.key' saved [16060/16060] |
|
| 368 | 1 | ||
| 369 | 1 | \7) Next we will import the PGP key that we just copied. |
|
| 370 | 1 | ||
| 371 | 1 | # gpg --import pgp.key |
|
| 372 | 1 | ||
| 373 | 1 | \8) Verify that the following two lines in |
|
| 374 | 1 | /opt/csw/etc/pkg-get.conf are COMMENTED OUT. |
|
| 375 | 1 | ||
| 376 | 1 | #use_gpg=false |
|
| 377 | 1 | #use_md5=false |
|
| 378 | 1 | ||
| 379 | 1 | \9) Install the Ruby software (CSWruby) from Blastwave. |
|
| 380 | 1 | ||
| 381 | 1 | # /opt/csw/bin/pkg-get -i ruby |
|
| 382 | 1 | ||
| 383 | 1 | Note: This will also install any Ruby prerequisites. |
|
| 384 | 1 | ||
| 385 | 1 | \10) Install the Ruby Gems? software (CSWrubygems) from Blastwave. |
|
| 386 | 1 | ||
| 387 | 1 | # /opt/csw/bin/pkg-get -i rubygems |
|
| 388 | 1 | ||
| 389 | 1 | \11) Add /opt/csw/bin and /opt/csw/sbin to the root user's PATH. |
|
| 390 | 1 | ||
| 391 | 1 | \12) Install Reductive Labs facter gem package using the Ruby Gem? |
|
| 392 | 1 | installation tool. |
|
| 393 | 1 | ||
| 394 | 1 | # gem install facter |
|
| 395 | 1 | ||
| 396 | 1 | \13) Install Reductive Labs Puppet gem package using the Ruby Gem? |
|
| 397 | 1 | installation tool. The current STABLE version is: 0.23.2. |
|
| 398 | 1 | ||
| 399 | 1 | # gem install puppet --version '0.23.2' |
|
| 400 | 1 | ||
| 401 | 1 | \14) Create the puppet user and group: |
|
| 402 | 1 | ||
| 403 | 1 | Info for /etc/passwd: |
|
| 404 | 1 | ||
| 405 | 1 | puppet:x:35001:35001:puppet user:/home/puppet:/bin/sh |
|
| 406 | 1 | ||
| 407 | 1 | Info for /etc/shadow: |
|
| 408 | 1 | ||
| 409 | 1 | puppet:*LK*::::::: |
|
| 410 | 1 | ||
| 411 | 1 | Info for /etc/group: |
|
| 412 | 1 | ||
| 413 | 1 | puppet::35001: |
|
| 414 | 1 | ||
| 415 | 1 | \15) Create the following core directories and set the |
|
| 416 | 1 | permissions: |
|
| 417 | 1 | ||
| 418 | 1 | # mkdir -p /sysprov/dist/apps /sysprov/runtime/puppet/prod/puppet/master |
|
| 419 | 1 | # chown -R puppet:puppet /sysprov/dist /sysprov/runtime |
|
| 420 | 1 | ||
| 421 | 1 | \16) Grab this sample puppet.conf file and modify the attributes |
|
| 422 | 1 | listed below. Copy the modified file to the |
|
| 423 | 1 | /sysprov/runtime/puppet/prod/puppet/master directory on your host. |
|
| 424 | 1 | ||
| 425 | 1 | \17) Create a file containing the new LDAP entry information for |
|
| 426 | 1 | your host. In this file you specify the Puppet class membership |
|
| 427 | 1 | which is what Puppet uses to determine which configuration(s) to |
|
| 428 | 1 | use on your host. In the example below, the device is a member of |
|
| 429 | 1 | the sudo and syslog-ng classes. This means that whenever the |
|
| 430 | 1 | puppetd process is running on your host, it will periodically check |
|
| 431 | 1 | with the puppetmaster to see whether its configuration is out of |
|
| 432 | 1 | date and apply the configuration for a machine in the sudo and |
|
| 433 | 1 | syslog-ng puppet classes. Likewise, if you later modify the LDAP |
|
| 434 | 1 | entry to include another puppetclass entry or remove an existing |
|
| 435 | 1 | entry, the puppetmaster will apply that configuration instead. |
|
| 436 | 1 | ||
| 437 | 1 | Note: You should specify the fully qualified domain name. Puppet |
|
| 438 | 1 | will compare this value to the SSL certificate to ensure a match. |
|
| 439 | 1 | If you use a non-FQDN, you are going to run into issues. |
|
| 440 | 1 | ||
| 441 | 1 | # puppettest |
|
| 442 | 1 | dn: cn=puppettest.domain.edu,ou=Hosts,dc=puppet |
|
| 443 | 1 | objectClass: device |
|
| 444 | 1 | objectClass: ipHost |
|
| 445 | 1 | objectClass: puppetClient |
|
| 446 | 1 | objectClass: top |
|
| 447 | 1 | cn: puppettest.domain.edu |
|
| 448 | 1 | ipHostNumber: W.X.Y.Z |
|
| 449 | 1 | description: Test puppet client |
|
| 450 | 1 | l: statcomp |
|
| 451 | 1 | puppetclass: sudo |
|
| 452 | 1 | puppetclass: syslog-ng |
|
| 453 | 1 | ||
| 454 | 1 | \18) Add an LDAP entry for your host. YOUR-LDAP-ENTRY-FILENAME is |
|
| 455 | 1 | the file created in the previous step. |
|
| 456 | 1 | ||
| 457 | 1 | $ ldapadd -h ld.domain.edu -x -D uid=12345, ou=humans, dc=domain, dc=edu -W -f YOUR-LDAP-ENTRY-FILENAME -v |
|
| 458 | 1 | ||
| 459 | 1 | If you are modifying an existing entry use this instead: |
|
| 460 | 1 | ||
| 461 | 1 | $ ldapmodify -h ld.domain.edu -x -D uid=12345, ou=humans, dc=domain, dc=edu -W -f YOUR-LDAP-ENTRY-FILENAME -v |
|
| 462 | 1 | ||
| 463 | 1 | \19) Verify that your LDAP entry exists. |
|
| 464 | 1 | ||
| 465 | 1 | $ ldapsearch -h ld.domain.edu -x -b'dc=puppet' |
|
| 466 | 1 | ||
| 467 | 1 | \20) From the Puppet client machine, request SSL Client Certificate |
|
| 468 | 1 | from the puppetmaster. |
|
| 469 | 1 | ||
| 470 | 1 | # puppetd --server puppetmaster.domain.edu --waitforcert 60 --test --config=/sysprov/runtime/puppet/prod/puppet/master/puppet.conf |
|
| 471 | 1 | ||
| 472 | 1 | \21) Login to the puppetmaster and sign the certificates |
|
| 473 | 1 | ||
| 474 | 1 | # sudo puppetca --list --config=/sysprov/runtime/puppet/prod/puppet/master/puppet.conf |
|
| 475 | 1 | ||
| 476 | 1 | Which should show: |
|
| 477 | 1 | ||
| 478 | 1 | YOURHOSTNAME.domain.edu |
|
| 479 | 1 | ||
| 480 | 1 | # sudo puppetca --sign YOURHOSTNAME.domain.edu --config=/sysprov/runtime/puppet/prod/puppet/master/puppet.conf |
|
| 481 | 1 | ||
| 482 | 1 | \22) On the Puppet client machine you can then start the puppetd |
|
| 483 | 1 | process. If you pass in the -v and/or -d parameters (verbose and |
|
| 484 | 1 | debug), then the process does not run in the background. Omit these |
|
| 485 | 1 | parameters to daemonize the process. |
|
| 486 | 1 | ||
| 487 | 1 | # puppetd --server puppetmaster.domain.edu --config=/sysprov/runtime/puppet/prod/puppet/master/puppet.conf |
|
| 488 | 1 | ||
| 489 | 1 | Example Using Verbose and Debug Mode: |
|
| 490 | 1 | ||
| 491 | 1 | # puppetd -v -d --server puppetmaster.domain.edu --config=/sysprov/runtime/puppet/prod/puppet/master/puppet.conf |
|
| 492 | 1 | ||
| 493 | 1 | \23) That is it. You should be able to check the system log to see |
|
| 494 | 1 | whether your client is receiving updates from the puppetmaster. |
|
| 495 | 1 | ||
| 496 | 1 | # tail -f /var/adm/messages |
|
| 497 | 1 | Dec 17 09:06:39 cheshire puppetd[23486]: [ID 702911 daemon.notice] Starting configuration run |
|
| 498 | 1 | Dec 17 09:07:00 cheshire puppetd[23486]: [ID 702911 daemon.notice] (//sudo/File[/sysprov/dist/apps/sudo]/ensure) created |
|
| 499 | 1 | Dec 17 09:07:24 cheshire puppetd[23486]: [ID 702911 daemon.notice] (//sudo/File[/sysprov/dist/apps/sudo/UCRsudo]/ensure) created |
|
| 500 | 1 | Dec 17 09:07:33 cheshire puppetd[23486]: [ID 702911 daemon.notice] (//sudo/Package[UCRsudo]/ensure) created |
|
| 501 | 1 | Dec 17 09:07:33 cheshire puppetd[23486]: [ID 702911 daemon.notice] Finished configuration run in 54.72 seconds |
|
| 502 | 8 | Nick Tkach | |
| 503 | 8 | Nick Tkach | ## Ruby-Shadow Library on Solaris (Assuming you have Ruby in /opt/csw) |
| 504 | 8 | Nick Tkach | |
| 505 | 8 | Nick Tkach | 1) Clone the source code from github: |
| 506 | 8 | Nick Tkach | # git clone git://github.com/apalmblad/ruby-shadow |
| 507 | 8 | Nick Tkach | |
| 508 | 8 | Nick Tkach | 2) Copy the attached Makefile into ruby-shadow directory |
| 509 | 8 | Nick Tkach | |
| 510 | 8 | Nick Tkach | 3) Build the library within the ruby-shadow directory |
| 511 | 8 | Nick Tkach | # /usr/sfw/bin/gmake |
| 512 | 8 | Nick Tkach | |
| 513 | 8 | Nick Tkach | 4) Copy the compiled shadow.so into the architecture directory |
| 514 | 8 | Nick Tkach | # cp shadow.so /opt/csw/lib/ruby/site_ruby/1.8/i386-solaris2.8/shadow.so |
| 515 | 8 | Nick Tkach | |
| 516 | 8 | Nick Tkach | Please note that you will need to edit the Makefile to match your setup and the directory you copy the .so to will differ according to your setup. In our case it was build for an x86 Solaris 10. |