Skip to content

Commit

Permalink
Added a bunch of machines to vagrant's cluster-a
Browse files Browse the repository at this point in the history
  • Loading branch information
kontsevoy committed Jun 22, 2016
1 parent ff02b6c commit 4dc8534
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 43 deletions.
12 changes: 8 additions & 4 deletions vagrant/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
DOCKER_VER ||= "1.10.3"

NODES ||= {
"a-auth" => ["10.0.10.10", "auth-a", "cluster-a"],
"a-node" => ["10.0.10.12"],
"b-auth" => ["10.0.10.20", "auth-b", "cluster-b"],
"a-auth" => ["a-auth", "10.0.10.10", "auth-a", "cluster-a"],
"b-auth" => ["b-auth", "10.0.10.20", "auth-b", "cluster-b"],
"web-1" => ["a-node", "10.0.10.12"],
"web-2" => ["a-node", "10.0.10.13"],
"redis" => ["a-node", "10.0.10.14"],
"postgres-1" => ["a-node", "10.0.10.15"],
"postgres-2" => ["a-node", "10.0.10.16"],
}


Expand Down Expand Up @@ -62,7 +66,7 @@ def apt_update(vm)

# basic/recommended configuration of every machine:
def basic_config(vm)
hosts = NODES.map { |hostname, array| "#{array[0]} #{hostname} #{array[1,5].join(" ")}" }.join("\n")
hosts = NODES.map { |hostname, array| "#{array[1]} #{hostname} #{array[1,5].join(" ")}" }.join("\n")
bashrc="/home/vagrant/.bashrc"
vm.provision "shell", inline: <<-SHELL
if ! grep -q "git-core" #{bashrc} ; then
Expand Down
2 changes: 1 addition & 1 deletion vagrant/data/opt/a-auth/teleport.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Auth for cluster-A
teleport:
nodename: auth-a
nodename: a-auth
log:
output: stderr
severity: INFO
Expand Down
1 change: 0 additions & 1 deletion vagrant/data/opt/a-node/teleport.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Node for cluster-A
teleport:
nodename: node-a
auth_token: hello
auth_servers: [a-auth]
log:
Expand Down
2 changes: 1 addition & 1 deletion vagrant/data/opt/b-auth/teleport.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Auth for cluster-B
teleport:
nodename: auth-b
nodename: b-auth
log:
output: stderr
severity: INFO
Expand Down
1 change: 0 additions & 1 deletion vagrant/data/var/a-node/host_uuid

This file was deleted.

1 change: 0 additions & 1 deletion vagrant/data/var/a-node/node.cert

This file was deleted.

27 changes: 0 additions & 27 deletions vagrant/data/var/a-node/node.key

This file was deleted.

10 changes: 7 additions & 3 deletions vagrant/libvirt/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Vagrant.configure(2) do |config|
config.vm.synced_folder "../../", "/home/vagrant/teleport", type: "9p", disabled: false, accessmode: "mapped"

NODES.each do |role, array|
addr = array[0]
conf = array[0]
addr = array[1]
config.vm.define role do |config|
config.vm.hostname = role
config.vm.network "private_network", ip: addr
Expand All @@ -34,8 +35,11 @@ Vagrant.configure(2) do |config|
vb.cpus = 1
vb.memory = 512
end
config.vm.synced_folder "../data/opt/#{role}", "/opt/teleport", type: "9p", disabled: false, accessmode: "mapped"
config.vm.synced_folder "../data/var/#{role}", "/var/lib/teleport", type: "rsync", disabled: false
config.vm.synced_folder "../data/opt/#{conf}", "/opt/teleport", type: "9p", disabled: false, accessmode: "mapped"
data_dir = "../data/var/#{conf}"
if File.directory? data_dir
config.vm.synced_folder(data_dir, "/var/lib/teleport", type: "rsync", disabled: false)
end
end
end
end
Expand Down
13 changes: 9 additions & 4 deletions vagrant/virtualbox/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,21 @@ Vagrant.configure(2) do |config|
config.vm.synced_folder "../../", "/home/vagrant/teleport"

NODES.each do |role, array|
addr = array[0]
conf = array[0]
addr = array[1]
config.vm.define role do |config|
config.vm.hostname = role
config.vm.network "private_network", ip: addr
config.vm.provider "virtualbox" do |vb|
vb.cpus = 1
vb.memory = 512
vb.memory = 380
end

config.vm.synced_folder "../data/opt/#{conf}", "/opt/teleport", disabled: false, accessmode: "mapped"
data_dir = "../data/var/#{conf}"
if File.directory? data_dir
config.vm.synced_folder(data_dir, "/var/lib/teleport", type: "rsync", disabled: false)
end
config.vm.synced_folder "../data/opt/#{role}", "/opt/teleport", disabled: false, accessmode: "mapped"
config.vm.synced_folder "../data/var/#{role}", "/var/lib/teleport", type: "rsync", disabled: false
end
end
end
Expand Down

0 comments on commit 4dc8534

Please sign in to comment.