vagrant-hostsupdater 0.0.4 → 0.0.5
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
|
SHA512:
|
3
|
-
|
4
|
-
|
3
|
+
data.tar.gz: 0c34e096d35dfa78632d0957a9f711e6bb3616139e47869ba38a940bb2e172cee4cecb21ebc8c83fcf8914777a3074077e8d7fb3c8267f76bb863c20277c0412
|
4
|
+
metadata.gz: e03091cf84b813ab34b68e60796c3136ac21acc01fb936e0d671867644223c5b636ba22b1cbaf32b059bf3f2c9de56c0190e510fea8068b8d9cd3fc7cc6cb3c4
|
5
5
|
SHA1:
|
6
|
-
|
7
|
-
|
6
|
+
data.tar.gz: 49e43d54e0c0065c1313ec7c7748a15c6743e68d
|
7
|
+
metadata.gz: f27951158dcd3e6a1281e344e4afe55936fe5333
|
data/README.md
CHANGED
@@ -2,13 +2,21 @@
|
|
2
2
|
|
3
3
|
This plugin adds an entry to your /etc/hosts file on the host system.
|
4
4
|
|
5
|
-
On **up** 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 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.
|
6
6
|
|
7
|
-
On **halt
|
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.hostsupdater.remove_on_suspend = true
|
8
11
|
|
9
12
|
## Versions
|
13
|
+
|
14
|
+
### 0.0.5
|
15
|
+
* option added to not remove hosts on suspend, adding hosts on resume (Thanks to Svelix)
|
16
|
+
|
10
17
|
### 0.0.4
|
11
18
|
* fixed problem with removing hosts entries on destroy command (Thanks to Andy Bohne)
|
19
|
+
|
12
20
|
### 0.0.3
|
13
21
|
* added aliases config option to define additional hostnames
|
14
22
|
|
@@ -24,9 +32,9 @@ Uninstall it with:
|
|
24
32
|
|
25
33
|
At the moment, the only things you need, are the hostname and a :private_network network with a fixed ip.
|
26
34
|
|
27
|
-
|
28
|
-
|
29
|
-
|
35
|
+
config.vm.network :private_network, ip: "192.168.3.10"
|
36
|
+
config.vm.hostname = "www.testing.de"
|
37
|
+
config.hostsupdater.aliases = ["alias.testing.de", "alias2.somedomain.com"]
|
30
38
|
|
31
39
|
This ip and the hostname will be used for the entry in the /etc/hosts file.
|
32
40
|
|
@@ -11,8 +11,13 @@ module VagrantPlugins
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def call(env)
|
14
|
-
|
15
|
-
|
14
|
+
machine_action = env[:machine_action]
|
15
|
+
if machine_action != :suspend || @machine.config.hostsupdater.remove_on_suspend
|
16
|
+
@ui.info "Removing hosts"
|
17
|
+
removeHostEntries
|
18
|
+
else
|
19
|
+
@ui.info "Removing on suspend disabled"
|
20
|
+
end
|
16
21
|
@app.call(env)
|
17
22
|
end
|
18
23
|
|
@@ -35,10 +35,14 @@ module VagrantPlugins
|
|
35
35
|
hook.append(Action::UpdateHosts)
|
36
36
|
end
|
37
37
|
|
38
|
+
action_hook(:hostsupdater, :machine_action_resume) do |hook|
|
39
|
+
hook.append(Action::UpdateHosts)
|
40
|
+
end
|
41
|
+
|
38
42
|
command(:hostsupdater) do
|
39
43
|
require_relative 'command'
|
40
44
|
Command
|
41
45
|
end
|
42
46
|
end
|
43
47
|
end
|
44
|
-
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-hostsupdater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Falk K\xC3\xBChnel"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-29 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
prerelease: false
|