learn how to start cooking with chef!

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

Upload: czw2pv

Post on 15-Aug-2015

264 views

Category:

Technology


1 download

TRANSCRIPT

Spark the future.

May 4 – 8, 2015Chicago, IL

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

Fredrik NilssonPrincipal Consultant - InfrastructureCrayon

Email: [email protected]

Blog: moln1.wordpress.com

Twitter: @FredrikNilsson_

Bork! Bork! Bork!

Sweden

Cooking

+

AgendaWhat is Chef?

How do I get started?

Where can I learn more?

What is 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

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

How do I get started?

Microsoft Virtual Academy

Learn Chef

Learn the Chef basics

Learn to manage a node

Learn to manage a basic web application

Learn the Chef fundamentals

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/

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

Microsoft Azure Publish Settings

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

Start your free trial of hosted Chef

https://manage.chef.io/signup

Download Starter Kit

Chef Workstation

• 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

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"

Install Chef Development Kit (ChefDK)

IMPORTANT

• 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

Powershell# Install Knife-Azurechef gem install knife-azure

# List avalible image listknife azure image list

# Creating a Cookbookchef generate cookbook webserver

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

Powershell# Creating a templatechef generate template webserver Default.htm

# Upload the Cookbook to the Chef Serverknife cookbook upload webserver

Demo

Fredrik Nilsson

Where can I learn more?

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

© 2015 Microsoft Corporation. All rights reserved.