-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
146 lines (113 loc) · 6.12 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# see the documentation at https://www.vagrantup.com/docs/index.html
config.vm.boot_timeout = 150
config.ssh.insert_key = false
rsakey = File.read("vagrant-setup/keys/authorized_keys")
# Replace default Vagrant insecure key with our own key and disable user+password login
config.vm.provision "shell", inline: <<-EOC
echo '#{rsakey}' >> /home/vagrant/.ssh/authorized_keys
sed '/== vagrant insecure public key$/d' /home/vagrant/.ssh/authorized_keys
EOC
config.vm.define "CentOrion" , primary: true do |vs|
# Every Vagrant virtual environment requires a box to build off of.
# This is CentOS 7.5 + VirtualBox Guest Additions 5.1.18
# vs.vm.box = "vagrant-centos-75-x86_64"
# Local copy of CentOs 7.5 Minimal base box created with Packer may need to preffix with full path like C:\\VBoxVMs\\
# vs.vm.box_url = "vagrant-centos-7.5-48G.box"
# This is CentOS 7.6 without VirtualBox Guest Additions
vs.vm.box = "centos/7"
config.vm.box = "centos/7"
config.vm.box_version = "1902.01"
# Parameters for VirtualBox Guest Additions plug-in
# Do not check for VirtualBox Guest Additions updates
config.vbguest.auto_update = false
# do NOT download the iso file from a webserver
config.vbguest.no_remote = true
# Vagrant will need to login once with its own insecure_private_key in order to change it at guest's ~/.ssh/authorized_keys
vs.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', "vagrant-setup/keys/centorion_openssh.key"]
# The shell script that will execute once just after the VM is created
vs.vm.provision "shell", path: "vagrant-setup/setup.sh"
# Create a private network, which allows host-only access to the machine using a specific IP.
vs.vm.network "private_network", ip: "192.168.101.110"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on your network.
# config.vm.network "public_network"
vs.vm.provider "virtualbox" do |vb|
# Enable the GUI of VirtualBox and see whether the VM is waiting for input on startup
vb.gui = false
# Use VBoxManage to customize the VM.
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--memory", "4096"]
end
end
config.vm.define "openshift-master" , autostart: false do |ms|
ms.vm.box = "vagrant-centos-73-x86_64-puppet"
ms.vm.box_url = "https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.3/vagrant-centos-7.3.box"
ms.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', "vagrant-setup/keys/centorion_openssh.key"]
ms.vm.provision "shell", path: "vagrant-setup/setup-openshift-master.sh"
ms.vm.network "private_network", ip: "192.168.101.111"
ms.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end
config.vm.define "openshift-node1" , autostart: false do |nd|
nd.vm.box = "vagrant-centos-73-x86_64-puppet"
nd.vm.box_url = "https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.3/vagrant-centos-7.3.box"
nd.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', "vagrant-setup/keys/centorion_openssh.key"]
nd.vm.provision "shell", path: "vagrant-setup/setup-openshift-node1.sh"
nd.vm.network "private_network", ip: "192.168.101.112"
nd.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`.
config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network :forwarded_port, guest: 22, host: 2210, id: "ssh", auto_correct: true
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file default.pp in the manifests_path directory.
#
# config.vm.provision "puppet" do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "site.pp"
# end
# Share additional folders
# config.vm.synced_folder "host_folder_name", "/home/vagrant/guest_folder_name", type: "virtualbox", group: "vagrant", owner: "vagrant"
# Enable symlinks in shared folders
# config.vm.provider "virtualbox" do |config|
# config.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
# end
# Port forwarding
# config.vm.network "forwarded_port", guest: 1521, host: 1521, auto_correct: true
# Proxy configuration
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://proxyuser:[email protected]:port"
config.proxy.https = "http://proxyuser:[email protected]:port"
config.proxy.no_proxy = "localhost,127.0.0.1"
end
end