Top Banner
park the future. May 4 – 8, 2015 Chicago, IL
32

Learn how to start cooking with Chef!

Aug 15, 2015

Download

Technology

czw2pv
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Learn how to start cooking with Chef!

Spark the future.

May 4 – 8, 2015Chicago, IL

Page 2: Learn how to start cooking with Chef!

Learn how to start cooking with Chef!Fredrik NilssonPrincipal Consultant - InfrastructureCrayon – The Software Experts

Page 3: Learn how to start cooking with Chef!

Fredrik NilssonPrincipal Consultant - InfrastructureCrayon

Email: [email protected]

Blog: moln1.wordpress.com

Twitter: @FredrikNilsson_

Bork! Bork! Bork!

Sweden

Cooking

+

Page 4: Learn how to start cooking with Chef!

AgendaWhat is Chef?

How do I get started?

Where can I learn more?

Page 5: Learn how to start cooking with Chef!

What is Chef?

Page 6: Learn how to start cooking with Chef!

Terms used in ChefKnife: Command line tool to manage infrastructure and bootstrap chef.

Resource:Fundamental building block, a piece of the system and it’s desired state

Recipe:A recipe is a collection of resources

Cookbook : Collection of recipes for managing the resource

Runlist: A policy which needs to be applied on the node

Page 7: Learn how to start cooking with Chef!

Click icon to add picture

Chef OverviewChef ServerCentral store for Cookbooks and Policy settingsChef management console

Node(s)A chef-client is installed on every node that is under management by ChefPulls data from the Chef Server

WorkstationDeveloping cookbooks and recipesKnife CMD line tool

AnalyticsRealtime visabilityVerify Compliance

Page 8: Learn how to start cooking with Chef!

How do I get started?

Page 9: Learn how to start cooking with Chef!

Microsoft Virtual Academy

Page 10: Learn how to start cooking with Chef!

Learn Chef

Page 11: Learn how to start cooking with Chef!

Learn the Chef basics

Page 12: Learn how to start cooking with Chef!

Learn to manage a node

Page 13: Learn how to start cooking with Chef!

Learn to manage a basic web application

Page 14: Learn how to start cooking with Chef!

Learn the Chef fundamentals

Page 15: Learn how to start cooking with Chef!

Getting startedMicrosoft Virtual Academy - Managing Your Systems on Microsoft Azure with Chef http://www.microsoftvirtualacademy.com/training-courses/managing-your-systems-on-microsoft-azure-with-chef

Learn Chefhttps://learn.chef.io/

Page 16: Learn how to start cooking with Chef!

Create a folder structure # Create Directories for Chef WorkstationNew-Item -ItemType directory -Path C:\Chef\Cookbooks

Page 17: Learn how to start cooking with Chef!

Microsoft Azure Publish Settings

https://manage.windowsazure.com/publishsettings/

Page 18: Learn how to start cooking with Chef!

Start your free trial of hosted Chef

https://manage.chef.io/signup

Page 19: Learn how to start cooking with Chef!

Download Starter Kit

Page 20: Learn how to start cooking with Chef!

Chef Workstation

Page 21: Learn how to start cooking with Chef!

• Open the file in your editor of choice and modify the /../ from the “cookbook_path”

cookbook_path ["#{current_dir}/cookbooks"] knife[:azure_publish_settings_file] = "yourfilename.publishsettings”

Add the line knife[:azure_publish_settings_file] = "yourfilename.publishsettings”

Edit Knife.rbKnife-Azure

Page 22: Learn how to start cooking with Chef!

Knife.rb# See https://docs.chef.io/config_rb_knife.html for more information on knife

configuration optionscurrent_dir = File.dirname(__FILE__)log_level :infolog_location STDOUTnode_name "czw2pv“client_key "#{current_dir}/czw2pv.pem“validation_client_name "ignitedemo-validator“validation_key "#{current_dir}/ignitedemo-validator.pem“chef_server_url https://api.opscode.com/organizations/ignitedemocookbook_path ["#{current_dir}/cookbooks"]knife[:azure_publish_settings_file] = "Visual Studio Premium with MSDN-4-22-2015-credentials.publishsettings"

Page 23: Learn how to start cooking with Chef!

Install Chef Development Kit (ChefDK)

Page 24: Learn how to start cooking with Chef!

IMPORTANT

Page 25: Learn how to start cooking with Chef!

• Confirm that these three variables1. C:\opscode\chefdk\bin;2. C:\opscode\chefdk\embedded\bin;3. C:\users\yourusername\.chefdk\gem\ruby\2.1.0\bin

NOTE THE ORDER OF THE PATH IS IMPORTANTC:\opscode\chefdk\bin;C:\opscode\chefdk\embedded\bin;C:\users\yourusername\.chefdk\gem\ruby\2.1.0\bin

Verify System Environment VariablePath

Page 26: Learn how to start cooking with Chef!

Powershell# Install Knife-Azurechef gem install knife-azure

# List avalible image listknife azure image list

# Creating a Cookbookchef generate cookbook webserver

Page 27: Learn how to start cooking with Chef!

default.rbpowershell_script 'Install IIS' do action :run code 'add-windowsfeature Web-Server' end service 'w3svc' do action [ :enable, :start ] end template 'c:\inetpub\wwwroot\Default.htm' do source 'Default.htm.erb‘ rights :read, 'Everyone' end

Page 28: Learn how to start cooking with Chef!

Powershell# Creating a templatechef generate template webserver Default.htm

# Upload the Cookbook to the Chef Serverknife cookbook upload webserver

Page 29: Learn how to start cooking with Chef!

Demo

Fredrik Nilsson

Page 30: Learn how to start cooking with Chef!

Where can I learn more?

Page 31: Learn how to start cooking with Chef!

More Chef resourcesIgnite SessionsBRK3722 Managing Linux and Windows on Microsoft Azure with ChefThursday, May 7 9:00am - 10:15am

LinksChef + Microsoft Azure https://www.chef.io/solutions/azure/Using Chef to Manage Azure Resources https://msopentech.com/blog/2014/03/31/using-chef-to-manage-azure-resources/Microsoft Virtul Academy - Managing Your Systems on Microsoft Azure with Chef http://www.microsoftvirtualacademy.com/training-courses/managing-your-systems-on-microsoft-azure-with-chefMicrosoft Open technologieshttp://msopentech.comGit Hubhttps://github.com/chef/knife-azure

Page 32: Learn how to start cooking with Chef!

© 2015 Microsoft Corporation. All rights reserved.