logo资料库

Puppet 5 Cookbook 4th 2018 pdf.pdf

第1页 / 共692页
第2页 / 共692页
第3页 / 共692页
第4页 / 共692页
第5页 / 共692页
第6页 / 共692页
第7页 / 共692页
第8页 / 共692页
资料共692页,剩余部分请下载后查看
Title Page
Copyright and Credits
Puppet 5 Cookbook  Fourth Edition
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Sections
Getting ready
How to do it...
How it works...
There's more...
See also
Get in touch
Reviews
Puppet Language and Style
Introduction
Adding a resource to a node
How to do it...
How it works...
See also...
Using facter to describe a node
How to do it...
How it works...
There's more...
Variables
Scope
Using puppet facts
How to do it...
Installing a package before starting a service
How to do it...
How it works...
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
Installing Puppet
How to do it...
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
Making 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...
elsif 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
Puppet 5 changes
Using the call function
Puppet 4/5 changes
Appending to and concatenating arrays
Merging hashes
Using the sensitive type
Lambda functions
reduce
filter
map
slice
each
Functions in Puppet language
Puppet Infrastructure
Introduction
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...
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
How to do it...
How it works...
There's more...
Environment-specific Hiera
Getting ready
How to do it...
How it works...
Setting node-specific data with Hiera
Getting ready
How to do it...
How it works...
Writing a custom Hiera5 function
Getting ready
How to do it...
How it works...
There's more...
Storing secret data with hiera-eyaml
Getting ready
How to do it...
How it works...
There's more...
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...
Writing Better Manifests
Introduction
Using arrays of resources
How to do it...
How it works...
There's more...
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...
Using data types in Puppet
How to do it...
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...
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 iterations 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
Comparing package versions
How to do it...
How it works...
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...
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 to be 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...
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 MariaDB
How to do it...
How it works...
There's more...
Creating databases and users
How to do it...
How it works...
There's more...
Servers and Cloud Infrastructure
Introduction
Managing firewalls with iptables
Getting ready
How to do it...
How it works...
There's more...
Building high-availability services using Keepalived
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 EC2 instances
Getting ready
How to do it...
How it works...
There's more...
Managing virtual machines with Vagrant
Getting ready
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...
External Tools and the Puppet Ecosystem
Introduction
Creating custom facts
How to do it...
How it works...
There's more...
Adding external facts
Getting ready
How to do it...
How it works...
There's more...
Debugging external facts
Using external facts in Puppet
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 PDK
Getting ready
How to do it...
How it works...
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...
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 the 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...
Resource ordering
Generating reports
How to do it...
How it works...
There's more...
Other report types
See also
Producing automatic HTML documentation
Getting ready...
How to do it...
How it works...
There's more...
Drawing dependency graphs
Getting ready
How to do it...
How it works...
When Puppet looks for the dependencies
There's more...
See also
Understanding Puppet errors
How to do it...
Could not retrieve file metadata for XXX: getaddrinfo: Name or service not known
Could not evaluate: Could not retrieve information from environment production source(s) XXX
Error: Could not set 'file' on ensure: No such file or directory XXX
Change from absent to file failed: Could not set 'file on ensure: No such file or directory
Undefined method 'closed?' for nil:NilClass
Duplicate definition: X is already defined in [file] at line Y; cannot redefine at [file] line Y
See also
Inspecting configuration settings
How to do it...
How it works...
See also
Other Books You May Enjoy
Leave a review - let other readers know what you think
Puppet 5 Cookbook Fourth Edition Jump start your Puppet 5.x deployment using engaging and practical recipes
Thomas Uphill BIRMINGHAM - MUMBAI
Puppet 5 Cookbook Fourth Edition Copyright © 2018 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author , nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Commissioning Editor: Vijin Boricha Acquisition Editor: Namrata Patil Content Development Editor: Deepti Thore Technical Editors: Cymon Pereira, Varsha Shivhare Copy Editor: Safis Editing Project Coordinator: Kinjal Bari Proofreader: Safis Editing Indexer: Tejal Daruwale Soni Graphics: Jisha Chirayil Production Coordinator: Shantanu Zagade First published: October 2011 Second edition: August 2013 Third edition: February 2015 Fourth edition: June 2018 Production reference: 1250618 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78862-244-8 www.packtpub.com
mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe? Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals Improve your learning with Skill Plans built especially for you Get a free eBook or video every month Mapt is fully searchable Copy and paste, print, and bookmark content
PacktPub.com Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktP ub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
分享到:
收藏