blob: 781a4da4e2fa7ed5ba28aed148f86de0d8e8e9ae [file] [log] [blame]
Ianf869bc32014-05-13 17:11:48 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
Till Westmann0f6ee0a2015-10-02 17:10:19 -07004# 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
Ianf869bc32014-05-13 17:11:48 -070021# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
22VAGRANTFILE_API_VERSION = "2"
23
24Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
Ian Maxonf7b64532015-12-09 17:28:18 -080025
Ianf869bc32014-05-13 17:11:48 -070026 config.vm.provision "file", source: "id_rsa", destination: "/home/vagrant/.ssh/id_rsa"
Ian Maxonf7b64532015-12-09 17:28:18 -080027 config.vm.provision "file", source: "id_rsa.pub", destination: "/home/vagrant/.ssh/id_rsa.pub"
Ianf869bc32014-05-13 17:11:48 -070028 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 Maxonf7b64532015-12-09 17:28:18 -080033 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"
Ianf869bc32014-05-13 17:11:48 -070035 $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 Maxonf7b64532015-12-09 17:28:18 -080038 'http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm' \
Ianf869bc32014-05-13 17:11:48 -070039 -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
Ianf869bc32014-05-13 17:11:48 -070047 config.vm.define "nc2" do |nc|
Ian Maxonf7b64532015-12-09 17:28:18 -080048 nc.vm.box = "bento/centos-6.7"
Ianf869bc32014-05-13 17:11:48 -070049 nc.vm.hostname = "nc2"
50 nc.vm.network "private_network", ip: "10.10.0.4"
Ian Maxonf7b64532015-12-09 17:28:18 -080051 config.vm.provider "virtualbox" do |v|
52 v.memory = 3096
53 v.cpus = 2
54 end
Ianf869bc32014-05-13 17:11:48 -070055 end
56 config.vm.define "nc1" do |nc|
Ian Maxonf7b64532015-12-09 17:28:18 -080057 nc.vm.box = "bento/centos-6.7"
Ianf869bc32014-05-13 17:11:48 -070058 nc.vm.hostname = "nc1"
59 nc.vm.network "private_network", ip: "10.10.0.3"
Ian Maxonf7b64532015-12-09 17:28:18 -080060 config.vm.provider "virtualbox" do |v|
61 v.memory = 3096
62 v.cpus = 2
63 end
Ianf869bc32014-05-13 17:11:48 -070064 end
65
66 config.vm.define "cc" do |cc|
Ian Maxonf7b64532015-12-09 17:28:18 -080067 cc.vm.box = "bento/centos-6.7"
Ianf869bc32014-05-13 17:11:48 -070068 cc.vm.hostname = "cc"
69 cc.vm.network "private_network", ip: "10.10.0.2"
Ian Maxonf7b64532015-12-09 17:28:18 -080070 config.vm.provider "virtualbox" do |v|
71 v.memory = 1024
72 v.cpus = 1
73 end
Ianf869bc32014-05-13 17:11:48 -070074 end
75
76end