Created
March 25, 2015 13:02
-
-
Save vinyar/0fa5c2d5941eed07f16f to your computer and use it in GitHub Desktop.
Creating Azure instance with Chef-Provisioning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: chef-provisioning-azure | |
# Recipe:: default | |
# | |
# Copyright 2015, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
require 'chef/provisioning/azure_driver' | |
with_driver 'azure' | |
machine_options = { | |
:bootstrap_options => { | |
# :cloud_service_name => 'chefprovisioning', #required - old | |
:cloud_service_name => 'alexvcloudservice02', #required | |
# :storage_account_name => 'chefprovisioning', #required | |
:storage_account_name => 'alexvstorageacct02', #required | |
:vm_size => "Small", #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 => "chefm3t4lB/la\\" #required | |
} | |
machine 'alexvtrashbox01' do | |
machine_options machine_options | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/provisioning/azure_driver' | |
with_driver 'azure' | |
machine_options = { | |
:bootstrap_options => { | |
# :cloud_service_name => 'chefprovisioning', #required - old | |
:cloud_service_name => 'alexvcloudservice02', #required | |
# :storage_account_name => 'chefprovisioning', #required | |
:storage_account_name => 'alexvstorageacct02', #required | |
:vm_size => "Small", #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 => "chefm3t4lB/la\\" #required | |
} | |
machine 'alexv1' do | |
machine_options machine_options | |
action :destroy | |
end | |
machine 'alexvtrashbox01' do | |
machine_options machine_options | |
action :destroy | |
end | |
machine_batch do | |
machines search(:node, '*:*').map { |n| n.name } | |
action :destroy | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment