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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4366a15c5d009787a90c0ffb71e02981fc209b1
|
4
|
+
data.tar.gz: f5d33a4e739a27793cac0186ce4a7dbd6ec9ee9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
25
|
+
### Multiple private network adapters
|
31
26
|
|
32
|
-
|
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
|
-
|
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
|
-
|
38
|
-
* bugfix: wrong path on Windows systems (Thanks to Im0rtality)
|
31
|
+
This will produce host entries like so:
|
39
32
|
|
40
|
-
|
41
|
-
|
33
|
+
10.0.0.1 foo.com
|
34
|
+
10.0.0.2 bar.com
|
42
35
|
|
43
|
-
###
|
44
|
-
* trying to use proper windows hosts file
|
36
|
+
### Remove on a `vagrant suspend`
|
45
37
|
|
46
|
-
|
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
|
-
|
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
|
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
|
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.
|
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/
|
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
|