David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.configure(2) do |config| |
| 5 | |
| 6 | if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil |
| 7 | config.vm.synced_folder ".", "/maasdev", mount_options: ["dmode=700,fmode=600"] |
| 8 | else |
| 9 | config.vm.synced_folder ".", "/maasdev" |
| 10 | end |
| 11 | |
| 12 | config.vm.define "maasdev" do |d| |
| 13 | d.vm.box = "ubuntu/trusty64" |
| 14 | d.vm.hostname = "maasdev" |
| 15 | d.vm.network "private_network", ip: "10.100.198.200" |
| 16 | d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
| 17 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /maasdev/ansible/maasdev.yml -c local" |
| 18 | d.vm.provider "virtualbox" do |v| |
| 19 | v.memory = 2048 |
| 20 | end |
| 21 | end |
| 22 | |
| 23 | config.vm.define "prod" do |d| |
| 24 | d.vm.box = "ubuntu/trusty64" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 25 | d.vm.synced_folder '.', '/vagrant', disable: true |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 26 | d.vm.hostname = "prod" |
| 27 | d.vm.network "private_network", ip: "10.100.198.201" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 28 | d.vm.network "private_network", ip: "10.1.0.1", virtualbox__intnet: "cord-test-network" |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 29 | d.vm.provider "virtualbox" do |v| |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 30 | v.memory = 2048 |
| 31 | end |
| 32 | end |
| 33 | |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 34 | config.vm.define "switch" do |s| |
| 35 | s.vm.box = "ubuntu/trusty64" |
| 36 | s.vm.hostname = "fakeswitch" |
| 37 | s.vm.network "private_network", ip: "10.100.198.253" |
| 38 | s.vm.network "private_network", |
| 39 | type: "dhcp", |
| 40 | virtualbox__intnet: "cord-test-network", |
| 41 | mac: "cc37ab000001" |
| 42 | s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
| 43 | s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /maasdev/ansible/fakeswitch.yml -c local" |
| 44 | s.vm.provider "virtualbox" do |v| |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 45 | v.memory = 1048 |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 46 | v.name = "fakeswitch" |
| 47 | end |
| 48 | end |
| 49 | |
| 50 | (1..3).each do |i| |
| 51 | config.vm.define "compute_node#{i}" do |c| |
| 52 | c.vm.box = "clink15/pxe" |
| 53 | c.vm.synced_folder '.', '/vagrant', disable: true |
| 54 | c.vm.communicator = "none" |
| 55 | c.vm.hostname = "computenode" |
| 56 | c.vm.network "private_network", |
| 57 | adapter: "1", |
| 58 | type: "dhcp", |
| 59 | auto_config: false, |
| 60 | virtualbox__intnet: "cord-test-network" |
| 61 | c.vm.provider "virtualbox" do |v| |
| 62 | v.name = "compute_node#{i}" |
| 63 | v.memory = 1048 |
| 64 | v.gui = "true" |
| 65 | end |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 66 | end |
| 67 | end |
| 68 | |
| 69 | if Vagrant.has_plugin?("vagrant-cachier") |
| 70 | config.cache.scope = :box |
| 71 | end |
David K. Bainbridge | 6e23ac8 | 2016-12-07 12:55:41 -0800 | [diff] [blame^] | 72 | |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 73 | end |