售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Mastering Chef Provisioning
Table of Contents
Mastering Chef Provisioning
Credits
Foreword
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
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. Setting Up a Development Environment on Your Workstation
Re-introducing Chef
What version of the Chef tools do I use?
References
Filling in the gaps in your Chef knowledge base
Major pieces of a Chef puzzle
The Chef client
The Ohai Chef tool
Recipes and cookbooks
Chef run lists
Chef roles
Chef resources
More things to consider
Data bags
Environments
The Chef supermarket
Chef Development Kit
Setting up an on-premise (private) Chef Server
References
Exploring the Chef Development Kit
The Chef Knife
Community tools
References
Installing Chef Development Kit
Downloading ChefDK
Installing ChefDK
Verifying ChefDK
References
Setting up a standard Chef repo
Using the Chef tool for Chef repo
The repo starter kit
Files for your .chef folder – a safer way
Growing your own tree
Self-signed certificates
References
What else do you need?
Using your favorite editor
Version control systems
Virtualization hypervisor
Vagrant
References
What is chef-apply?
Why is that useful?
References
Summary
2. Knife Tooling and Plugins
Knife help
References
Knife subcommands
Knife Bootstrap
Knife Node
Knife Diff
Knife Exec
Knife SSH
Knife Search
References
Knife to editor integration
Using the "wait" option
Does my editor require the wait option?
References
Knife Windows plugin
Installing the Knife Windows plugin
Bootstrapping a Windows node
Searching for Windows node data
References
Knife EC2 plugin
Installing the Knife EC2 plugin
Creating an EC2 instance
Bootstrapping an existing EC2 instance
Deleting EC2 instances
References
Creating new Knife plugins
The basic plugin file format
Example – A simpler EC2 Create Server plugin
References
Summary
3. Leveraging Roles, Environments, and Policies
Using Chef roles
How to create a role
Using per-environment run-lists in roles
Using nested roles
There is a downside to roles
References
Using Chef environments
The _default environment
Creating environments
Specifying cookbook versions in environments
References
Using Chef organizations
Creating organizations
Access control
References
Learning the attribute precedence hierarchy
Understanding attribute precedence factors
Resulting precedence hierarchy
Exploring policies
What exactly is a policy?
Why would I use a policy?
How do I use a policy?
Another example
How to specify the source options for cookbooks
What are the "Gotchas"?
References
Summary
4. Custom Resources
Out with the old (LWRPs), in with the new (Custom Resources)
What is the difference between the old way and the new way of defining resources?
What is a Custom Resource?
References
Creating an example use case
What is the goal?
Creating the cookbook
Creating the default recipe
The recipe worked, but what is missing?
References
Creating and using a Custom Resource
What makes up a Custom Resource?
Creating the "website" Custom Resource
Using our Custom Resource
References
Making a Custom Resource more reusable
Making a Custom Resource-only cookbook
Reuse the code from the "mywebapp" example
Using the reusable Custom Resource-only cookbook
Handling idempotence
References
Subclassing a Custom Resource
Convert our resource into a library module
Subclassing the library module Custom Resource
References
Summary
5. Provisioning in the Traditional Data Center
VMware provisioning
Installing the knife-vsphere plugin
Provisioning VMs using the knife-vsphere plugin
Cleaning up our vSphere and Chef environments
Using Chef with VMware and Vagrant
References
OpenStack provisioning
Setting up a DevStack OpenStack all-in-one environment
Deploying the DevStack Host VM
Downloading and installing DevStack
Downloading the demo project rc file and applying it
Adding the security rules to allow ping and ssh traffic
Installing the knife OpenStack plugin
Setting up the DevStack public key
Allocating some floating IP addresses to the project
Configuring the knife-openstack plugin knife settings
Adding a CentOS instance image to provision
Provisioning a new instance
References
Network automation
Automating juniper devices
Automating Cisco systems
Automating F5 LTMs
References
Summary
6. Provisioning in the Cloud
Provisioning AWS EC2 instances
Understanding EC2 authentication
Creating key pairs
Creating security groups
Installing Chef Server into an EC2 instance
References
Provisioning Microsoft Azure instances
Installing the knife-azure plugin
Configuring the plugin
Verifying the configuration
Generating public/private key pairs
Provisioning virtual machines
Provisioning a new Chef server into Azure
References
Provisioning in the Google Cloud platform
Installing and configuring the knife-google plugin
Creating and registering your key pairs
Provisioning virtual machines with the GCE
Deploying Chef server into a GCE instance
References
Looking at an honorable mention – Linode
References
Provisioning containers in Docker
Setting up a Docker server to host our containers
Installing and using Docker on our Chef Workstation
Using the knife-docker plugin
References
Summary
7. Test-Driven Development
Analyzing cookbooks with RuboCop
Using RuboCop
Examining the RuboCop output
Customizing RuboCop
References
Analyzing cookbooks with Foodcritic
Using Foodcritic
Examining the Foodcritic output
Customizing Foodcritic
References
Unit testing with ChefSpec
Using ChefSpec
Expanding our tests
References
Integration testing with Kitchen and ServerSpec
Preparing our tests
Kitchen create
Kitchen converge
Kitchen verify
References
Summary
8. Using Chef Provisioning
What is Chef provisioning?
It's highly idempotent
A hypothetical example
References
How to use Chef Provisioning
Chef Provisioning resources
A Vagrant example
A cloud example with AWS
A Docker example
References
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