vagrant-goodhosts 1.0.0.pre.beta4 → 1.0.0

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
  SHA256:
3
- metadata.gz: 13ef1e50681184f9636c42cb63ef886051aab4f19c388f913f81e3ccee5c9c61
4
- data.tar.gz: 60da586ec22b7387b3b7ca20641ec49316e3ecd4ed10e672c82fc48f1c8bb8d0
3
+ metadata.gz: dae3311603bb8549e1be6f3eb18b46c0c0fd7b1fab7d6c43f42c190fac1dd907
4
+ data.tar.gz: 168d43266f469c5ba81ebac4ebe6933b0500123cf7809d7276567709bf794bf6
5
5
  SHA512:
6
- metadata.gz: f140337609b3baae16139812a8013c7bb2396765340db63b8bb8ad740a115ee62fc089327bf9366113029cbc17419b418cc1309c5cfa176e0f863298ac5b75e0
7
- data.tar.gz: da008e6cc94397d22242e2b75a5d4c3e15c9c6d0cc7bc7a4a3b508361572304ab0a949211dea4430ce1b5c7b3f68cf8ee3b8f213dac9043d50715953b34025f2
6
+ metadata.gz: 354b9a2a3945f1ebcf3ba8b7877d6e2bf553a14dcfbd85d140f81dda081fad7c1162eef5e354ad2024d516ac2b31b5641066ac8ff110737248be2699f8c42b04
7
+ data.tar.gz: 5a46c36236e3933caa25185420f2b055d2c01ae1f73236f5708e53f7f4cec4c45b90d11be1fe48cd219af5a349b23d33361781dc9fed83838ba32f45866093d6
data/README.md CHANGED
@@ -1,32 +1,39 @@
1
1
  # Vagrant::Goodhosts
2
2
 
