Vagrantfile 1.32 KB
Newer Older
1
2
3
4
5
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
6
7
  # config.vm.box = "ubuntu/wily64"
  # config.vm.box = "sgallen/wily64"
8
9
10
11
  # config.vm.box = "ubuntu/vivid64"
  # config.vm.box = "relativkreativ/centos-7-minimal"
  # config.vm.box = "box-cutter/fedora22"
  # config.vm.box = "puppetlabs/centos-6.6-64-nocm"
12
  # config.vm.box = "debian/jessie64"
13
14
15
16
17

  BOX_COUNT = 1
  (1..BOX_COUNT).each do |machine_id|
    config.vm.define "influx#{machine_id}" do |machine|
      machine.vm.hostname = "influx#{machine_id}"
18
      machine.vm.network "private_network", type: "dhcp"
19
      # machine.vm.network "public_network"
20
      # machine.vm.network "public_network", :bridge => 'en0: Wi-Fi (AirPort)'
21
22
      
      machine.vm.provider "virtualbox" do |v|
23
        v.memory = 1024
24
25
26
27
28
29
30
        v.cpus = 1
      end

      if machine_id == BOX_COUNT
        machine.vm.provision "ansible" do |ansible|
          # ansible.verbose = 'vvvv'
          ansible.limit = 'all'
31
32
33
34
35
          if BOX_COUNT > 1
            ansible.playbook = "test.yml"
          else
            ansible.playbook = "cluster-test.yml"
          end
36
37
          ansible.sudo = true
          ansible.host_key_checking = false
38
39
40
          ansible.extra_vars = {
            is_vagrant: true,
          }
41
42
43
44
45
46
        end
      end
      
    end
  end
end