-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
46 lines (40 loc) · 1.91 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- mode: ruby -*-
# vi: set ft=ruby :
# solr node 01/02 needs to change '127.0.0.1 sbsstgsolr01' to '192.168.33.21 sbsstgsolr01' in /etc/hosts file.
nodes = {
'demobox' => '192.168.33.11',
}
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility).
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
nodes.each do |node, nodeip|
config.vm.define node do |nodeconfig|
nodeconfig.vm.hostname = node
nodeconfig.vm.network "private_network", ip: nodeip
nodeconfig.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
nodeconfig.vm.synced_folder "./", "/opt/demo-immutable-infrastructure"
nodeconfig.vm.provision "shell", inline: <<-SHELL
sudo echo "# proxy environment vars" > /etc/profile.d/sbs_proxy.sh
sudo echo "export http_proxy=http://10.21.160.105:8080" >> /etc/profile.d/sbs_proxy.sh
sudo echo "export https_proxy=http://10.21.160.105:8080" >> /etc/profile.d/sbs_proxy.sh
sudo echo "export HTTP_PROXY=http://10.21.160.105:8080" >> /etc/profile.d/sbs_proxy.sh
sudo echo "export HTTPS_PROXY=http://10.21.160.105:8080" >> /etc/profile.d/sbs_proxy.sh
sudo chmod 644 /etc/profile.d/sbs_proxy.sh
echo 'Acquire::http::Proxy "http://10.21.160.105:8080";' | sudo tee -a /etc/apt/apt.conf
wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
sudo dpkg -i puppetlabs-release-trusty.deb
sudo apt-get update
sudo apt-get install puppet -y
SHELL
end
end
end