vagrant-hivemind 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf6137dfb1a1ea4798ff8f91be820359ac113d2a
4
- data.tar.gz: 59ded208cea99ba17c56026756b09fa4c2f463ca
3
+ metadata.gz: 37e005addc8503ba5ab6d4258211d6467da98cc2
4
+ data.tar.gz: cb535a157c3ec342bf9f6f5463bb4f97647e8e0b
5
5
  SHA512:
6
- metadata.gz: 31eb3b3fde613955d41bc54671cdc4fd5502561ba0e081051b667b21e304c6b5021453ad9bedc275686b9ec47a6b72f61df37432806d090e722c0e9a7bfbe263
7
- data.tar.gz: 2e6def42b2df88488b9dbdfe3ce1147fe7b585d3a9f109ba421f61c295d698534347000456449e6fe3315aee3ed76ff12bb9069cc2e18d590e8737021897accc
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
- @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} #{status}"
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
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Hivemind
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -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 "<%= host.is_control %>" == "true"
23
- # Setup Control Machine SSH
24
- # 1. Copy the private key
25
- host_config.vm.provision "file", source: "<%= hivemind_home_path %>/keys/id_rsa", destination: "/home/vagrant/.ssh/id_rsa", run: "once"
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
- # 2. Set the right permissions of the SSH directory and private key
28
- host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/setup-control-ssh.sh", run: "once"
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
- # Setup Ansible in the Control Machine
31
- # 1. Install Ansible from the PPA
32
- host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/install-ansible.sh", run: "once"
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
- # 2. Copy the Ansible hosts file: First to /tmp, next from /tmp to /etc/ansible/hosts using sudo
35
- host_config.vm.provision "file", source: "<%= local_data_path %>/ansible.hosts", destination: "/tmp/ansible.hosts", run: "always"
36
- host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/post-install-ansible.sh", run: "always"
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.2
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-09-29 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler