vagrant-hosts 2.1.5 → 2.2.0

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7e35165882b1b5100f44d6d9f8b1840ee94cfe6b
4
- data.tar.gz: 8a9eaed2d3a1a7d080fc9afb8867285c8a66707a
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmEyNTU5YzljMjY1ZDU2YWRhYWY1YWY1MThiNjgyNTIwMmM0N2RjZQ==
5
+ data.tar.gz: !binary |-
6
+ Y2YwNWQ5ZmRlZTMxNzBmNTE5OTU0OWYzNDFkMDEwNjllOTY2YTE1Yw==
5
7
  SHA512:
6
- metadata.gz: e85b8efdec1f5750c953c6e6613b7e594d367ad9eb4eb7f8140f48cfec4b8440ae347572b4227ad2a69e5ca314d2d5437d614d781811f66f26b2af2a24979f16
7
- data.tar.gz: 0066aa51ff0fac2a5380de30b3356f2cd0369e8d0ce8984b966c1439e1716fa98fdba87a63e866516d49619855b67d30206d1c864f2a3f3185e3409846dbe810
8
+ metadata.gz: !binary |-
9
+ YWQ0YTU2OTgwMzRiYzQxNTkwNGUxMjNjMGU2ZjQ2YThlNWIzMmQwMjk1OGNl
10
+ ZmEzY2RiYTdkMTg1ZDc0ZWY4ZWZiNWE4NTVmYjViMDRmYWZkZGJlYmUxNjBi
11
+ NmVlOTFmMjE1NDllNTVhYzIyZWNmOTYwZGQ5NTY1MjJlNzMwNTI=
12
+ data.tar.gz: !binary |-
13
+ YzNiNWUxM2JjNzAwOTZjZWE5ZDhjMzgxNTkzMzU0OTBiMmRkYWUzNjZjOTk2
14
+ ZThkNTM3MzFkZmRlYzkyNTllYWUyODM0OWEwODFjMDdjZTY3NmJlMjg0YjQ2
15
+ ZWQwZTMxMDBkZGUyMTljZmRhZGM0Y2FkMjA0OTc5Y2JiOTA4NTc=
data/CHANGELOG CHANGED
@@ -1,6 +1,18 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 2.2.0
5
+ -----
6
+
7
+ 2014-07-30
8
+
9
+ This is a backwards compatible feature release
10
+
11
+ * (GH-24) Allow users to enable/disable localhost entries
12
+ * (GH-35) Add support for OSX guests
13
+
14
+ Thanks to Jeff Goldschrafe for their work on this release.
15
+
4
16
  2.1.5
5
17
  -----
6
18
 
@@ -8,73 +8,79 @@ Synopsis
8
8
 
9
9
  Manually specify addresses:
10
10
 
11
- Vagrant.configure('2') do |config|
12
- config.vm.box = "ubuntu-12.04-server-i386"
13
-
14
- config.vm.provision :hosts do |provisioner|
15
- # Add a single hostname
16
- provisioner.add_host '10.0.2.2', ['myhost.vagrantup.internal']
17
-
18
- # Or a fqdn and a short hostname
19
- provisioner.add_host '10.0.2.3', ['myotherhost.vagrantup.internal', 'myotherhost']
20
-
21
- # Or as many aliases as you like!
22
- provisioner.add_host '10.0.2.5', [
23
- 'mypuppetmaster.vagrantup.internal',
24
- 'puppet.vagrantup.internal',
25
- 'mypuppetmaster',
26
- 'puppet'
27
- ]
28
- end
29
- end
11
+ ```ruby
12
+ Vagrant.configure('2') do |config|
13
+ config.vm.box = "ubuntu-12.04-server-i386"
14
+
15
+ config.vm.provision :hosts do |provisioner|
16
+ # Add a single hostname
17
+ provisioner.add_host '10.0.2.2', ['myhost.vagrantup.internal']
18
+
19
+ # Or a fqdn and a short hostname
20
+ provisioner.add_host '10.0.2.3', ['myotherhost.vagrantup.internal', 'myotherhost']
21
+
22
+ # Or as many aliases as you like!
23
+ provisioner.add_host '10.0.2.5', [
24
+ 'mypuppetmaster.vagrantup.internal',
25
+ 'puppet.vagrantup.internal',
26
+ 'mypuppetmaster',
27
+ 'puppet'
28
+ ]
29
+ end
30
+ end
31
+ ```
30
32
 
