Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
Till Westmann | 0f6ee0a | 2015-10-02 17:10:19 -0700 | [diff] [blame] | 4 | # Licensed to the Apache Software Foundation (ASF) under one |
| 5 | # or more contributor license agreements. See the NOTICE file |
| 6 | # distributed with this work for additional information |
| 7 | # regarding copyright ownership. The ASF licenses this file |
| 8 | # to you under the Apache License, Version 2.0 (the |
| 9 | # "License"); you may not use this file except in compliance |
| 10 | # with the License. You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, |
| 15 | # software distributed under the License is distributed on an |
| 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 17 | # KIND, either express or implied. See the License for the |
| 18 | # specific language governing permissions and limitations |
| 19 | # under the License. |
| 20 | |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 21 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
| 22 | VAGRANTFILE_API_VERSION = "2" |
| 23 | |
| 24 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 25 | |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 26 | config.vm.provision "file", source: "id_rsa", destination: "/home/vagrant/.ssh/id_rsa" |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 27 | config.vm.provision "file", source: "id_rsa.pub", destination: "/home/vagrant/.ssh/id_rsa.pub" |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 28 | config.vm.provision "file", source: "known_hosts", destination: "/home/vagrant/.ssh/known_hosts" |
| 29 | config.vm.provision "file", source: "hosts", destination: "/home/vagrant/hosts" |
| 30 | |
| 31 | config.vm.provision "shell", inline: "mv /home/vagrant/hosts /etc/hosts" |
| 32 | config.vm.provision "shell", privileged: false, inline: "chmod 400 /home/vagrant/.ssh/id_rsa" |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 33 | config.vm.provision "shell", privileged: false, inline: "cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys" |
| 34 | config.vm.provision "shell", privileged: false, inline: "chmod 600 /home/vagrant/.ssh/authorized_keys" |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 35 | $java_inst = <<-END |
| 36 | wget -q --no-cookies --no-check-certificate \ |
| 37 | --header 'Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie' \ |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 38 | 'http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm' \ |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 39 | -O /tmp/jdk.rpm; |
| 40 | |
| 41 | sudo yum -y localinstall /tmp/jdk.rpm; |
| 42 | sudo yum -y install unzip; |
| 43 | |
| 44 | END |
| 45 | config.vm.provision "shell", inline: $java_inst |
| 46 | |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 47 | config.vm.define "nc2" do |nc| |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 48 | nc.vm.box = "bento/centos-6.7" |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 49 | nc.vm.hostname = "nc2" |
| 50 | nc.vm.network "private_network", ip: "10.10.0.4" |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 51 | config.vm.provider "virtualbox" do |v| |
| 52 | v.memory = 3096 |
| 53 | v.cpus = 2 |
| 54 | end |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 55 | end |
| 56 | config.vm.define "nc1" do |nc| |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 57 | nc.vm.box = "bento/centos-6.7" |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 58 | nc.vm.hostname = "nc1" |
| 59 | nc.vm.network "private_network", ip: "10.10.0.3" |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 60 | config.vm.provider "virtualbox" do |v| |
| 61 | v.memory = 3096 |
| 62 | v.cpus = 2 |
| 63 | end |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 64 | end |
| 65 | |
| 66 | config.vm.define "cc" do |cc| |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 67 | cc.vm.box = "bento/centos-6.7" |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 68 | cc.vm.hostname = "cc" |
| 69 | cc.vm.network "private_network", ip: "10.10.0.2" |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 70 | config.vm.provider "virtualbox" do |v| |
| 71 | v.memory = 1024 |
| 72 | v.cpus = 1 |
| 73 | end |
Ian | f869bc3 | 2014-05-13 17:11:48 -0700 | [diff] [blame] | 74 | end |
| 75 | |
| 76 | end |