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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Description: String displaying agent status Display As: Status running: Description: Is the agent running Display As: Running You’ve seen the basic features of MCollective in this chapter. It works as a great orchestration tool for Puppet, allowing you greater control over your Puppet agents and more insight into your configurations through Facter. Beyond this, the agents are fairly simple to write and can be used to accomplish any task that you might want to execute in a distributed fashion

will have a neat feature called cloud-init. Cloud-init provides a boot hook that can consume data from an input on instance launch and do things like install packages or execute scripts. On your instance there will be an example at /usr/share/doc/cloud-init/ examples/cloud-config-puppet.txt that describes how to install Puppet at boot and contact a Puppet Master: puppet: conf: agent: server: "puppetmaster.example.com" certname: "myinstance.example.com" At the simplest, all that needs to be

of a particular name can exist on each node. We can build a base class that installs our Apache2 package and sets up a service to manage it. We can then inherit from the base and add a couple of special-purpose 15 classes for an Apache with SSL and Apache with PHP. This helps to reduce duplication in our code and makes future changes less onerous: class http-server { package { "apache2": ensure => installed } service { "apache2": ensure => running, enable => true, pattern => "apache2",

Gone are the days of writing big ugly scripts to push users and keys out to your whole farm of servers. We’ll see how to accomplish this in a less painful manner using Puppet. Building the Framework First, we’ll need a framework that can build user accounts in a repeatable fashion given a set of user attributes. We’ll use a definition to make a reusable structure that can implement the user type repeatedly with different inputs. There is a lot going on in this snippet, so I’ll step through it

Alice and Bob virtual resources here, because I may not want to have useraccounts on all of my nodes. If I were to have declared a real resource, every node that includes the people class would have had her user created. This way, I can realize only Declaring Users | 23 the users in the web group on nodes A.example.com and both users in the web and db groups on B.example.com. It may seem obvious, but it must be said: Your Puppet manifests need to be kept secure. They will often contain secrets

Download sample

Download