Created
March 2, 2014 08:36
-
-
Save toddlers/9303706 to your computer and use it in GitHub Desktop.
vagrant file for aws 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
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