A quick rundown of what we've learned in this chapter.
Manual configuration management is tedious and repetitive, it's error-prone, and it doesn't scale well. Puppet is a tool for automating this process.
You describe your configuration in terms of resources such as packages and files. This description is called a manifest.
When Puppet runs on a computer, it compares the current configuration to the manifest. It will take whatever actions are needed to change the machine so that it matches the manifest.
Puppet supports a wide range of different platforms and operating systems, and it will automatically run the appropriate commands to apply your manifest in each environment.
Using Puppet addresses a number of key problems with manual configuration management:
You can write a manifest once and apply it to many machines, avoiding duplicated work
You can keep all your servers in sync with each other, and with the manifest
The Puppet manifest also acts as live documentation, which is guaranteed to be up to date
Puppet copes with differences between operating systems, platforms, command syntaxes, and so on
Because Puppet manifests are code, you can version and manage them in the same way as any other source code
The problems with manual configuration management become acute when your infrastructure scales to 5-10 servers. Beyond that, especially when you're operating in the cloud where servers can be created and destroyed in response to changing demand, some way of automating your configuration management is essential.
Puppet manifests are written in a special language for describing system configuration. This language defines units called resources, each of which describes some aspect of the system: a user, a file, a software package, and so on:
package { 'curl': ensure => installed, }
Puppet is a declarative programming language: that is, it describes how things should be, rather than listing a series of actions to take, as in some other programming languages, such as Perl or shell. Puppet compares the current state of a server to its manifest, and changes only those things that don't match. This means you can run Puppet as many times as you want and the end result will be the same.