CHEF - by Scott Russel
-
Upload
kangaroot -
Category
Technology
-
view
133 -
download
1
Transcript of CHEF - by Scott Russel
Agenda
• Overview • Chef Software Platform • Building Blocks • Automation Patterns
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.
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
Building Blocks
Cookbooks
Recipes
Resources
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:
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:
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.
Environments
Building Blocks
Roles
Cookbooks
Recipes
Resources
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]
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:
Data_Bags Environments
Building Blocks
Roles
Cookbooks
Recipes
Resources
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
Automation Patterns
IT Automation
Click to Compute
CI/CD
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
Thank You – Questions?