Skip to content

Instantly share code, notes, and snippets.

@atsuya046
Created December 31, 2013 05:23
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 atsuya046/8192949 to your computer and use it in GitHub Desktop.
Save atsuya046/8192949 to your computer and use it in GitHub Desktop.
Vagrantfile for EC2 Ubuntu instance.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Uncomment these lines (and the ones in the generated Gemfile) if you want
# to live on the Edge:
#
# Vagrant.require_plugin "vagrant-berkshelf"
# Vagrant.require_plugin "vagrant-omnibus"
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.omnibus.chef_version = :latest
config.ssh.forward_agent = true
config.ssh.username = 'ubuntu'
config.ssh.private_key_path = '~/.ssh/nobus_key.pem'
config.vm.provider :aws do |aws, override|
aws.access_key_id = 'XXXXXXXXXXXXXXXXXXXXXX'
aws.secret_access_key = 'XXXXXXXXXXXXXXXXXXXXXX'
aws.keypair_name = 'nobus_key'
aws.instance_type = 't1.micro'
aws.region = 'ap-northeast-1'
aws.ami = 'ami-3f32ac3e'
aws.availability_zone = 'ap-northeast-1c'
aws.security_groups = ['webservice']
aws.tags = {
'Name' => 'vagrant-test',
'Description' => 'vagrant test'
}
end
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["./cookbooks"]
chef.add_recipe "apt"
chef.add_recipe "git"
chef.add_recipe "nginx"
chef.json = {
"nginx" => {
"worker_processes" => 4,
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment