Skip to content

Instantly share code, notes, and snippets.

@toddlers
Created March 2, 2014 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddlers/9303706 to your computer and use it in GitHub Desktop.
Save toddlers/9303706 to your computer and use it in GitHub Desktop.
vagrant file for aws provisioning
Vagrant.configure("2") do |config|
config.vm.provider :aws do |aws|
aws.access_key_id = ###
aws.secret_access_key = ###
aws.keypair_name = ###
aws.ssh_private_key_path = ###
aws.region = 'us-east-1'
aws.security_groups = ####
aws.ami = 'ami-3fec7956'
aws.instance_type = 'm1.small'
aws.ssh_username = 'ubuntu'
end
config.ssh.username = "ubuntu" # this breaks the `virtualbox` provider
$provision_script= <<SCRIPT
if [[ $(which chef-solo) != '/usr/bin/chef-solo' ]]; then
curl -L https://www.opscode.com/chef/install.sh | sudo bash
echo 'export PATH="/opt/chef/embedded/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile
fi
SCRIPT
config.vm.provision :shell, :inline => $provision_script
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["site-cookbooks","cookbooks"]
chef.roles_path = "roles"
chef.data_bags_path = "data_bags"
chef.add_role "base"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment