Skip to content

Instantly share code, notes, and snippets.

@thommay
Created July 29, 2015 16:30
Show Gist options
  • Save thommay/153681df62bc012da685 to your computer and use it in GitHub Desktop.
Save thommay/153681df62bc012da685 to your computer and use it in GitHub Desktop.
require 'chef/provisioning/aws_driver'
with_driver 'aws:default:us-west-1'
with_chef_server "https://api.opscode.com/organizations/spincycle",
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
node.set['ssh_key'] = 'thom_spincycle'
aws_key_pair node['ssh_key'] do
private_key_path ::File.expand_path("~/.ssh/#{node['ssh_key']}")
end
machine_batch 'base' do
machines 'windows_base', 'ubuntu_base', 'freebsd_base', 'omnios_base'
action :destroy
ignore_failure true
end
machine 'windows_base' do
machine_options convergence_options: { chef_version: '12.4.1' }, #install_msi_url: "https://opscode-omnibus-packages.s3.amazonaws.com/windows/2008r2/x86_64/chef-client-12.4.1-1.msi" },
bootstrap_options: { image_id: 'ami-876983c3', instance_type: 'm3.medium', key_name: node['ssh_key']}, is_windows: true
action :converge
converge true
run_list ['recipe[stress::windows_base]']
end
machine 'ubuntu_base' do
machine_options convergence_options: { chef_version: '12.4.1' }, bootstrap_options: {key_name: node['ssh_key']}
action :converge
converge true
run_list ['recipe[stress::ubuntu_base]']
end
machine 'omnios_base' do
machine_options convergence_options: { chef_version: '12.4.1' }, bootstrap_options: {key_name: node['ssh_key'], image_id: 'ami-5b786d1e', instance_type: 'm3.medium'}, ssh_username: 'root'
action :converge
converge true
recipe 'stress::sugar'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment