O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Chef for Linux and macOS

Video Description

Chef is a popular configuration management tool used to quickly automate an entire fleet of machines. Chef allows you to define repeatable administration patterns in code tailored to your organization's specific needs. While typically deployed in conjunction with a Chef Server, Chef expert Mischa Taylor shows the numerous applications for Chef that do not require a Chef Server.

You will start using Chef to do useful infrastructure automation immediately for your organization. In this course, he shows you how to use Chef to fully automate the configuration of a fleet of Linux and/or macOS development machines and how to validate the configuration "test first" with InSpec. Designed for learners with basic command line interface skills who are new to Chef, the infrastructure automation skills acquired in this course will be completely applicable when you're ready to take on Chef Server.

  • Discover the practical application of Chef without the complexity of needing to configure a Chef Server
  • Understand all the key components of Chef, including its programming language
  • Explore InSpec, the testing and compliance language included with Chef
  • Master skills transferrable to learning enterprise-oriented Chef Server
  • Learn how to use Chef to install Chef
Mischa Taylor is a former consulting engineer at Chef, where he specialized in providing coaching and training on continuous delivery. He currently builds autonomous systems and maintains the Boxcutter open-source project he created. Mischa has worked in IT since 1992 as a DevOps architect, software engineer, developer, and more. He is the author of the O'Reilly titles "Learning Chef" (with Seth Vargo) and "Infrastructure Automation is on the Menu with Chef."

