Giter Site home page Giter Site logo

chef-provisioning-azure's Introduction

![Gitter](https://badges.gitter.im/Join Chat.svg)

chef-provisioning-azure

This is an implementation of an Microsoft Azure driver for chef-provisioning that relies on azure-sdk-for-ruby and the Azure Service Management API.

What does it do?

It can provision and converge a host on Azure with a recipe like the following:

Linux

require 'chef/provisioning/azure_driver'
with_driver 'azure'

machine_options = {
    :bootstrap_options => {
      :cloud_service_name => 'chefprovisioning', #required
      :storage_account_name => 'chefprovisioning', #required
      :vm_size => "Standard_D1", #required
      :location => 'West US', #required
      :tcp_endpoints => '80:80' #optional
    },
    :image_id => 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_1-LTS-amd64-server-20140927-en-us-30GB', #required
    # Until SSH keys are supported (soon)
    :password => "chefm3t4l\\m/" #required
}

machine 'toad' do
  machine_options machine_options
end

Windows

The following example creates a Windows Server 2012 R2 VM from the public OS image gallery, then the uses the public WinRM/s port to bootstrap the server.

require 'chef/provisioning/azure_driver'
with_driver 'azure'

machine_options = {
    :bootstrap_options => {
      :vm_user => 'localadmin', #required if Windows
      :cloud_service_name => 'chefprovisioning', #required
      :storage_account_name => 'chefprovisioning', #required
      :vm_size => 'Standard_D1', #optional
      :location => 'West US', #optional
      :tcp_endpoints => '3389:3389', #optional
      :winrm_transport => { #optional
        'https' => { #required (valid values: 'http', 'https')
          :disable_sspi => false, #optional, (default: false)
          :basic_auth_only => false, #optional, (default: false)
          :no_ssl_peer_verification => true #optional, (default: false)
        }
      }
    },
    :password => 'P2ssw0rd', #required
    :image_id => 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201502.01-en.us-127GB.vhd' #required
}

machine 'toad' do
  machine_options machine_options
end

Supported Features

  • Automatic creation and teardown of Cloud Services
  • Public (OS) images and captured User (VM) images
  • Up to date (March 2015) VM sizes including 'D', 'DS', 'G', A10/A11 sizes.
  • Custom TCP/UDP endpoints per VM role
  • Linux VMs, SSH external bootstrap via cloud service endpoint
  • Windows VMs, WinRM bootstrap via cloud service endpoint

Currently untested/Known issues

  • Load-balanced sets
  • Availability sets/Fault domains
  • Cloud Service autoscaling
  • Endpoint monitoring
  • Additional disk volumes
  • Affinity groups
  • Direct server return IP addresses
  • Reserved/Static IP addresses
  • Virtual network allocation
  • Bootstrap via internal (private) addresses
  • Non-IaaS Azure services (e.g CDN/TrafficManager, Service Bus, Azure SQL Database, Media Services, Redis Cache)

Currently you have to specify the password you want the initial user to have in your recipe. No, this will not be for very long.

Getting started

The gem is installed into Chef's default Ruby via RubyGems:

chef gem install chef-provisioning-azure

Setting your credentials (v0.3 and above)

  • If you have previously connected to your Azure subscription using the azure-cli tools and imported your publishsettings, you do not need to do anything else the driver will read your profile information and certificates from ~/.azure/azureProfile.json
  • Alternatively, we support any of the methods listed in configuration to set the driver up with access to your subscription
  • Note that the use of ~/.azure/config to configure the driver is no longer supported.

Setting your credentials (v0.2.1 and below)

Put the right values in ~/.azure/config so that it looks like the following:

[default]
management_certificate = "/Users/YOU/.azure/azure.pem"
subscription_id = "YOUR_SUBSCRIPTION_ID"

If you need to generate a certificate for Azure on OSX / Linux you can do it with the following:

openssl req \
  -x509 -nodes -days 365 \
  -newkey rsa:1024 -keyout azure.pem -out azure.pem

followed by conversion to the DER format for Azure:

openssl x509 -inform pem -in azure.pem -outform der -out azure.cer

chef-provisioning-azure's People

Contributors

jkeiser avatar johnewart avatar stuartpreston avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.