3
- This plugin adds an entry to your /etc/hosts file on the host system using [GoodHosts](https://github.com/goodhosts/cli). This plugin is based on [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) to be compatible with the same config parameters.
3
+ This vagrant plugin adds host file entries to the host pointing to the guest VM, using the [GoodHosts](https://github.com/goodhosts/cli) cli tool. This plugin is based on [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) and aims to be compatible with the same config parameters.
4
4
 
5
- On **up**, **resume** and **reload** commands, it tries to add the information, if it does not already exist 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 hosts if they do not already exist in your hosts file. If it needs to be added, you will be asked for the `sudo` password to make the necessary edits.
6
6
 
7
- On **halt**, **destroy**, and **suspend**, those entries will be removed again.
8
- By setting the `config.goodhosts.remove_on_suspend = false`, **suspend** and **halt** will not remove them.
7
+ On **halt**, **destroy**, and **suspend**, those entries will be removed again. By setting the `config.goodhosts.remove_on_suspend = false`, **suspend** and **halt** will not remove them.
9
8
 
10
9
 
11
10
  ## Installation
12
11
 
13
- $ vagrant plugin install vagrant-goodhosts
12
+ ```shell
13
+ vagrant plugin install vagrant-goodhosts
14
+ ```
14
15
 
15
- Uninstall it with:
16
+ To uninstall :
16
17
 
17
- $ vagrant plugin uninstall vagrant-goodhosts
18
+ ```shell
19
+ vagrant plugin uninstall vagrant-goodhosts
20
+ ```
18
21
 
19
- Update the plugin with:
22
+ To update the plugin:
20
23
 
21
- $ vagrant plugin update vagrant-goodhosts
24
+ ```shell
25
+ vagrant plugin update vagrant-goodhosts
26
+ ```
22
27
 
23
28
  ## Usage
24
29
 
25
30
  You currently only need the `hostname` and a `:private_network` network with a fixed IP address.
26
31
 
27
- config.vm.network :private_network, ip: "192.168.3.10"
28
- config.vm.hostname = "www.testing.de"
29
- config.goodhosts.aliases = ["alias.testing.de", "alias2.somedomain.com"]
32
+ ```ruby
33
+ config.vm.network :private_network, ip: "192.168.3.10"
34
+ config.vm.hostname = "www.testing.de"
35
+ config.goodhosts.aliases = ["alias.testing.de", "alias2.somedomain.com"]
36
+ ```
30
37
 
31
38
  This IP address and the hostname will be used for the entry in the `/etc/hosts` file.
32
39
 
@@ -34,30 +41,38 @@ This IP address and the hostname will be used for the entry in the `/etc/hosts`
34
41
 
35
42
  If you have multiple network adapters i.e.:
36
43
 
37
- config.vm.network :private_network, ip: "10.0.0.1"
38
- config.vm.network :private_network, ip: "10.0.0.2"
44
+ ```ruby
45
+ config.vm.network :private_network, ip: "10.0.0.1"
46
+ config.vm.network :private_network, ip: "10.0.0.2"
47
+ ```
39
48
 
40
- you can specify which hostnames are bound to which IP by passing a hash mapping the IP of the network to an array of hostnames to create, e.g.:
49
+ You can specify which hostnames are bound to which IP by passing a hash mapping the IP of the network to an array of hostnames to create, e.g.:
41
50
 
42
- config.goodhosts.aliases = {
43
- '10.0.0.1' => ['foo.com', 'bar.com'],
44
- '10.0.0.2' => ['baz.com', 'bat.com']
45
- }
51
+ ```ruby
52
+ config.goodhosts.aliases = {
53
+ '10.0.0.1' => ['foo.com', 'bar.com'],
54
+ '10.0.0.2' => ['baz.com', 'bat.com']
55
+ }
56
+ ```
46
57
 
47
58
  This will produce `/etc/hosts` entries like so:
48
59
 
49
- 10.0.0.1 foo.com
50
- 10.0.0.1 bar.com
51
- 10.0.0.2 baz.com
52
- 10.0.0.2 bat.com
53
-
60
+ ```
61
+ 10.0.0.1 foo.com
62
+ 10.0.0.1 bar.com
63
+ 10.0.0.2 baz.com
64
+ 10.0.0.2 bat.com
65
+ ```
66
+
54
67
  ### Keeping Host Entries After Suspend/Halt
55
68
 
56
- To keep your /etc/hosts file unchanged simply add the line below to your `VagrantFile`:
69
+ To keep your `/etc/hosts` file unchanged simply add the line below to your `VagrantFile`:
57
70
 
58
- config.goodhosts.remove_on_suspend = false
59
-
60
- This disables vagrant-goodhosts from running on **suspend** and **halt**.
71
+ ```ruby
72
+ config.goodhosts.remove_on_suspend = false
73
+ ```
74
+
75
+ This disables `vagrant-goodhosts` from running on **suspend** and **halt**.
61
76
 
62
77
 
63
78
  ## Suppressing prompts for elevating privileges
@@ -85,12 +100,12 @@ You have to open an elevated command prompt; hold `❖ Win` and press `X`, then
85
100
 
86
101
  cacls %SYSTEMROOT%\system32\drivers\etc\hosts /E /G %USERNAME%:W
87
102
 
88
- ## Installing development version
103
+ ## Installing The Development Version
89
104
 
90
- If you would like to install vagrant-goodhosts on the development version perform the following:
105
+ If you would like to install `vagrant-goodhosts` to make contributions or changes, run the following commands::
91
106
 
92
- ```
93
- git clone https://github.com/goodhosts/vagrant
107
+ ```shell
108
+ git clone https://github.com/goodhosts/vagrant vagrant-goodhosts
94
109
  cd vagrant-goodhosts
95
110
  git checkout develop
96
111
  ./package.sh
@@ -7,7 +7,7 @@ module VagrantPlugins
7
7
 
8
8
  def getIps
9
9
  if Vagrant.has_plugin?("vagrant-hostsupdater")
10
- @ui.error "The Vagrant plugin vagrant-hostsupdater is installed but is executed always also when is not configured in your Vagrantfile!"
10
+ @ui.error "[vagrant-goodhosts] Warning: The vagrant-hostsupdater plugin is installed, hostsupdater always adds the VM name even if the VagrantFile says not to. This shouldn't cause issues, but if it does, uninstall hostsupdater"
11
11
  end
12
12
 
13
13
  ips = []
@@ -22,7 +22,7 @@ module VagrantPlugins
22
22
 
23
23
  @machine.config.vm.provider :hyperv do |v|
24
24
  timeout = @machine.provider_config.ip_address_timeout
25
- @ui.output("Waiting for the machine to report its IP address(might take some time, have a patience)...")
25
+ @ui.output("[vagrant-goodhosts] Waiting for the guest machine to report its IP address ( this might take some time, have patience )...")
26
26
  @ui.detail("Timeout: #{timeout} seconds")
27
27
 
28
28
  options = {
@@ -105,7 +105,7 @@ module VagrantPlugins
105
105
  hostnames[ip].each do |hostname|
106
106
  ip_address = ip
107
107
  if !ip_address.nil?
108
- @ui.info "[vagrant-goodhosts] found entry for: #{ip_address} #{hostname}"
108
+ @ui.info "[vagrant-goodhosts] - found entry for: #{ip_address} #{hostname}"
109
109
  if cli.include? ".exe"
110
110
  stdin, stdout, stderr, wait_thr = Open3.popen3(cli, "a", ip_address, hostname)
111
111
  else
@@ -131,7 +131,7 @@ module VagrantPlugins
131
131
  hostnames[ip].each do |hostname|
132
132
  ip_address = ip
133
133
  if !ip_address.nil?
134
- @ui.info "[vagrant-goodhosts] remove entry for: #{ip_address} #{hostname}"
134
+ @ui.info "[vagrant-goodhosts] - remove entry for: #{ip_address} #{hostname}"
135
135
  if cli.include? ".exe"
136
136
  stdin, stdout, stderr, wait_thr = Open3.popen3(cli, "r", ip_address, hostname)
137
137
  else
@@ -150,11 +150,11 @@ module VagrantPlugins
150
150
  def printReadme(error, errorText)
151
151
  if error
152
152
  cli = get_cli
153
- @ui.error "[vagrant-goodhosts] Issue on executing goodhosts: #{errorText}"
154
- @ui.error "[vagrant-goodhosts] Cli path: #{cli}"
155
- @ui.error "[vagrant-goodhosts] Check the readme at https://github.com/Mte90/vagrant-goodhosts#passwordless-sudo"
153
+ @ui.error "[vagrant-goodhosts] Issue executing goodhosts CLI: #{errorText}"
154
+ @ui.error "[vagrant-goodhosts] Cli path: #{cli}"
155
+ @ui.error "[vagrant-goodhosts] Check the readme at https://github.com/goodhosts/vagrant#passwordless-sudo"
156
156
  end
157
-
157
+
158
158
  end
159
159
 
160
160
  end
@@ -44,11 +44,6 @@ module VagrantPlugins
44
44
  hook.prepend(Action::RemoveHosts)
45
45
  hook.append(Action::UpdateHosts)
46
46
  end
47
-
48
- command(:goodhosts) do
49
- require_relative 'command'
50
- Command
51
- end
52
47
  end
53
48
  end
54
49
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GoodHosts
3
- VERSION = '1.0.0-beta4'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['mte90net@gmail.com']
11
11
  spec.description = %q{Enables Vagrant to update hosts file on the host machine with goodhosts}
12
12
  spec.summary = spec.description
13
- spec.homepage = 'https://github.com/mte90/vagrant-goodhosts'
13
+ spec.homepage = 'https://github.com/goodhosts/vagrant'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-goodhosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniele Scasciafratte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -57,13 +57,12 @@ files:
57
57
  - lib/vagrant-goodhosts/bundle/cli
58
58
  - lib/vagrant-goodhosts/bundle/cli.exe
59
59
  - lib/vagrant-goodhosts/bundle/cli_osx
60
- - lib/vagrant-goodhosts/command.rb
61
60
  - lib/vagrant-goodhosts/config.rb
62
61
  - lib/vagrant-goodhosts/plugin.rb
63
62
  - lib/vagrant-goodhosts/version.rb
64
63
  - package.sh
65
64
  - vagrant-goodhosts.gemspec
66
- homepage: https://github.com/mte90/vagrant-goodhosts
65
+ homepage: https://github.com/goodhosts/vagrant
67
66
  licenses:
68
67
  - MIT
69
68
  metadata: {}
@@ -78,9 +77,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
77
  version: '0'
79
78
  required_rubygems_version: !ruby/object:Gem::Requirement
80
79
  requirements:
81
- - - ">"
80
+ - - ">="
82
81
  - !ruby/object:Gem::Version
83
- version: 1.3.1
82
+ version: '0'
84
83
  requirements: []
85
84
  rubygems_version: 3.1.2
86
85
  signing_key:
@@ -1,10 +0,0 @@
1
- module VagrantPlugins
2
- module GoodHosts
3
- class Command < Vagrant.plugin('2', :command)
4
-
5
- def execute
6
- puts "ran command"
7
- end
8
- end
9
- end
10
- end