Table of Contents

  1. Introduction
    1. Introduction 00:01:52
    2. Why Chef? 00:02:03
    3. About The Author 00:01:42
  2. Getting Started With The ChefDK
    1. What Is A Chef Development Workstation? 00:02:28
    2. Linux Setup - Installing The ChefDK And Git Source Control 00:06:23
    3. Linux Setup - Installing Atom 00:01:41
    4. Macos Setup - Installing The ChefDK 00:09:24
    5. Macos Setup - Installing Git 00:00:54
    6. Macos Setup - Installing Atom 00:00:59
  3. Your First Chef Program
    1. Why Model Your Infrastructure As Code? 00:00:55
    2. Hello World 00:04:08
    3. Examining Hello.Rb 00:01:46
    4. Linting Code With Cookstyle 00:01:46
    5. Running Cookstyle Within Atom 00:01:56
    6. Automated Verification With Inspec 00:05:07
    7. Resilient Infrastructure With Chef 00:07:00
    8. Handling Uninstalls 00:07:52
    9. Wrapping Up 00:01:02
  4. Getting Started With Test Kitchen
    1. Why Use Test Kitchen? 00:01:11
    2. Test Kitchen And Docker 00:00:58
    3. What If My Machine Can't Run Docker? 00:01:22
    4. What If I Want To Target Macos? 00:01:04
    5. Installing Docker On Linux 00:01:41
    6. Installing Docker On Macos 00:01:27
    7. Docker And Digitalocean 00:04:22
    8. Introducing Test Kitchen 00:07:16
    9. YAML Basics 00:09:12
    10. Validating YAML In Atom 00:02:02
    11. Test Kitchen Configuration File Format Overview 00:09:42
    12. Wrapping Up 00:01:22
  5. How Chef Discovers Information About A System
    1. Why Does Chef Probe Machine Configuration? 00:01:11
    2. What Is A Node? 00:01:48
    3. Chef-Client In Production 00:06:08
    4. Your First Chef-Client Run 00:05:21
    5. Chef-Client Modes 00:01:44
    6. What Is Ohai? 00:03:52
    7. Wrapping Up 00:01:09
  6. Your First Cookbook - Message Of The Day
    1. Why Automate Message Of The Day? 00:01:10
    2. Cookbooks 00:03:38
    3. Your First Chef Run In Test Kitchen 00:05:51
    4. Test First Coding - Part 1 00:15:44
    5. Test First Coding - Part 2 00:08:01
    6. Kitchen Test 00:01:36
    7. Why Files/Default? 00:01:33
    8. Introduction To Regular Expressions 00:06:51
    9. Cookbook Generators 00:10:53
    10. Generator Issues With Copyright Notices 00:04:15
    11. Wrapping Up 00:03:43
  7. Managing Settings With Chef
    1. Why Does Chef Have An Attribute Store? 00:01:04
    2. Accessing And Storing Values 00:01:33
    3. Motd_Attributes Cookbook 00:07:04
    4. Automatic Values 00:00:59
    5. Setting Attributes In Recipes 00:02:58
    6. Setting Values In Attributes 00:03:18
    7. Basic Attribute Priority - Automatic Attributes Rule Them All 00:02:26
    8. Values In Recipes Override Attributes 00:01:09
    9. Last-In Wins At The Same Precedence Level 00:00:51
    10. What If I Have More Than One Attribute File? 00:04:33
    11. Composed Attributes 00:08:01
    12. Include_Recipe 00:02:58
    13. Override Precedence 00:04:54
    14. Attribute Driven Uninstalls 00:14:08
    15. Wrapping Up 00:03:42
  8. Cookbook Authoring And Use
    1. Why Automate Web Server Configuration? 00:02:56
    2. Four Basic Resources 00:01:28
    3. Plan For Development 00:01:26
    4. Cookbook Documentation And Metadata Are Important 00:11:35
    5. Package Resource 00:06:17
    6. Actions Have Defaults 00:01:22
    7. Service Resource 00:03:41
    8. Add Content To The Website 00:04:47
    9. Verifying NGINX On Your Host 00:04:14
    10. Wrapping Up 00:02:27
  9. Cookbook Versioning
    1. Why Versioning? 00:01:41
    2. Versioning The NGINX Cookbook And Communicating Change 00:06:38
    3. Introduction To Git 00:09:03
    4. Sharing Source On Github 00:06:43
    5. Cookbook Pipelines With Travis CI 00:16:13
    6. Managing NGINX.Conf - Breaking Change 00:17:10
    7. Zero Downtime - Enhancement 00:08:44
    8. Wrapping Up 00:03:00
  10. Automated Validation With Inspec
    1. Why Automate Validation? 00:01:32
    2. Scanning A Docker Node With A Hardening Profile 00:07:43
    3. Scanning A Node With A Hardening Profile Via SSH 00:03:10
    4. Scanning A Local Machine With Inspec 00:02:14
    5. Formatting Modes 00:03:22
    6. Control Resource 00:03:40
    7. Describe Block 00:02:56
    8. Its Form 00:00:48
    9. Wrapping Up 00:01:32
  11. Compliance Profile Authoring And Use
    1. Why Translate Compliance Policy Into Code? 00:02:21
    2. Your First Compliance Profile 00:01:03
    3. Creating The Initial Structure And Metadata 00:04:52
    4. Make Tests Fail As You Are Writing Them 00:03:20
    5. Introducing Match 00:02:00
    6. Variable Regular Expressions 00:03:29
    7. Adding Ruby Code To A Control 00:14:15
    8. Packaging Ruby Code In A Custom Matcher 00:09:53
    9. Wrapping Up 00:00:44
  12. Compliance Profiles In Cookbooks
    1. Why Use Inspec With Test Kitchen? 00:01:16
    2. Remote Inspec Profiles 00:03:03
    3. Bringing Node Into Compliance Guided By Tests 00:02:35
    4. Wrapping Up 00:01:03
  13. Capturing Machine Configurations With HashiCorp Packer
    1. Automating Config Of The OS Itself 00:02:50
    2. Host Versus Guest 00:00:53
    3. Host Setup 00:05:38
    4. Creating A Linux Desktop Virtual Machine 00:03:24
    5. Installing Ubuntu 16.04 Desktop 00:11:50
    6. Capturing The Linux Desktop VM With Packer 00:13:15
    7. Verifying The Linux Desktop VM 00:06:38
    8. Creating A Macos Virtual Machine 00:09:24
    9. Installing Macos 00:11:40
    10. Capturing The Macos VM With Packer 00:11:03
    11. Verifying The Macos VM 00:06:11
    12. Wrapping Up 00:01:10
  14. Real-World Example: Manage Your Development Environment With Chef
    1. Why Use Chef To Chef Up Your Chef? 00:01:41
    2. Planning The Cookbooks 00:02:49
    3. Creating The Chef_Workstation Wrapper Cookbook 00:09:30
    4. Berkshelf And Dependency Management 00:08:22
    5. Introducing The Depends Statement And Semantic Versioning 00:08:44
    6. Performing Chef Runs Locally 00:11:40
    7. Git Cookbook 00:16:13
    8. Atom Cookbook 00:12:25
    9. ChefDK Cookbook 00:21:43
    10. Final Local Chef Run 00:03:11
    11. Wrapping Up 00:02:10
  15. Troubleshooting Chef
    1. Troubleshooting Chef 00:00:48
    2. Introducing Chef-Shell 00:05:46
    3. Interactive Debugging with Chef-Shell 00:10:36
    4. Profiling 00:04:07
  16. Where To Go Next
    1. Wrap Up 00:03:50