售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Puppet Cookbook Third Edition
Table of Contents
Puppet Cookbook Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Puppet Language and Style
Introduction
Adding a resource to a node
How to do it...
How it works...
Using Facter to describe a node
How to do it...
How it works...
There's more...
Variables
Scope
Installing a package before starting a service
How to do it...
How it works...
Capitalization
Learning metaparameters and ordering
Trifecta
Idempotency
Installing, configuring, and starting a service
How to do it...
How it works…
Using community Puppet style
How to do it…
Indentation
Quoting
False
Variables
Parameters
Symlinks
Creating a manifest
How to do it...
There's more…
Checking your manifests with Puppet-lint
Getting ready
How to do it...
There's more...
See also
Using modules
How to do it…
How it works…
There's more…
Templates
Facts, functions, types, and providers
Third-party modules
Module organization
See also
Using standard naming conventions
How to do it…
There's more…
Using inline templates
How to do it…
How it works…
There's more...
See also
Iterating over multiple items
How to do it…
How it works…
There's more…
Using hashes
Creating arrays with the split function
Writing powerful conditional statements
How to do it…
How it works…
There's more…
Elseif branches
Comparisons
Combining expressions
See also
Using regular expressions in if statements
How to do it…
How it works…
There's more…
Capturing patterns
Regular expression syntax
See also
Using selectors and case statements
How to do it…
How it works…
Selector
Case statement
There's more…
Regular expressions
Defaults
Using the in operator
How to do it…
There's more…
Using regular expression substitutions
How to do it…
How it works…
There's more…
See also
Using the future parser
Getting ready
How to do it...
Appending to and concatenating arrays
Lambda functions
Reduce
Filter
Map
Slice
Each
Other features
2. Puppet Infrastructure
Introduction
Installing Puppet
Getting ready
How to do it...
Managing your manifests with Git
Getting ready
How to do it...
How it works...
There's more...
Creating a decentralized Puppet architecture
Getting ready
How to do it...
How it works...
Writing a papply script
How to do it...
How it works...
Running Puppet from cron
Getting ready
How to do it...
How it works...
There's more...
Bootstrapping Puppet with bash
Getting ready
How to do it...
How it works...
There's more...
Creating a centralized Puppet infrastructure
Getting ready
How to do it...
How it works...
There's more...
Creating certificates with multiple DNS names
Getting ready
How to do it...
How it works...
Running Puppet from passenger
Getting ready
How to do it...
How it works...
There's more...
Setting up the environment
Getting ready
How to do it...
There's more...
Configuring PuppetDB
Getting ready
How to do it...
How it works...
There's more...
Configuring Hiera
Getting ready
How to do it...
How it works...
There's more...
Setting node-specific data with Hiera
Getting ready
How to do it...
How it works...
Storing secret data with hiera-gpg
Getting ready
How to do it...
How it works...
There's more...
See also
Using MessagePack serialization
Getting ready
How to do it...
How it works...
Automatic syntax checking with Git hooks
How to do it...
How it works...
Pushing code around with Git
Getting ready
How to do it...
How it works...
Managing Environments with Git
Getting ready
How to do it...
How it works...
There's more...
3. Writing Better Manifests
Introduction
Using arrays of resources
How to do it…
How it works…
See also
Using resource defaults
How to do it...
How it works...
There's more...
Using defined types
How to do it…
How it works…
There's more…
See also
Using tags
How to do it...
There's more…
Using run stages
How to do it…
How it works…
There's more…
See also
Using roles and profiles
How to do it…
How it works…
There's more…
Passing parameters to classes
How to do it…
How it works…
There's more…
Specifying default values
Passing parameters from Hiera
Getting ready
How to do it...
How it works...
There's more...
Writing reusable, cross-platform manifests
How to do it…
How it works...
There's more…
See also
Getting information about the environment
How to do it…
How it works…
There's more…
See also
Importing dynamic information
Getting ready
How to do it…
How it works…
There's more…
See also
Passing arguments to shell commands
How to do it…
How it works…
4. Working with Files and Packages
Introduction
Making quick edits to config files
Getting ready
How to do it...
How it works…
There's more…
Editing INI style files with puppetlabs-inifile
Getting ready
How to do it...
How it works...
There's more...
Using Augeas to reliably edit config files
How to do it…
How it works…
There's more…
Building config files using snippets
Getting ready
How to do it...
How it works...
Using ERB templates
How to do it…
How it works…
There's more…
See also
Using array iteration in templates
How to do it…
How it works…
There's more…
See also
Using EPP templates
How to do it...
How it works...
There's more...
Using GnuPG to encrypt secrets
Getting ready
How to do it...
How it works...
There's more...
See also
Installing packages from a third-party repository
How to do it…
How it works…
There's more...
Comparing package versions
How to do it…
How it works…
5. Users and Virtual Resources
Introduction
Using virtual resources
How to do it...
How it works...
There's more...
Managing users with virtual resources
How to do it...
How it works...
There's more...
See also
Managing users' SSH access
How to do it...
How it works...
There's more...
Managing users' customization files
How to do it...
How it works...
There's more...
See also
Using exported resources
Getting ready
How to do it...
How it works...
There's more...
6. Managing Resources and Files
Introduction
Distributing cron jobs efficiently
How to do it...
How it works...
There's more...
See also
Scheduling when resources are applied
How to do it...
How it works...
There's more...
Using host resources
How to do it...
How it works...
There's more...
Using exported host resources
Getting ready
How to do it...
How it works...
There's more...
Using multiple file sources
How to do it...
How it works...
There's more...
See also
Distributing and merging directory trees
How to do it...
How it works...
There's more...
Cleaning up old files
How to do it...
How it works...
There's more...
Auditing resources
How to do it...
How it works...
There's more...
See also
Temporarily disabling resources
How to do it...
How it works...
7. Managing Applications
Introduction
Using public modules
How to do it...
How it works...
There's more...
Managing Apache servers
How to do it...
How it works...
Creating Apache virtual hosts
How to do it...
How it works...
There's more...
Creating nginx virtual hosts
How to do it...
How it works...
There's more...
Managing MySQL
How to do it...
How it works...
There's more...
Creating databases and users
How to do it...
How it works...
There's more...
8. Internode Coordination
Introduction
Managing firewalls with iptables
Getting ready
How to do it...
How it works...
There's more...
Building high-availability services using Heartbeat
Getting ready
How to do it…
How it works…
There's more...
Managing NFS servers and file shares
How to do it...
How it works…
Using HAProxy to load-balance multiple web servers
How to do it…
How it works…
There's more...
Managing Docker with Puppet
Getting ready
How to do it...
How it works...
There's more...
9. External Tools and the Puppet Ecosystem
Introduction
Creating custom facts
How to do it...
How it works...
There's more...
See also
Adding external facts
Getting ready
How to do it...
How it works...
There's more...
Debugging external facts
Using external facts in Puppet
See also
Setting facts as environment variables
How to do it...
Generating manifests with the Puppet resource command
How to do it...
There's more...
Generating manifests with other tools
Getting ready
How to do it...
There's more...
Using an external node classifier
Getting ready
How to do it...
How it works...
There's more...
See also
Creating your own resource types
How to do it...
How it works...
There's more...
Documentation
Validation
Creating your own providers
How to do it...
How it works...
There's more...
Creating custom functions
How to do it...
How it works...
There's more...
Testing your puppet manifests with rspec-puppet
Getting ready
How to do it...
How it works...
There's more...
See also
Using librarian-puppet
Getting ready
How to do it...
How it works...
There's more...
Using r10k
Getting ready
How to do it...
How it works...
There's more...
10. Monitoring, Reporting, and Troubleshooting
Introduction
Noop – the don't change anything option
How to do it...
How it works...
There's more...
See also
Logging command output
How to do it...
How it works...
There's more...
Logging debug messages
How to do it...
How it works...
There's more...
Printing out variable values
Resource ordering
Generating reports
How to do it...
How it works...
There's more...
Other report types
See also
Producing automatic HTML documentation
How to do it...
How it works...
There's more...
Drawing dependency graphs
Getting ready
How to do it...
How it works...
There's more...
See also
Understanding Puppet errors
How to do it...
See also
Inspecting configuration settings
How to do it...
How it works...
See also
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