Skip to content

Instantly share code, notes, and snippets.

@roblayton
Created June 14, 2015 16:19
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 roblayton/c025979ae8ebff8453c4 to your computer and use it in GitHub Desktop.
Save roblayton/c025979ae8ebff8453c4 to your computer and use it in GitHub Desktop.
A Vagrantfile for a MongoDB Replica Set
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.define :primary do |primary|
primary.vm.hostname = "primary"
primary.vm.network "private_network", ip: "192.168.60.10"
primary.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.verbose = "vv"
ansible.sudo = true
end
end
config.vm.define :secondary1 do |secondary1|
secondary1.vm.hostname = "secondary1"
secondary1.vm.network "private_network", ip: "192.168.60.11"
secondary1.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.verbose = "vv"
ansible.sudo = true
end
end
config.vm.define :secondary2 do |secondary2|
secondary2.vm.hostname = "secondary2"
secondary2.vm.network "private_network", ip: "192.168.60.12"
secondary2.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.verbose = "vv"
ansible.sudo = true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment