Created
July 11, 2013 11:32
-
-
Save pidah/5974672 to your computer and use it in GitHub Desktop.
deploy multiple (in this case 2) AWS instances in different regions in a single Vagrantfile
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.require_plugin "vagrant-aws" | |
Vagrant.configure("2") do |config| | |
config.vm.define :usa do |usa_config| | |
usa_config.vm.provider :aws do |aws, override| | |
override.vm.box = "ubuntu_aws" | |
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" | |
override.ssh.private_key_path = ".vagrant/web.pem" | |
override.ssh.username = "ubuntu" | |
aws.keypair_name = "web" | |
aws.instance_type = "t1.micro" | |
aws.security_groups = "web" | |
aws.region = "us-east-1" | |
aws.ami = "ami-c5afc2ac" | |
aws.tags = { | |
'Name' => 'usa webserver', | |
} | |
end | |
usa_config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "puppet/manifests" | |
puppet.manifest_file = "init.pp" | |
puppet.options = ["--verbose"] | |
end | |
end | |
config.vm.define :eu do |eu_config| | |
eu_config.vm.provider :aws do |aws, override| | |
override.vm.box = "ubuntu_aws" | |
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" | |
override.ssh.private_key_path = ".vagrant/multi.pem" | |
override.ssh.username = "ubuntu" | |
aws.keypair_name = "multi" | |
aws.instance_type = "t1.micro" | |
aws.security_groups = "default" | |
aws.region = "eu-west-1" | |
aws.ami = "ami-ce7b6fba" | |
aws.tags = { | |
'Name' => 'eu server', | |
} | |
end | |
eu_config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "puppet/manifests" | |
puppet.manifest_file = "init.pp" | |
puppet.options = ["--verbose"] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment