Pulling Strings With Puppet - James Turnbull [0]
Configuration Management
Made Easy
JAMES TURNBULL
This book is dedicated to Ruth Brown, who makes me laugh, and to my family for their continued support.
Contents
About the Author ......................................................... ix
About the Technical Reviewer ............................................... xi
Acknowledgments .......................................................xiii
Introduction ............................................................ xv
CHAPTER 1 Introducing Puppet ............................................. 1
What Is Puppet? ........................................... 3
What Makes Puppet Different? ................................ 3
How Does Puppet work? .................................... 4
A Declarative Language ................................. 5
A Transactional Layer ................................... 7
A Resource Abstraction Layer ............................ 7
Puppet Performance and Hardware ............................ 7
The Future for Puppet ...................................... 8
Resources ...............................................8
Web ................................................ 9
Mailing Lists ......................................... 9
IRC ................................................ 9
CHAPTER 2 Installing and Running Puppet ................................. 11
Installation Prerequisites ................................... 11
Installing Ruby ....................................... 12
Installing Ruby from Source ............................. 12
Installing Ruby and Ruby Libraries from Packages ............ 13
Installing Facter ...................................... 15
Installing Facter from Source ............................ 15
Installing Facter from Package ........................... 16
Installing RDoc ....................................... 17
Installing Puppet ......................................... 18
Installing from Source ................................. 18
Installing Puppet by Package ............................ 20
Installing Puppet from a Ruby Gem ....................... 21
Getting Started with Puppet ................................. 23
Starting the Puppet Master ............................. 23
Starting the Puppet Client .............................. 25
Signing Your Client Certificate ........................... 26
Running the Puppet Daemons ............................... 28
Configuring Puppet ....................................... 28
The [main] Configuration Namespace ..................... 32
Configuring puppetmasterd ............................. 33
Configuring puppetd .................................. 35
Configuring puppetca ................................. 38
Resources .............................................. 40
Web ............................................... 40
Mailing Lists ........................................ 40
CHAPTER 3 Speaking Puppet .............................................. 41
Defining Configuration Resources ............................ 42
Resource Titling ...................................... 42
Resource Attributes ................................... 44
Resource Style ....................................... 45
Resource Defaults .................................... 46
Collections of Resources ............................... 47
Classes and Subclasses ................................ 47
Classes Relationships ................................. 48
Class Inheritance ..................................... 49
Definitions .......................................... 50
Qualifying Definitions .................................. 53
Variables ........................................... 53
Variable Scoping ..................................... 54
Variables and Class Inheritance .......................... 55
Qualified Variables .................................... 56
Variables and Metaparameters .......................... 57
Arrays ............................................. 58
Conditionals .........................................