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 UPDATINGAfter the run finishes, check /etc/sudoers; the modes should have changed to be as you set on thepuppetmaster!Puppet can manage file content as well as attributes. Create a sample sudoers file, and put it in/etc/puppet/files/sudoers. Then edit site.pp again:file { "/etc/sudoers":owner => "root",group => "root",mode => 440,source => "puppet://puppetserver.example.com/files/sudoers",}Edit the file on the client so it looks in some way different from this sample file (for example, add atest comment line), and run Puppet on the client again with puppetd --test. The file content willchange!■ Note Having file content in one place also makes it very easy to use Subversion (or another version controlsystem). I strongly recommend that you do so! The ability to roll back changes is very helpful.When managing files, you can also ensure that softlinks exist or that directories exist. This configsnippet also shows how you can use a single file { } container for multiple file resources. Note thesemicolon at the end of each resource specification.file {"/star":ensure => link,target => "/soft9/star";}"/test/dir":ensure => directory;You can set up defaults for any resource. For example, if most of your files are owned by root andhave chmod value 644, this snippet will set these values as the default for all files:File {owner => "root",group => "root".mode => "644"}You can override this default by specifying a different value for any of these within a particularresource. Whatever you specify for the resource will override the default.82Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!