31
33
  - - -
32
34
 
33
35
  Autodetect internal network addresses and autoconfigure hosts:
34
36
 
35
- # Autoconfigure hosts. This will copy the private network addresses from
36
- # each VM and update hosts entries on all other machines. No further
37
- # configuration is needed.
38
- Vagrant.configure('2') do |config|
39
-
40
- config.vm.define :first do |node|
41
- node.vm.box = "ubuntu-12.04-server-i386"
42
- node.vm.network :private_network, :ip => '10.20.1.2'
43
- node.vm.provision :hosts
44
- end
45
-
46
- config.vm.define :second do |node|
47
- node.vm.box = "ubuntu-12.04-server-i386"
48
- node.vm.network :private_network, :ip => '10.20.1.3'
49
- node.vm.provision :hosts
50
- end
51
- end
37
+ ```ruby
38
+ # Autoconfigure hosts. This will copy the private network addresses from
39
+ # each VM and update hosts entries on all other machines. No further
40
+ # configuration is needed.
41
+ Vagrant.configure('2') do |config|
42
+
43
+ config.vm.define :first do |node|
44
+ node.vm.box = "ubuntu-12.04-server-i386"
45
+ node.vm.network :private_network, :ip => '10.20.1.2'
46
+ node.vm.provision :hosts
47
+ end
48
+
49
+ config.vm.define :second do |node|
50
+ node.vm.box = "ubuntu-12.04-server-i386"
51
+ node.vm.network :private_network, :ip => '10.20.1.3'
52
+ node.vm.provision :hosts
53
+ end
54
+ end
55
+ ```
52
56
 
53
57
  - - -
54
58
 
55
59
  Use autodetection with manual entries
56
60
 
57
- Vagrant.configure('2') do |config|
58
-
59
- config.vm.define :first do |node|
60
- node.vm.box = "ubuntu-12.04-server-i386"
61
- node.vm.network :private_network, :ip => '10.20.1.2'
62
- node.vm.provision :hosts do |provisioner|
63
- provisioner.autoconfigure = true
64
- provisioner.add_host '172.16.3.10', ['yum.mirror.local']
65
- end
66
-
67
- end
68
-
69
- config.vm.define :second do |node|
70
- node.vm.box = "ubuntu-12.04-server-i386"
71
- node.vm.network :private_network, :ip => '10.20.1.3'
72
- node.vm.provision :hosts do |provisioner|
73
- provisioner.autoconfigure = true
74
- provisioner.add_host '172.16.3.11', ['apt.mirror.local']
75
- end
76
- end
61
+ ```ruby
62
+ Vagrant.configure('2') do |config|
63
+
64
+ config.vm.define :first do |node|
65
+ node.vm.box = "ubuntu-12.04-server-i386"
66
+ node.vm.network :private_network, :ip => '10.20.1.2'
67
+ node.vm.provision :hosts do |provisioner|
68
+ provisioner.autoconfigure = true
69
+ provisioner.add_host '172.16.3.10', ['yum.mirror.local']
70
+ end
71
+
72
+ end
73
+
74
+ config.vm.define :second do |node|
75
+ node.vm.box = "ubuntu-12.04-server-i386"
76
+ node.vm.network :private_network, :ip => '10.20.1.3'
77
+ node.vm.provision :hosts do |provisioner|
78
+ provisioner.autoconfigure = true
79
+ provisioner.add_host '172.16.3.11', ['apt.mirror.local']
77
80
  end
81
+ end
82
+ end
83
+ ```
78
84
 
79
85
  Supported Platforms
80
86
  -------------------
@@ -3,9 +3,8 @@ module VagrantHosts::Addresses
3
3
  private
4
4
 
