landrush 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce32119bf22f210583466e45565a25bb76d50c11
4
- data.tar.gz: 1422b70557f4fb76170b4a234eddf8e151c6ac40
3
+ metadata.gz: 670ea146b0661d80ba8dccc6e17eaa48989c409d
4
+ data.tar.gz: 341f19fbcf9994d579fae39930f31409462feead
5
5
  SHA512:
6
- metadata.gz: 4ffb382a44d8bb6812ca230d15d25db1832737888dde303daba4f1c0f67e6e6f03692a4e6d34ca0f2fe0c7ea10d3d08e695d2654b4864ec9469b43f0a7fad1ab
7
- data.tar.gz: 73f06fab9d25d8c2958b66e1a0390e83c342035ee48b8268fb3dd136fa3052ad99b4efe4bb8dd81fc11298dec3c13390caed8f6fab6fc427847ba6468aa80de5
6
+ metadata.gz: 446a5d4bdf416bcdf72a0f21539fdb50a985439708a10ff61daa61da93ec84950366f6dfd37a2468dce6250ea2fd6bd6528132dca6162e2cdb25a5520ab906b7
7
+ data.tar.gz: 09197818c44b00c92dc9fd41f44c169bd4cfd921247a0dfb4512b72c25cc103f6e50bba30de25bdbcc25e2996b4f1b610b9f46218c536b492da3c977109e36bc
@@ -63,7 +63,20 @@ module Landrush
63
63
  end
64
64
 
65
65
  def machine_hostname
66
- machine.config.vm.hostname
66
+ @machine_hostname ||= read_machine_hostname
67
+ end
68
+
69
+ def read_machine_hostname
70
+ # Get hostname from vm config.
71
+ return machine.config.vm.hostname if machine.config.vm.hostname.to_s.length > 0
72
+
73
+ # Or gt machine's current hostname.
74
+ machine.communicate.execute("hostname") do |type, data|
75
+ return data if type == :stdout && data.to_s.length > 0
76
+ end
77
+
78
+ # Or default to "guest-vm"
79
+ return "guest-vm"
67
80
  end
68
81
 
69
82
  def enabled?
@@ -23,7 +23,7 @@ module Landrush
23
23
  when :virtualbox then
24
24
  '10.0.2.2'
25
25
  when :vmware_fusion then
26
- _gateway_for_ip(machine.guest.capability(:configured_dns_server))
26
+ _gateway_for_ip(machine.guest.capability(:configured_dns_servers).first)
27
27
  when :parallels then
28
28
  machine.provider.capability(:host_address)
29
29
  end
@@ -73,13 +73,6 @@ module Landrush
73
73
 
74
74
  def validate(machine)
75
75
  errors = _detected_errors
76
-
77
- if enabled?
78
- unless machine.config.vm.hostname.to_s.length > 0
79
- errors << 'you must specify a hostname so we can make a DNS entry for it'
80
- end
81
- end
82
-
83
76
  { 'landrush' => errors }
84
77
  end
85
78
  end
@@ -76,9 +76,9 @@ module Landrush
76
76
  Cap::Redhat::InstallIptables
77
77
  end
78
78
 
79
- guest_capability('linux', 'configured_dns_server') do
80
- require_relative 'cap/linux/configured_dns_server'
81
- Cap::Linux::ConfiguredDnsServer
79
+ guest_capability('linux', 'configured_dns_servers') do
80
+ require_relative 'cap/linux/configured_dns_servers'
81
+ Cap::Linux::ConfiguredDnsServers
82
82
  end
83
83
 
84
84
  guest_capability('linux', 'redirect_dns') do
@@ -1,3 +1,3 @@
1
1
  module Landrush
2
- VERSION = "0.15.0"
2
+ VERSION = "0.15.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: landrush
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Hinze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-28 00:00:00.000000000 Z
11
+ date: 2014-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubydns