13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3 ■ MONITORING AND UPDATINGYou can also have configurations that differ for each machine. Or you can set up base configurationsand then either inherit from or include them in the node configuration.You may have a basic server config that differs from your desktop config, and both may inherit froma base or default config. This could look like this:class base {# Various basic thingsinclude autofsinclude croninclude puppetinclude ssh# and so on}class desktop inherits base {# Everything in the base class will automatically be included here# Then you can alsoinclude latexinclude gnome# and so on}class server inherits base {# Again, everything from the base class will automatically be included# Then some other server-only thingsinclude nfs# and so on}Classes can be specified either in a single file or in a file per class. So here, you could have all theprevious setup in a single file classes.pp, or you could separate it into base.pp, desktop.pp, andserver.pp (see the suggested directory structure in Figure 3-3). I recommend the latter to makeconfiguration management easier, because it means that you can easily find the node or applicationwhose configuration you want to edit.3-15. Defining Your Puppet Nodes in LDAPInstead of defining your nodes in site.pp, you can keep them in LDAP as the puppetclass attribute. Thisenables you to automatically set up the type of Puppet node that a machine should be set up as whenyou first add it to the directory. You can have as many of these puppetclass attributes per host as youlike—for example, my web server has webserver, ftpserver, and server as puppetclass attributes.site.pp therefore has only import statements, not node definitions. Your class definitions are set in/etc/puppet/manifests/classes, as described in the previous recipe, and you import them in site.pp(again, as in the previous recipe).86Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!