• New to Chef and Puppet ?
Overview of Chef and Puppet and how they can automate infrastructure and
application deployment on Azure.
• Existing Chef/Puppet Users?
Learn about extending Chef & Puppet to Azure.
• Other automated VM customization options?
Learn about VM customization using standard scripts.
•
•
•
•
Mastering Chef/Puppet DSL.
Writing cookbooks/modules.
Azure IaaS components.
DevOps workflows and tooling.
Provision/
Manage
Infrastructure
Bootstrap
Agents
Customize VM
Workflow
Author the
scripts
Scripting Languages Supported:
Linux : Ruby, Python,, Bash, perl
Windows : PowerShell, DSC
Upload them to
Azure Storage
or GitHub
Deploy them to
a remote VM –
New or running
CLI Supported:
Azure CLI or Azure Powershell
Managing Azure VMs
using Knife
Bootstrapping chef
agent using Chef
Extension
Leveraging DSC
resources using Chef
Chef Server Account:
 Sign up for Hosted Chef account :
https://manage.opscode.com/signup
Setting up Chef Workstation:
 Download the starter kit from Chef server.
 Setup the workstation by downloading the chef-client :
https://www.getchef.com/download-chef-client/
 Install knife azure : gem install knife-azure
The workstation is now ready to manage VMs in Azure!
 Create a VM :
Download publish settings file from here :
https://manage.windowsazure.com/publishsettings/index?client=powershell
Knife azure image list --azure-publish-settings-file '/path/to/your/cert.publishsettingsfile'
knife azure server create
--azure-publish-settings-file '/path/to/your/cert.publishsettingsfile'
--azure-dns-name 'myservice'
--azure-source-image 'windows-image-name'
--ssh-user ‘testuser'
--ssh-password ‘azuredemo'
--azure-service-location "West US"
Azure Powershell :
Set-AzureVMChefExtension-VM <IPersistentVM> -ValidationPem <Validator.pem> ClientRb <Client.rb> -RunList <RunList>
Knife Command:
knife azure server create --azure-dns-name 'knifetest2' --bootstrap-protocol 'cloud-api‘ -azure-source-image '3422a428aaf14529884165693cbb90d3__DreamFactory_1.7.8-0__Ubuntu_14.04' --azure-service-location 'West US' --ssh-user 'kundanap' --ssh-password
'Azuredemo4'
https://learn.chef.io/
https://www.chef.io/partners/microsoft/
 Admins who manage a mix of both windows and linux deployments can leverage DSC using Chef.
 Preview of DSC cookbook which exposes DSC resources as Chef resources is available :
https://supermarket.getchef.com/cookbooks/dsc
 All the DSC resources returned by get-dscresource can be managed by Chef using the cookbook.
 Simple rules for transforming DSC resource into Chef resource published here :
https://github.com/opscode-cookbooks/dsc/blob/master/README.md
What is Puppet? : Puppet is a configuration management system that
allows you to define the state of your IT infrastructure, then automatically
enforces the correct state.
Key Concepts:
- Supports easy to read declarative language.
- Enforces desired state on the system.
- Puppet Forge supports many ready to use modules.
Manifest : A file containing code written in the Puppet language,& managing
infrastructure and applications. Manifest contains resources and classes.
Resources : A unit of configuration, whose state can be managed by Puppet.
Module : A collection of classes, resource types, files, and templates, organized around a
particular purpose.
Catalog : A catalog is a document that describes the desired system state for one specific
computer. Catalogs are compiled from manifests by a puppet master server and served to
agent nodes.
Provisioning using
Puppet Azure module
Bootstrapping puppet
agent using Puppet
Extension
Leveraging DSC
resources using
Puppet
Puppet Commands for Azure VM provisioning
puppet module install msopentech-microsoftazure
puppet azure_vm create \
#>
--management-certificate pem-or-pfx-file-path \
--azure-subscription-id=your-subscription-id \
--image b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_04amd64-server-20130501-en-us-30GB \
--location 'west us' \
--vm-name vmname \
--vm-user username \
--password ComplexPassword \
--puppet-master-ip yourPuppetMasterIPAddress
Bootstrapping Puppet
agent on Azure VMs.
Step1 : Setting up Puppet Master:

Select the Puppet Master Image from Azure Gallery . Note : Provide a lowercase cloud service & vm name for the Puppet
Master.

Add the following end points on the Puppet Master VM:
443 for HTTPS
8140 for Puppet
61613 for MCollective

Browse to the Puppet master VM and retrieve the user name and password for PE console:

Wait for 10 mins and login to PE console : https://<cloudservicename>.cloudapp.net
Setting up Puppet agent from the Azure Portal

Select any windows VM, add Puppet extension with input : puppetmastername.cloudapp.net
Setting up Puppet Agent from Azure Powershell:
Set-AzureVMPuppetExtension –PuppetMasterServer $puppetmaster –VM $vm
https://puppetlabs.com/
http://puppetlabs.com/sites/default/files/Getting-Started-GuidePuppet-Enterpise-Azure.pdf
https://forge.puppetlabs.com/msutter/dsc
Descargar

Leverage Existing Chef / Puppet Toolsets for Management