Managing Infrastructure with Puppet

Managing Infrastructure with Puppet

James Loope

Language: English

Pages: 56

ISBN: 1449307639

Format: PDF / Kindle (mobi) / ePub


Get started with Puppet, and learn how this popular configuration management framework helps you automate your servers. This concise introduction shows you how to use Puppet’s tools and templates to organize and execute configuration plans on Linux, Unix, and Windows servers. Through code samples and real-world examples, you’ll learn how to manage pools of servers and virtual instances, and how to administer access control. If you’re new to Puppet, but familiar with systems administration and Ruby language basics, this book is the ideal way to start using this open source framework.

  • Learn Puppet fundamentals, including its manifest syntax and built-in functions
  • Store configurations in a central location with PuppetMaster, and define which configurations apply to which nodes
  • Build a framework to create user accounts in place of LDAP or Kerberos KDC
  • Apply techniques to execute and manage server configurations with MCollective
  • Use Puppet as an auditing tool to ensure that configurations are correct
  • Gather information on the nodes you manage with the Facter library

Systems Analysis and Design in a Changing World (6th Edition)

Game AI Pro: Collected Wisdom of Game AI Professionals

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The cover image is from Wood’s Animate Creations. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont’s TheSansMonoCondensed.

system!) by saving the above text to test.pp and executing puppet apply test.pp. When this manifest is run against a blank system, the agent will check for the existence of an ntp package and install it if necessary. Then the file at /etc/ntp.conf will be installed if it doesn’t exist or overwritten with the content specified if it differs: package { 'ntp': ensure => installed } file { 'ntp.conf': path => '/etc/ntp.conf', mode => 640 content => ' driftfile /var/lib/ntp/ntp.drift statistics

"/etc/postfix/transport": mode => 640 owner => root, group => postfix, source => '/mnt/postfix/configs/transport', notify => Exec["postmap /etc/postfix/transport"], } exec { "postmap /etc/postfix/transport": refreshonly => true, } There are a couple of scenarios where you might want to use an exec, but only when some other condition requires it. Exec can be used to generate a file; for example, if I wish to fetch a configuration file that I’ve published on a web server. In the first example,

"puppet:///modules/apps/ntp/ntp.conf", require => Package[ntp], } } } service { "ntp": ensure => running, enable => true, pattern => 'ntpd', subscribe => [Package["ntp"], File["/etc/ntp.conf"]], With our node defined and importing the ntp class that we’ve written, we can now test out the agent. On the Puppet agent node, run sudo puppetd --test --noop --server puppet.example.com. This will tell the agent to run without daemonizing into the background (--test) and without actually modifying

pathnumber1: path => '/tmp/filenumber1' } yellifmissing { pathnumber2: path => '/tmp/filenumber2' } Inheritance and Parameterized Classes As we saw in the ntp example, classes are great for organizing our configurations, but they can also enhance the reusability of our code. Classes in Puppet, unlike define types, are not like their instanceable namesake in other object-oriented programming languages. They will take parameters and can even inherit structure from other classes, but only one class

Download sample

Download

About admin