vagrant-multi-hostsupdater 0.0.3 → 0.0.4

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: 525bc4999260ee40ed1d7f3126df0c71b82c9e4b
4
- data.tar.gz: 14c86c1da0060ef2e67560229765c3c83ffe923c
3
+ metadata.gz: f4366a15c5d009787a90c0ffb71e02981fc209b1
4
+ data.tar.gz: f5d33a4e739a27793cac0186ce4a7dbd6ec9ee9a
5
5
  SHA512:
6
- metadata.gz: 956dd624474534c5b6abe3eb81667637177445aec2691c601887c1d8bb273d5b16d3b849d9eb119016d523d39165be4b882fa34e0a8f3f0d5d6ff2bc1a7e0c48
7
- data.tar.gz: fe7df8850a24b426612f8517c266b5cd32ab7d2c833af453e28af93bb5f45e62913e10359cd770a87f1cfa29834841196a1e2965eff47c9d5bae4f33f2c8e969
6
+ metadata.gz: 0c41168e7291c5faa50c5efed56afb53fd6b4773c82e85102206eb55492d25ea20e61c02ced49557f40a058d72d669ef20b737a04dda71e16bde28655bde5647
7
+ data.tar.gz: 0e27e0649c3797b57bbf99020651a5802dcb6bd12f7eaeec1561805f6413005429595940bbd4ade78d154d4a6da34b015f1bca644257e89bcc6ba2875bab9b67
data/README.md CHANGED
@@ -1,15 +1,10 @@
1
1
  # Vagrant::MultiHostsUpdater
2
2
 
3
- This plugin adds an entry to your /etc/hosts file on the host system.
3
+ This plugin adds an entry to your `/etc/hosts` file on the host system.
4
4
 
5
- On **up**, **resume** and **reload** commands, it tries to add the information, if its not already existant in your hosts file. If it needs to be added, you will be asked for an administrator password, since it uses sudo to edit the file.
5
+ On **up**, **resume** and **reload** commands, it tries to add the information, if it doesn't exist in your hosts file. If it needs to be added, you may be asked for an administrator password, as it requires root privileges to modify it.
6
6
 
7
7
  On **halt** and **destroy**, those entries will be removed again.
8
- By setting the remove\_on\_suspend option, you can have them removed on **suspend**, too:
9
-
10
- config.multihostsupdater.remove_on_suspend = true
11
-
12
-
13
8
 
14
9
  ## Installation
15
10
 
@@ -27,37 +22,22 @@ At the moment, the only things you need, are the hostname and a :private_network
27
22
  config.vm.hostname = "www.testing.de"
28
23
  config.multihostsupdater.aliases = ["alias.testing.de", "alias2.somedomain.com"]
29
24
 
30
- This ip and the hostname will be used for the entry in the /etc/hosts file.
25
+ ### Multiple private network adapters
31
26
 
32
- ## Versions
27
+ If you have multiple network adapters you can specify which hostnames are bound to which IP by passing a `Map[String]Array` mapping the IP of the network to an array of hostnames to create. eg:
33
28
 
34
- ### 0.0.11
35
- * bugfix: Fix additional new lines being added to hosts file (Thanks to vincentmac)
29
+ config.vm.multihostsupdater.aliases = {'10.0.0.1' => ['foo.com', 'bar.com'], '10.0.0.2' => ['baz.com', 'bat.com']}
36
30
 
37
- ### 0.0.10
38
- * bugfix: wrong path on Windows systems (Thanks to Im0rtality)
31
+ This will produce host entries like so:
39
32
 
40
- ### 0.0.9
41
- * bugfix: now not trying to remove anything if no machine id is given
33
+ 10.0.0.1 foo.com
34
+ 10.0.0.2 bar.com
42
35
 
43
- ### 0.0.8
44
- * trying to use proper windows hosts file
36
+ ### Remove on a `vagrant suspend`
45
37
 
46
- ### 0.0.7
47
- * using hashed uids now to identify hosts entries (you might need to remove previous hostentries manually)
48
- * fixed removing of host entries
38
+ By setting the `remove_on_suspend` option, you can have them removed on **suspend**, too:
49
39
 
50
- ### 0.0.6
51
- * no sudo, if /etc/hosts is writeable
52
-
53
- ### 0.0.5
54
- * option added to not remove hosts on suspend, adding hosts on resume (Thanks to Svelix)
55
-
56
- ### 0.0.4
57
- * fixed problem with removing hosts entries on destroy command (Thanks to Andy Bohne)
58
-
59
- ### 0.0.3
60
- * added aliases config option to define additional hostnames
40
+ config.multihostsupdater.remove_on_suspend = true
61
41
 
62
42
 
63
43
  ## Contributing
@@ -5,7 +5,6 @@ module VagrantPlugins
5
5
  class UpdateHosts
6
6
  include MultiHostsUpdater
7
7
 
8
-
9
8
  def initialize(app, env)
10
9
  @app = app
11
10
  @machine = env[:machine]
@@ -13,9 +12,8 @@ module VagrantPlugins
13
12
  end
14
13
 
15
14
  def call(env)
16
- @ui.info "Checking for host entries with env #{env}"
15
+ @ui.info "Checking for host entries"
17
16
  @app.call(env)
18
- puts "about to call addhostentries"
19
17
  addHostEntries()
20
18
  end
21
19
 
@@ -17,7 +17,6 @@ module VagrantPlugins
17
17
  # This option is only valid if a Hash is provided
18
18
  # from the `config.multihostsupdater.aliases` parameter
19
19
  def getHostnames(ip=nil)
20
-
21
20
  hostnames = []
22
21
  if @machine.config.multihostsupdater.aliases.is_a?(Hash)
23
22
  hostnames = @machine.config.multihostsupdater.aliases[ip] || hostnames
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module MultiHostsUpdater
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-multi-hostsupdater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Fellows
@@ -54,7 +54,7 @@ files:
54
54
  - lib/vagrant-multi-hostsupdater/Action/CacheHosts.rb
55
55
  - lib/vagrant-multi-hostsupdater/Action/RemoveHosts.rb
56
56
  - lib/vagrant-multi-hostsupdater/Action/UpdateHosts.rb
57
- - lib/vagrant-multi-hostsupdater/HostsUpdater.rb
57
+ - lib/vagrant-multi-hostsupdater/MultiHostsUpdater.rb
58
58
  - lib/vagrant-multi-hostsupdater/command.rb
59
59
  - lib/vagrant-multi-hostsupdater/config.rb
60
60
  - lib/vagrant-multi-hostsupdater/plugin.rb