5
5
  def all_hosts(config)
6
-
7
6
  all_hosts = []
8
- all_hosts += local_hosts(@machine)
7
+ all_hosts += local_hosts(@machine, config)
9
8
 
10
9
  if config.autoconfigure
11
10
  all_hosts += vagrant_hosts(@env)
@@ -30,11 +29,14 @@ module VagrantHosts::Addresses
30
29
  hostnames
31
30
  end
32
31
 
33
- def local_hosts(machine)
34
- [
35
- ['127.0.0.1', ['localhost']],
36
- ['127.0.1.1', hostnames_for_machine(machine)],
37
- ]
32
+ def local_hosts(machine, config)
33
+ entries = [['127.0.0.1', ['localhost']]]
34
+
35
+ if config.add_localhost_hostnames
36
+ entries << ['127.0.1.1', hostnames_for_machine(machine)]
37
+ end
38
+
39
+ entries
38
40
  end
39
41
 
40
42
  def vagrant_hosts(env)
@@ -12,9 +12,12 @@ module VagrantHosts
12
12
  # other vagrant machines
13
13
  attr_accessor :autoconfigure
14
14
 
15
+ attr_accessor :add_localhost_hostnames
16
+
15
17
  def initialize
16
18
  @hosts = []
17
19
  @autoconfigure = UNSET_VALUE
20
+ @add_localhost_hostnames = UNSET_VALUE
18
21
  end
19
22
 
20
23
  # Register a host for entry
@@ -42,6 +45,10 @@ module VagrantHosts
42
45
  @autoconfigure = false
43
46
  end
44
47
  end
48
+
49
+ if @add_localhost_hostnames == UNSET_VALUE
50
+ @add_localhost_hostnames = true
51
+ end
45
52
  end
46
53
 
47
54
  # @param other [VagrantHosts::Config]
@@ -22,14 +22,11 @@ class VagrantHosts::Plugin < Vagrant.plugin(2)
22
22
 
23
23
  # Guest capabilities for vagrant-hosts
24
24
 
25
- guest_capability(:linux, 'sync_hosts') do
26
- require_relative 'cap'
27
- VagrantHosts::Cap::SyncHosts::POSIX
28
- end
29
-
30
- guest_capability(:solaris, 'sync_hosts') do
31
- require_relative 'cap'
32
- VagrantHosts::Cap::SyncHosts::POSIX
25
+ [:darwin, :linux, :solaris].each do |os|
26
+ guest_capability(os, 'sync_hosts') do
27
+ require_relative 'cap'
28
+ VagrantHosts::Cap::SyncHosts::POSIX
29
+ end
33
30
  end
34
31
 
35
32
  guest_capability(:windows, 'sync_hosts') do
@@ -1,3 +1,3 @@
1
1
  module VagrantHosts
2
- VERSION = '2.1.5'
2
+ VERSION = '2.2.0'
3
3
  end
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-hosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2014-07-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: |2
14
- Manage static DNS entries and configuration for Vagrant guests.
13
+ description: ! ' Manage static DNS entries and configuration for Vagrant guests.
14
+
15
+ '
15
16
  email: adrien@somethingsinistral.net
16
17
  executables: []
17
18
  extensions: []
@@ -47,18 +48,19 @@ require_paths:
47
48
  - lib
48
49
  required_ruby_version: !ruby/object:Gem::Requirement
49
50
  requirements:
50
- - - '>='
51
+ - - ! '>='
51
52
  - !ruby/object:Gem::Version
52
53
  version: '0'
53
54
  required_rubygems_version: !ruby/object:Gem::Requirement
54
55
  requirements:
55
- - - '>='
56
+ - - ! '>='
56
57
  - !ruby/object:Gem::Version
57
58
  version: '0'
58
59
  requirements: []
59
60
  rubyforge_project:
60
- rubygems_version: 2.0.14
61
+ rubygems_version: 2.2.1
61
62
  signing_key:
62
63
  specification_version: 4
63
64
  summary: Manage static DNS on vagrant guests
64
65
  test_files: []
66
+ has_rdoc: true