Chef:Powerful Infrastructure Automation
John Ewart Matthias Marschall Earl Waud更新时间:2021-07-09 21:07:11
最新章节:Indexcoverpage
Chef: Powerful Infrastructure Automation
Credits
Preface
What this learning path covers
What you need for this learning path
Who this learning path is for
Reader feedback
Customer support
Part 1. Module 1
Chapter 1. Installing Chef
Terminology
Working with Chef
Installing a Chef server
Configuring a Chef server
Validating that your service is working
Summary
Chapter 2. Modeling Your Infrastructure
Getting to know Chef
Modeling your infrastructure
Organizing your configuration data
Large-scale infrastructure
Summary
Chapter 3. Integrating with the Cloud
Leveraging the cloud
Summary
Chapter 4. Working with Cookbooks
Attributes
Metadata
Recipes
Resources
Templates
Definitions
Recipes
Writing recipes
Summary
Chapter 5. Testing Your Recipes
Testing recipes
RSpec
RSpec and ChefSpec
Getting started with ChefSpec
Summary
Chapter 6. From Development to Deployment
Describing the setup
Deploying software with Chef
Configuring your local environment
Modeling a simple Python application
Managing the cookbooks
Defining roles
Adding users
Provisioning EC2 instances
Configuring the web server
Deploying your software
Summary
Chapter 7. Beyond Basic Recipes and Cookbooks
Managing users
Writing custom extensions
Working with data bags
Summary
Chapter 8. Extras You Need to Know
Vagrant and Chef-solo
Getting to know the Chef shell
Integration testing
Extending Chef
Automation and integration
Summary
Part 2. Module 2
Chapter 1. Chef Infrastructure
Introduction
Using version control
Installing the Chef development kit on your workstation
Using the hosted Chef platform
Managing virtual machines with Vagrant
Creating and using cookbooks
Inspecting files on your Chef server with knife
Defining cookbook dependencies
Managing cookbook dependencies with Berkshelf
Downloading and integrating cookbooks as vendor branches into your Git repository
Using custom knife plugins
Deleting a node from the Chef server
Developing recipes with local mode
Using roles
Using environments
Freezing cookbooks
Running Chef client as a daemon
Using chef-shell
Chapter 2. Evaluating and Troubleshooting Cookbooks and Chef Runs
Introduction
Testing your Chef cookbooks
Flagging problems in your Chef cookbooks
Test-driven development for cookbooks using ChefSpec
Integration testing your Chef cookbooks with Test Kitchen
Showing affected nodes before uploading cookbooks
Overriding a node's run list to execute a single recipe
Using why-run mode to find out what a recipe might do
Debugging Chef client runs
Inspecting the results of your last Chef run
Raising and logging exceptions in recipes
Diff-ing cookbooks with knife
Using community exception and report handlers
Creating custom handlers
Chapter 3. Chef Language and Style
Introduction
Using community Chef style
Using attributes to dynamically configure recipes
Using templates
Mixing plain Ruby with Chef DSL
Installing Ruby gems and using them in recipes
Using libraries
Using definitions
Creating your own Lightweight Resource Providers (LWRP)
Extending community cookbooks by using application wrapper cookbooks
Creating custom Ohai plugins
Creating custom knife plugins
Chapter 4. Writing Better Cookbooks
Introduction
Setting the environment variables
Passing arguments to shell commands
Overriding attributes
Using search to find nodes
Using data bags
Using search to find data bag items
Using encrypted data bag items
Accessing data bag values from external scripts
Getting information about the environment
Writing cross-platform cookbooks
Finding the complete list of operating systems you can use in cookbooks
Making recipes idempotent by using conditional execution
Chapter 5. Working with Files and Packages
Introduction
Creating configuration files using templates
Using pure Ruby in templates for conditionals and iterations
Installing packages from a third-party repository
Installing software from source
Running a command when a file is updated
Distributing directory trees
Cleaning up old files
Distributing different files based on the target platform
Chapter 6. Users and Applications
Introduction
Creating users from data bags
Securing the Secure Shell Daemon (SSHD)
Enabling passwordless sudo
Managing NTP
Managing nginx
Creating nginx virtual hosts
Creating MySQL databases and users
Managing WordPress sites
Managing Ruby on Rails applications
Managing Varnish
Managing your local workstation
Chapter 7. Servers and Cloud Infrastructure
Introduction
Creating your infrastructure using Chef Provisioning
Creating cookbooks from a running system with Blueprint
Running the same command on many machines at once
Setting up SNMP for external monitoring services
Deploying a Nagios monitoring server
Building high-availability services using heartbeat
Using HAProxy to load-balance multiple web servers
Using custom bootstrap scripts
Managing firewalls with iptables
Managing fail2ban to ban malicious IP addresses
Managing Amazon EC2 instances
Loading your Chef infrastructure from a file with spiceweasel and knife
Part 3. Module 3
Chapter 1. Setting Up a Development Environment on Your Workstation
Re-introducing Chef
Filling in the gaps in your Chef knowledge base
Exploring the Chef Development Kit
Installing Chef Development Kit
Setting up a standard Chef repo
What else do you need?
What is chef-apply?
Summary
Chapter 2. Knife Tooling and Plugins
Knife help
Knife subcommands
Knife to editor integration
Knife Windows plugin
Knife EC2 plugin
Creating new Knife plugins
Summary
Chapter 3. Leveraging Roles Environments and Policies
Using Chef roles
Using Chef environments
Using Chef organizations
Learning the attribute precedence hierarchy
Exploring policies
Summary
Chapter 4. Custom Resources
Out with the old (LWRPs) in with the new (Custom Resources)
Creating an example use case
Creating and using a Custom Resource
Making a Custom Resource more reusable
Subclassing a Custom Resource
Summary
Chapter 5. Provisioning in the Traditional Data Center
VMware provisioning
OpenStack provisioning
Network automation
Summary
Chapter 6. Provisioning in the Cloud
Provisioning AWS EC2 instances
Provisioning Microsoft Azure instances
Provisioning in the Google Cloud platform
Looking at an honorable mention – Linode
Provisioning containers in Docker
Summary
Chapter 7. Test-Driven Development
Analyzing cookbooks with RuboCop
Analyzing cookbooks with Foodcritic
Unit testing with ChefSpec
Integration testing with Kitchen and ServerSpec
Summary
Chapter 8. Using Chef Provisioning
What is Chef provisioning?
How to use Chef Provisioning
Summary
Appendix A. Bibliography
Index
更新时间:2021-07-09 21:07:11