vagrant-hivemind 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant/hivemind/commands/desc.rb +1 -0
- data/lib/vagrant/hivemind/commands/list.rb +3 -2
- data/lib/vagrant/hivemind/commands/morph.rb +8 -0
- data/lib/vagrant/hivemind/commands/spawn.rb +6 -1
- data/lib/vagrant/hivemind/host.rb +2 -1
- data/lib/vagrant/hivemind/version.rb +1 -1
- data/templates/Vagrantfile.erb +18 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37e005addc8503ba5ab6d4258211d6467da98cc2
|
4
|
+
data.tar.gz: cb535a157c3ec342bf9f6f5463bb4f97647e8e0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa3bf6452dfb1f4d2a369de2901813a0c39731960dcc6ca7964a8ac820c72efbc1295e42780ab30badc447aaae590251072736e470746060599712358fc87b7
|
7
|
+
data.tar.gz: fc57c480818d6eda514e92566b47ee8a2d3cccddaac2ba8090ae4e7bc956ad5e88341753117e730761af62af462885828eedf942cb3cc21a9214db9f65c5dbda
|
@@ -64,6 +64,7 @@ module Vagrant
|
|
64
64
|
@env.ui.info "Box Size : #{BOX_SIZES[host.box_size.to_sym][:name]} (#{BOX_SIZES[host.box_size.to_sym][:memory_in_mb]}MB)"
|
65
65
|
@env.ui.info "Box Type : #{BOX_TYPES[host.box_type.to_sym][:name]} (#{BOX_TYPES[host.box_type.to_sym][:box_id]})"
|
66
66
|
@env.ui.info "GUI Machine : #{BOX_TYPES[host.box_type.to_sym][:is_gui] ? 'Yes' : 'No'}"
|
67
|
+
@env.ui.info "Detached Data : #{host.is_data_detached ? 'Yes' : 'No'}"
|
67
68
|
@env.ui.info ""
|
68
69
|
|
69
70
|
if host.forwarded_ports and !host.forwarded_ports.empty?
|
@@ -62,7 +62,7 @@ module Vagrant
|
|
62
62
|
|
63
63
|
Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, sorted_hosts, root_path
|
64
64
|
|
65
|
-
@env.ui.info "Hostname IP Address C Size Box Type G Status"
|
65
|
+
@env.ui.info "Hostname IP Address C Size Box Type G D Status"
|
66
66
|
sorted_hosts.values.each do |host|
|
67
67
|
status = ""
|
68
68
|
with_target_vms(host.hostname) do |machine|
|
@@ -74,7 +74,8 @@ module Vagrant
|
|
74
74
|
box_size = BOX_SIZES[host.box_size.to_sym][:name]
|
75
75
|
box_type = BOX_TYPES[host.box_type.to_sym][:name]
|
76
76
|
is_gui_y_n = BOX_TYPES[host.box_type.to_sym][:is_gui] ? 'Y' : 'N'
|
77
|
-
|
77
|
+
is_data_detached_y_n = host.is_data_detached ? 'Y' : 'N'
|
78
|
+
@env.ui.info "#{'%-20.20s' % hostname} #{'%-14.14s' % ip_address} #{is_control_y_n} #{'%-12.12s' % box_size} #{'%-10.10s' % box_type} #{is_gui_y_n} #{is_data_detached_y_n} #{status}"
|
78
79
|
end
|
79
80
|
@env.ui.info ""
|
80
81
|
|
@@ -44,6 +44,10 @@ module Vagrant
|
|
44
44
|
options[:forwarded_port] = p
|
45
45
|
end
|
46
46
|
|
47
|
+
o.on("-D", "--detach-data", "Detach the Drone's data directory as a synced folder to the host") do |d|
|
48
|
+
options[:detach] = d
|
49
|
+
end
|
50
|
+
|
47
51
|
o.on("-d", "--directory DIRECTORY", "Specify the directory where '#{HIVE_FILE}' is located (default: current directory)") do |d|
|
48
52
|
options[:directory] = []
|
49
53
|
options[:directory] << d
|
@@ -118,6 +122,10 @@ module Vagrant
|
|
118
122
|
end
|
119
123
|
end
|
120
124
|
|
125
|
+
if options[:detach]
|
126
|
+
host.is_data_detached = true
|
127
|
+
end
|
128
|
+
|
121
129
|
hosts.delete options[:hostname]
|
122
130
|
drone = {
|
123
131
|
options[:hostname] => host
|
@@ -40,6 +40,10 @@ module Vagrant
|
|
40
40
|
options[:type] = t
|
41
41
|
end
|
42
42
|
|
43
|
+
o.on("-D", "--detach-data", "Detach the Drone's data directory as a synced folder to the host") do |d|
|
44
|
+
options[:detach] = d
|
45
|
+
end
|
46
|
+
|
43
47
|
o.on("-d", "--directory DIRECTORY", "Specify the directory where '#{HIVE_FILE}' is located (default: current directory)") do |d|
|
44
48
|
options[:directory] = []
|
45
49
|
options[:directory] << d
|
@@ -80,7 +84,8 @@ module Vagrant
|
|
80
84
|
{
|
81
85
|
is_control: options[:control],
|
82
86
|
box_size: options[:size],
|
83
|
-
box_type: options[:type]
|
87
|
+
box_type: options[:type],
|
88
|
+
is_data_detached: options[:detach]
|
84
89
|
})
|
85
90
|
}
|
86
91
|
HiveFile.write_to hosts.merge(drone), root_path
|
@@ -3,7 +3,7 @@ require_relative "constants"
|
|
3
3
|
module Vagrant
|
4
4
|
module Hivemind
|
5
5
|
class Host
|
6
|
-
attr_accessor :hostname, :ip_address, :is_control, :box_size, :box_type, :forwarded_ports
|
6
|
+
attr_accessor :hostname, :ip_address, :is_control, :box_size, :box_type, :forwarded_ports, :is_data_detached
|
7
7
|
@control = nil
|
8
8
|
|
9
9
|
def initialize(hostname, ip_address, options = {})
|
@@ -13,6 +13,7 @@ module Vagrant
|
|
13
13
|
@box_size = options[:box_size] || :small.to_s
|
14
14
|
@box_type = options[:box_type] || :server.to_s
|
15
15
|
@forwarded_ports = []
|
16
|
+
@is_data_detached = options[:is_data_detached] || false
|
16
17
|
end
|
17
18
|
|
18
19
|
def self.control
|
data/templates/Vagrantfile.erb
CHANGED
@@ -14,27 +14,32 @@ Vagrant.configure(2) do |config|
|
|
14
14
|
|
15
15
|
host_config.vm.synced_folder "<%= cache_path %>/cache/hivemind", "/var/cache/hivemind", create: true
|
16
16
|
host_config.vm.synced_folder "<%= cache_path %>/cache/apt", "/var/cache/apt/archives", create: true
|
17
|
+
|
18
|
+
<% if host.is_data_detached %>
|
19
|
+
host_config.vm.synced_folder "<%= path %>/data/<%= host.hostname %>", "/var/data", create: true
|
20
|
+
<% end %>
|
21
|
+
|
17
22
|
host_config.vm.provision "shell", run: "once" do |s|
|
18
23
|
s.path = "<%= hivemind_home_path %>/scripts/setup-hostname.sh"
|
19
24
|
s.args = ["<%= host.hostname %>"]
|
20
25
|
end
|
21
26
|
|
22
|
-
if
|
23
|
-
|
24
|
-
|
25
|
-
|
27
|
+
<% if host.is_control %>
|
28
|
+
# Setup Control Machine SSH
|
29
|
+
# 1. Copy the private key
|
30
|
+
host_config.vm.provision "file", source: "<%= hivemind_home_path %>/keys/id_rsa", destination: "/home/vagrant/.ssh/id_rsa", run: "once"
|
26
31
|
|
27
|
-
|
28
|
-
|
32
|
+
# 2. Set the right permissions of the SSH directory and private key
|
33
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/setup-control-ssh.sh", run: "once"
|
29
34
|
|
30
|
-
|
31
|
-
|
32
|
-
|
35
|
+
# Setup Ansible in the Control Machine
|
36
|
+
# 1. Install Ansible from the PPA
|
37
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/install-ansible.sh", run: "once"
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
39
|
+
# 2. Copy the Ansible hosts file: First to /tmp, next from /tmp to /etc/ansible/hosts using sudo
|
40
|
+
host_config.vm.provision "file", source: "<%= local_data_path %>/ansible.hosts", destination: "/tmp/ansible.hosts", run: "always"
|
41
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/post-install-ansible.sh", run: "always"
|
42
|
+
<% end %>
|
38
43
|
|
39
44
|
# Setup Drone SSH
|
40
45
|
# 1. Copy the Control Machine public key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-hivemind
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nap Ramirez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|