• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Vagrant.configure("2") do |config|
2  config.puppet_install.puppet_version = "3.8.4"
3
4  # Base machine config
5  config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
6  config.vm.provider :virtualbox do |virtualbox|
7    virtualbox.customize ["modifyvm", :id, "--memory", "8048"]
8    virtualbox.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
9    virtualbox.customize ["modifyvm", :id, "--cpus", "10"]
10  end
11
12  # Rsync config, triggered on every vagrant refresh
13  config.vm.synced_folder "/usr/local/autotest", "/usr/local/autotest", type: "rsync",
14    owner: "chromoes-test", group: "root",
15    rsync__args: ["--chmod=ug=rwX,o=rxX", "-r"],
16    rsync__exclude: ["site-packages/", "logs/", "results/", "containers/", "shadow_config.ini", ".git/", "chromeos-admin/", "*.box"]
17
18  # Chown autotest, triggered via vagrant provision --provision-with shell
19  config.vm.provision :shell do |shell|
20    shell.inline = "sudo chown -R chromeos-test /usr/local/autotest"
21  end
22
23  # Master config
24  # Port mappings:
25  #  80: tcp port, access the master afe via http://localhost:master_port on host
26  #  3306: mysql port, access the master db via 'mysql --host localhost --port 8002' on host
27  # both these will be autocorrected if the ports are occupied.
28  config.vm.define "%(master)s" do |%(master)s|
29      %(master)s.vm.network "forwarded_port", guest: 80, host: %(master_port)s, auto_correct: true
30      %(master)s.vm.network "forwarded_port", guest: 3306, host: 8002, auto_correct: true
31      %(master)s.vm.box = "chromeos_lab_core_cluster"
32      %(master)s.vm.hostname = "%(master)s"
33      ip = "172.17.8.103"
34      %(master)s.vm.network "private_network", ip: ip
35      %(master)s.vm.provision :puppet do |puppet|
36        puppet.manifests_path = "%(manifest_path)s"
37        puppet.manifest_file = "nodes.pp"
38        puppet.module_path = "%(module_path)s"
39        #puppet.options = "--verbose --debug "
40        puppet.facter = {
41          "is_vagrant" => "1",
42          "server_type" => "testing-shard-master",
43        }
44      end
45  end
46
47  # Shard configs, extend by duplicating this section
48  # Port mappings:
49  #  80: tcp port, access the master afe via http://localhost:shard1_port on host
50  config.vm.define "%(shard1)s" do |%(shard1)s|
51      %(shard1)s.vm.network "forwarded_port", guest: 80, host: %(shard1_port)s, auto_correct: true
52      %(shard1)s.vm.box = "chromeos_lab_core_cluster"
53      %(shard1)s.vm.hostname = "%(shard1)s"
54      ip = "172.17.8.104"
55      %(shard1)s.vm.network "private_network", ip: ip
56      %(shard1)s.vm.provision :puppet do |puppet|
57        puppet.manifests_path = "%(manifest_path)s"
58        puppet.manifest_file = "nodes.pp"
59        puppet.module_path = "%(module_path)s"
60        #puppet.options = "--verbose --debug "
61        puppet.facter = {
62          "is_vagrant" => "1",
63          "shard_hostname" => "%(shard1_shadow_config_hostname)s",
64          "server_type" => "testing-shard",
65        }
66      end
67  end
68end
69