vagrant-hivemind 0.1.0 → 0.1.1

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: 4c3b4c2537093dc19552e98f59d64035fc3db33a
4
- data.tar.gz: 0c8d6696b1ef82cbf6f1195e069efca02c3daa2e
3
+ metadata.gz: fbc7ad19fffd3117b449f2375bfc24b2054e0b91
4
+ data.tar.gz: 39feb3717137c923ce7f07842d4b6c0331fa089a
5
5
  SHA512:
6
- metadata.gz: 48dc022959f8fe55d220b0b4f3b517ef12d2ac435e331e93280886530856c137a50a2dbc623b347cafc7a9fc692c59954fae0025eab8402644fb572913e8bba4
7
- data.tar.gz: 075b6dc55ae51b244eb8746273fae21a398415bb3527a3f5f0660f2151a14646b0168ba0c3854717ab77ec887f70f55026ccbcb2283c2c0aa3c9bbe826f9ba3a
6
+ metadata.gz: 9696a0b1966d02876f214b3c5b2595cdfdb0e2dc3690087048c2683457eb1fb8f61e0b6511c6114335509054b812b250532d73c68939dacc93051dd9c6480eb4
7
+ data.tar.gz: 00bd524f8a4cee05dd4e7e31fea44db420bf2bc43ba1f8ecdd163094912ce34946b7ca0821aa61c5de5427cc7e458dab2851bb92566e91a479842a837c14e4e8
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Hivemind Plugin for Vagrant
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/vagrant-hivemind.png)](http://badge.fury.io/rb/vagrant-hivemind)
3
4
  [![Build Status](https://travis-ci.org/napramirez/vagrant-hivemind.png?branch=master)](https://travis-ci.org/napramirez/vagrant-hivemind)
4
5
  [![Coverage Status](https://coveralls.io/repos/napramirez/vagrant-hivemind/badge.png?branch=master&service=github)](https://coveralls.io/github/napramirez/vagrant-hivemind?branch=master)
5
6
  [![Dependency Status](https://gemnasium.com/napramirez/vagrant-hivemind.png)](https://gemnasium.com/napramirez/vagrant-hivemind)
@@ -60,9 +60,7 @@ module Vagrant
60
60
  return 1
61
61
  end
62
62
 
63
- host = hosts[options[:hostname]]
64
-
65
- Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, host, root_path
63
+ Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, hosts, root_path
66
64
 
67
65
  with_target_vms(options[:hostname]) do |vm|
68
66
  vm.action(:halt, force_halt: options[:force])
@@ -56,9 +56,7 @@ module Vagrant
56
56
  return 1
57
57
  end
58
58
 
59
- host = hosts[options[:hostname]]
60
-
61
- Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, host, root_path
59
+ Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, hosts, root_path
62
60
 
63
61
  with_target_vms(options[:hostname]) do |vm|
64
62
  action_env = vm.action(:destroy, force_confirm_destroy: true)
@@ -60,19 +60,22 @@ module Vagrant
60
60
 
61
61
  sorted_hosts = sort_hosts hosts, options
62
62
 
63
- @env.ui.info "+----------------------+----------------+---+--------------+------------+---+"
64
- @env.ui.info "| Hostname | IP Address | C | Size | Box Type | G |"
65
- @env.ui.info "+----------------------+----------------+---+--------------+------------+---+"
63
+ Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, sorted_hosts, root_path
64
+
65
+ @env.ui.info "Hostname IP Address C Size Box Type G Status"
66
66
  sorted_hosts.values.each do |host|
67
+ status = ""
68
+ with_target_vms(host.hostname) do |machine|
69
+ status = machine.state.short_description
70
+ end
67
71
  hostname = host.hostname
68
72
  ip_address = host.ip_address
69
73
  is_control_y_n = host.is_control ? 'Y' : 'N'
70
74
  box_size = BOX_SIZES[host.box_size.to_sym][:name]
71
75
  box_type = BOX_TYPES[host.box_type.to_sym][:name]
72
76
  is_gui_y_n = BOX_TYPES[host.box_type.to_sym][:is_gui] ? 'Y' : 'N'
73
- @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} |"
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}"
74
78
  end
75
- @env.ui.info "+----------------------+----------------+---+--------------+------------+---+"
76
79
  @env.ui.info ""
77
80
 
78
81
  0
@@ -57,9 +57,7 @@ module Vagrant
57
57
  return 1
58
58
  end
59
59
 
60
- host = hosts[options[:hostname]]
61
-
62
- Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, host, root_path
60
+ Vagrant::Hivemind::Util::Vagrantfile.generate_hivemind_vagrantfile @env, hosts, root_path
63
61
  Ansible.generate_hosts_file hosts, Path.local_data_path(root_path)
64
62
  HostsFile.generate_hosts_file hosts, Path.local_data_path(root_path)
65
63
 
@@ -133,7 +133,7 @@ module Vagrant
133
133
  end
134
134
 
135
135
  class Vagrantfile
136
- def self.generate_hivemind_vagrantfile(env, host, path = Pathname.new(Dir.pwd))
136
+ def self.generate_hivemind_vagrantfile(env, hosts, path = Pathname.new(Dir.pwd))
137
137
  box_types = Vagrant::Hivemind::Constants::BOX_TYPES
138
138
  box_sizes = Vagrant::Hivemind::Constants::BOX_SIZES
139
139
  cache_path = Path.cache_path
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Hivemind
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -1,7 +1,8 @@
1
1
  Vagrant.configure(2) do |config|
2
+ <% hosts.each_value do |host| %>
2
3
  config.vm.define "<%= host.hostname %>" do |host_config|
3
4
  host_config.vm.box = "<%= box_types[host.box_type.to_sym][:box_id] %>"
4
- host_config.vm.network "private_network", ip: "<%= host.ip_address %>", virtualbox__intnet: true
5
+ host_config.vm.network "private_network", ip: "<%= host.ip_address %>", virtualbox__intnet: "<%= path.basename.to_s.gsub(/[^-a-z0-9_]/i, "") %>"
5
6
 
6
7
  <% host.forwarded_ports.each do |forwarded_port| %>
7
8
  host_config.vm.network "forwarded_port", guest: <%= forwarded_port["guest_port"] %>, host: <%= forwarded_port["host_port"] %><% end %>
@@ -45,4 +46,5 @@ Vagrant.configure(2) do |config|
45
46
  host_config.vm.provision "file", source: "<%= local_data_path %>/system.hosts", destination: "/tmp/system.hosts", run: "always"
46
47
  host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/update-system-hosts.sh", run: "always"
47
48
  end
49
+ <% end %>
48
50
  end
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.0
4
+ version: 0.1.1
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-02 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler