万本电子书0元读

万本电子书0元读

顶部广告

Puppet 4.10 Beginner’s Guide - Second Edition电子书

售       价:¥

75人正在读 | 0人评论 9.8

作       者:John Arundel

出  版  社:Packt Publishing

出版时间:2017-05-31

字       数:230.8万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Puppet is great for developers, system administrators, IT professionals, and anyone laying the foundation for DevOps practices – this comprehensive guide will get you up to speed, all the way from installation to automation to the latest features of Puppet 4.10. About This Book ? Develop skills to run Puppet 4.10 on single or multiple servers without hiccups ? Use Puppet to spin up and manage cloud resources such as Amazon EC2 instances ? Take full advantage of the powerful new features of Puppet 4.10, including loops, data types, structured facts, R10K module management, control repos, and EPP templates Who This Book Is For Puppet Beginner’s Guide, Second Edition is designed for those who are new to Puppet, including system administrators and developers who are looking to manage computer server systems for configuration management. No prior programming or system administration experience is assumed. What You Will Learn ? Covers the latest Puppet 4.10 release ? Install and set up Puppet and discover the latest and most advanced features ? Configure, build, and run containers in production using Puppet’s industry-leading Docker support ? Deploy configuration files and templates at super-fast speeds and manage user accounts and access control ? Automate your IT infrastructure ? Use the latest features in Puppet 4 onward and its official modules ? Manage clouds, containers, and orchestration ? Get to know the best practices to make Puppet more reliable and increase its performance In Detail Puppet 4.10 Beginner’s Guide, Second Edition, gets you up and running with the very latest features of Puppet 4.10, including Docker containers, Hiera data, and Amazon AWS cloud orchestration. Go from beginner to confident Puppet user with a series of clear, practical examples to help you manage every aspect of your server setup. Whether you’re a developer, a system administrator, or you are simply curious about Puppet, you’ll learn Puppet skills that you can put into practice right away. With practical steps giving you the key concepts you need, this book teaches you how to install packages and config files, create users, set up scheduled jobs, provision cloud instances, build containers, and so much more. Every example in this book deals with something real and practical that you’re likely to need in your work, and you’ll see the complete Puppet code that makes it happen, along with step-by-step instructions for what to type and what output you’ll see. All the examples are available in a GitHub repo for you to download and adapt for your own server setup. Style and approach This tutorial is packed with quick step-by-step instructions that are immediately applicable for beginners. This is an easy-to-read guide, to learn Puppet from scratch, that explains simply and clearly all you need to know to use this essential IT power tool, while applying these solutions to real-world scenarios.
目录展开

Puppet Beginner's Guide Second Edition

Table of Contents

Puppet 4.10 Beginner's Guide Second Edition

Credits

About the Author

Acknowledgments

About the Reviewer

www.PacktPub.com

Why subscribe?

Customer Feedback

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. Getting started with Puppet

Why do we need Puppet anyway?

Keeping configuration synchronized

Repeating changes across many servers

Self-updating documentation

Version control and history

Why not just write shell scripts?

Why not just use containers?

Why not just use serverless?

Configuration management tools

What is Puppet?

Resources and attributes

Puppet architectures

Getting ready for Puppet

Installing Git and downloading the repository

Installing Virtualbox and Vagrant

Running your Vagrant VM

Alternative Vagrant VMs

Adding Puppet to your path

Troubleshooting Vagrant

Summary

2. Creating your first manifests

Hello, Puppet – your first Puppet manifest

Understanding the code

Modifying existing files

Dry-running Puppet

How Puppet applies the manifest

Creating a file of your own

Managing packages

How Puppet applies the manifest

Exercise

Querying resources with puppet resource

Services

Getting help on resources with puppet describe

The package-file-service pattern

Notifying a linked resource

Resource ordering with require

Summary

3. Managing your Puppet code with Git

What is version control?

Tracking changes

Sharing code

Creating a Git repo

Making your first commit

How often should I commit?

Branching

Distributing Puppet manifests

Creating a GitHub account and project

Pushing your repo to GitHub

Cloning the repo

Fetching and applying changes automatically

Writing a manifest to set up regular Puppet runs

Applying the run-puppet manifest

The run-puppet script

Testing automatic Puppet runs

Managing multiple nodes

Summary

4. Understanding Puppet resources

Files

The path attribute

Managing whole files

Ownership

Permissions

Directories

Trees of files

Symbolic links

Packages

Uninstalling packages

Installing specific versions

Installing the latest version

Installing Ruby gems

Installing gems in Puppet's context

Using ensure_packages

Services

The hasstatus attribute

The pattern attribute

The hasrestart and restart attributes

Users

Creating users

The user resource

The group resource

Managing SSH keys

Removing users

Cron resources

Attributes of the cron resource

Randomizing cron jobs

Removing cron jobs

Exec resources

Automating manual interaction

Attributes of the exec resource

The user attribute

The onlyif and unless attributes

The refreshonly attribute

The logoutput attribute

The timeout attribute

How not to misuse exec resources

Summary

5. Variables, expressions, and facts

Introducing variables

Using Booleans

Interpolating variables in strings

Creating arrays

Declaring arrays of resources

Understanding hashes

Setting resource attributes from a hash

Introducing expressions

Meeting Puppet's comparison operators

Introducing regular expressions

Using conditional expressions

Making decisions with if statements

Choosing options with case statements

Finding out facts

Using the facts hash

Running the facter command

Accessing hashes of facts

Referencing facts in expressions

Using memory facts

Discovering networking facts

Providing external facts

Creating executable facts

Iterating over arrays

Using the each function

Iterating over hashes

Summary

6. Managing data with Hiera

Why Hiera?

Data needs to be maintained

Settings depend on servers

Operating systems differ

The Hiera way

Setting up Hiera

Adding Hiera data to your Puppet repo

Troubleshooting Hiera

Querying Hiera

Typed lookups

Writing Hiera data

File header

Single values

Boolean values

Arrays

Hashes

Interpolation

The hierarchy

Dealing with multiple values

Merge behaviors

Data sources based on facts

What belongs in Hiera?

Creating resources with Hiera data

Building resources from Hiera arrays

Building resources from Hiera hashes

The advantages of managing resources with Hiera data

Managing secret data

Setting up GnuPG

Setting up hiera-eyaml-gpg

Creating an encrypted secret

How Hiera decrypts secrets

Editing or adding encrypted secrets

Distributing the decryption key

Summary

7. Mastering modules

Using Puppet Forge modules

What is the Puppet Forge?

Finding the module you need

Using r10k

Understanding the Puppetfile

Managing dependencies with generate-puppetfile

Using modules in your manifests

Using puppetlabs/mysql

Using puppetlabs/apache

Using puppet/archive

Exploring the standard library

Safely installing packages with ensure_packages

Modifying files in place with file_line

Introducing some other useful functions

The pry debugger

Writing your own modules

Creating a repo for your module

Writing the module code

Creating and validating the module metadata

Tagging your module

Installing your module

Applying your module

More complex modules

Uploading modules to the Puppet Forge

Summary

8. Classes, roles, and profiles

Classes

The class keyword

Declaring parameters to classes

Automatic parameter lookup from Hiera data

Parameter data types

Available data types

Range parameters

Content type parameters

Flexible data types

Defined resource types

Node definitions, roles, and profiles

Nodes

Roles

Profiles

Summary

9. Managing files with templates

What are templates?

The dynamic data problem

Puppet template syntax

Using templates in your manifests

Referencing template files

Inline templates

Template tags

Computations in templates

Conditional statements in templates

Iteration in templates

Iterating over Facter data

Iterating over structured facts

Iterating over Hiera data

Working with templates

Passing parameters to templates

Validating template syntax

Rendering templates on the command line

Legacy ERB templates

Summary

10. Controlling containers

Understanding containers

The deployment problem

Options for deployment

Introducing the container

What Docker does for containers

Deployment with Docker

Building Docker containers

The layered filesystem

Managing containers with Puppet

Managing Docker with Puppet

Installing Docker

Running a Docker container

Stopping a container

Running multiple instances of a container

Managing Docker images

Building images from Dockerfiles

Managing Dockerfiles

Building dynamic containers

Configuring containers with templates

Self-configuring containers

Persistent storage for containers

Host-mounted volumes

Docker volumes

Networking and orchestration

Connecting containers

Container orchestration

What is orchestration?

What orchestration tools are available?

Running Puppet inside containers

Are containers mini-VMs or single processes?

Configuring containers with Puppet

Containers need Puppet too

Summary

11. Orchestrating cloud resources

Introducing the cloud

Automating cloud provisioning

Using CloudFormation

Using Terraform

Using Puppet

Setting up an Amazon AWS account

Creating an AWS account

Creating an IAM policy

Creating an IAM user

Storing your AWS credentials

Getting ready to use puppetlabs/aws

Creating a key pair

Installing the puppetlabs/aws module

Installing the AWS SDK gem

Creating EC2 instances with Puppet

Choosing an Amazon Machine Image (AMI)

Creating the EC2 instance

Accessing your EC2 instance

VPCs, subnets, and security groups

The ec2_securitygroup resource

The ec2_instance resource

Managing custom VPCs and subnets

Creating an instance in a custom VPC

The ec2_vpc resource

The ec2_vpc_internet_gateway resource

The ec2_vpc_routetable resource

The ec2_vpc_subnet resource

Other AWS resource types

Provisioning AWS resources from Hiera data

Iterating over Hiera data to create resources

Cleaning up unused resources

Summary

12. Putting it all together

Getting the demo repo

Copying the repo

Understanding the demo repo

The control repo

Module management

Nodes

Roles

Profiles

Users and access control

SSH configuration

Sudoers configuration

Time zone and clock synchronization

Puppet configuration

The bootstrap process

Adapting the repo for your own use

Configuring users

Adding node definitions and role classes

Modifying the bootstrap credentials

Bootstrapping a new node

Bootstrapping a Vagrant VM

Bootstrapping physical or cloud nodes

Using other distributions and providers

Summary

The beginning

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部