CHEF - by Scott Russel

17
Agenda Overview Chef Software Platform Building Blocks Automation Patterns

Transcript of CHEF - by Scott Russel

Page 1: CHEF - by Scott Russel

Agenda

•  Overview •  Chef Software Platform •  Building Blocks •  Automation Patterns

Page 2: CHEF - by Scott Russel

Overview

•  Chef is an automation framework that enables Infrastructure as Code

•  Chef leverages reusable definitions to automate desired state

•  Chef is API driven

•  Chef supports Linux variants, Unix variants, AIX and Windows, all as first class citizens.

Page 3: CHEF - by Scott Russel

The Chef Software Platform

Chef Development Kit

Cookbook and Policy Authoring

Test-Driven Infrastructure

Chef Server

Management Console

Analytics Platform

High Availability and Replication

Chef Client Nodes

Data Center

The Cloud

Page 4: CHEF - by Scott Russel

Building Blocks

Cookbooks

Recipes

Resources

Page 5: CHEF - by Scott Russel

Building Blocks: What is a Resource?

•  A Resource is a system state you define •  Example: Package installed, state of a service, configuration file existing

•  You declare what state you want the resource in. •  Chef automatically determines HOW that state is achieved

On Linux based OSes: On Windows based OSes:

Page 6: CHEF - by Scott Russel

Building Blocks: What is a Recipe?

•  A recipe is a collection of Resources •  Resources are executed in the order they are listed.

On Linux based OSes: On Windows based OSes:

Page 7: CHEF - by Scott Russel

Building Blocks: What is a Cookbook?

•  A cookbook is a set of recipes •  A cookbook is a defined set of items

and different outcomes that you expect to address •  A cookbook could have a recipe to install

apache2/httpd but also another set of recipes to activate modules required.

Page 8: CHEF - by Scott Russel

Environments

Building Blocks

Roles

Cookbooks

Recipes

Resources

Page 9: CHEF - by Scott Russel

Building Blocks: What is a role?

•  Define reusable roles for Infrastructure Code

chef_type:                      role  default_attributes:      my-­‐app:          application:              package:          mysite-­‐A.tar.gz              package_sum:  73e5cf3287e4d903d3828da5be1ab228ea33152447551b4e489e659268f643b2              package_url:  http://demo-­‐framework.s3.amazonaws.com/mysite-­‐A.tar.gz  description:                  Role  for  a  myapp  webserver  env_run_lists:  json_class:                    Chef::Role  name:                                myapp_A_webserver  override_attributes:  run_list:      recipe[my-­‐app::application]      recipe[my-­‐app::webserver]  

Page 10: CHEF - by Scott Russel

Building Blocks: What is an Environment?

•  Define a reusable environments for Infrastructure Code

chef_type:                      environment  cookbook_versions:      database:  2.2.0    default_attributes:      myapp:          version:  1.2.3  description:                  for  development  nodes  json_class:                    Chef::Environment  name:                                development  override_attributes:  

Page 11: CHEF - by Scott Russel

Data_Bags Environments

Building Blocks

Roles

Cookbooks

Recipes

Resources

Page 12: CHEF - by Scott Russel

Building Blocks: What is a Data_Bag?

•  Define global variables accessible to all the things

deploy_key:      cipher:                  aes-­‐256-­‐cbc      encrypted_data:  lIpW3sqd69wXt7+MB+uGXr0GfcrEf6rOnHLMA7H00ZCbTxMcEypguGD22w23      qzEZSzCf2ahv67CtcfrDGvUoWS57Gp5/QoR4WBYKQQUplY0LPtXMZFDISCLU      a0aNhrzrXhT9eDKNpru7hpuEkOZPRNstx1121bdMZ9lm1/6BPBeIWUYrxAeS      .  .  .  .  .  .  .  .  .  .  .  .  .  .          iv:                          tpz6zFz9xkscoi36kRw4JQ==        version:                1  id:                  jenkins_ssh_key  

Page 13: CHEF - by Scott Russel

Automation Patterns

IT Automation

Click to Compute

CI/CD

Page 14: CHEF - by Scott Russel
Page 15: CHEF - by Scott Russel

Additional Resources

http://learn.chef.io/ getchef.com docs.opscode.com Email [email protected] Twitter @Chef Install Chef http://getchef.com/chef/install Chef Cookbooks supermarket.getchef.com Chefdk - Chef Development Kit https://downloads.getchef.com/chef-dk/ YouTube youtube.com/getchef Community Site community.opscode.com Freenode IRC #chef, #chef-hacking, #openstack-chef

Page 16: CHEF - by Scott Russel

Thank You – Questions?

Page 17: CHEF - by Scott Russel