Mastering Chef
eBook - ePub

Mastering Chef

Mayank Joshi

Share book
  1. 374 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Chef

Mayank Joshi

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Chef an online PDF/ePUB?
Yes, you can access Mastering Chef by Mayank Joshi in PDF and/or ePUB format, as well as other popular books in Informatique & Développement de logiciels. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781783981564

Mastering Chef


Table of Contents

Mastering Chef
Credits
About the Author
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. Introduction to the Chef Ecosystem
Different modes of running Chef
Terminology used in the world of Chef
The anatomy of a Chef run
A Chef run using chef-client
Step 1 – Building a node object
Step 2 – Authenticate
Step 3 – Synchronization of cookbooks
Step 4 – Loading of cookbooks and convergence
Step 5 – Reporting and exception handling
Using chef-solo
Setting up a work environment
Summary
2. Knife and Its Associated Plugins
Introducing Knife
Managing cookbooks
Creating a new cookbook
Uploading a cookbook to chef-server
Getting the list of all the cookbooks on chef-server
Deleting cookbooks
Downloading a cookbook
Deleting multiple cookbooks
Managing environments
Creating an environment
Deleting an environment
Editing an environment
Listing all environments
Displaying information about an environment
Managing roles
Creating a new role
Deleting a role
Editing a role
Listing all available roles
Displaying information about a role
Managing nodes
Creating a node
Listing all available nodes
Displaying information about a node
Editing a node
Adding stuff to the run_list associated with a node
Deleting stuff from the run_list associated with a node
Deleting a node object
Managing an API client
Creating a new client
Listing all available API clients
Displaying information about a client
Deleting an existing client
Reregistering a client
The search command
Bootstrapping a node
Some useful Knife plugins
The knife-ssh plugin
The knife-ec2 plugin
The knife-azure plugin
The knife-google plugin
The knife-push plugin
Summary
3. Chef and Ruby
Ruby
IRB
Variables and types
Symbols
Basic operations
Arithmetic operators
Comparison operators
Assignment operators
Bitwise operators
Logical operators
The Ruby ternary operator
Ruby range operators
The Ruby defined? operator
Conditional statements and loops
The if statement
The unless statement
The case/when statement
The while loop
The until loop
The for loop
Methods
Blocks
Arrays
Creating an array
Accessing elements of an array
Adding elements to an array
Removing elements from an array
Iterating over an array
Selecting elements of an array
The nondestructive way
The destructive way
Bang methods
Hashes
Creating hashes
Iterating over a hash
Classes and objects
What's an object and a class?
Modules
Summary
4. Controlling Access to Resources
The bootstrap process
Authentication
chef-client
Knife
Custom API calls
Authorization
The Open Source Chef server
Enterprise Chef
Object permissions
Groups
Summary
5. Starting the Journey to the World of Recipes
Resources
Guard attributes
Lazy evaluation of attributes
The package resource
The cookbook_file resource
The directory resource
The file resource
The execute resource
The cron resource
The service resource
The bash resource
The template resource
Helper modules
Inline methods
Inline modules
Library modules
Partial templates
Recipes
Attributes
Types of attributes
Including recipes
The run_list
Recipe DSL methods
The platform method
The platform_family method
The value_for_platform method
The value_for_platform_family method
The attribute method
The resources method
Best practices when writing recipes
Summary
6. Cookbooks and LWRPs
Cookbooks
Authoring a cookbook
Uploading a cookbook to the Chef server
Deleting a cookbook
Testing a cookbook
Cookbook versioning
Operators available for use with versioning
Freezing versions
Maintaining multiple versions of cookbooks
Maximum version control strategy
Branch tracking strategy
Custom resources
Setup
Resource
Provider
Provider DSL
Logging
Summary
7. Roles and Environments
Managing roles
Using Knife
Creating a new role
Editing an existing role
Deleting an existing role
Showing details about an existing role
Listing all roles on the Chef server
Using Ruby DSL
Using a JSON file
Using the Chef API
Using the Chef server WebUI
Managing environments
Using Knife
Creating a new environment
Editing an environment configuration
Deleting an environment
Displaying all the environments configured on the Chef server
Showing details associated with an environment
Comparing cookbook versions across environments
Creating or editing an environment using the configuration specified in a file
Using Ruby DSL
Setting up an environment on a node
Using ...

Table of contents