vagrant-hostmanager 1.8.8 → 1.8.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -1
- data/README.md +7 -6
- data/lib/vagrant-hostmanager/action/update_guest.rb +1 -3
- data/lib/vagrant-hostmanager/config.rb +3 -3
- data/lib/vagrant-hostmanager/hosts_file/updater.rb +4 -4
- data/lib/vagrant-hostmanager/version.rb +1 -1
- data/vagrant-hostmanager.gemspec +1 -1
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a8c250b9b17867a3b6f61150bc403ed334c446659eeb522f2235619b0badb164
|
4
|
+
data.tar.gz: ce52e95c04bcbe8f9c6466f4003bf53411c22bad4ed99f1c11e8abc1e8e4b6d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a49c5da44b68ae30a819143f5c42c9240e1b9e65e1384c61ee3c5d60955af2e79bf87435ccbed0ff2af89fe9ce0958ef3a58bbe8dd27b4a6c7de04421bba2d0
|
7
|
+
data.tar.gz: dd0c7067ce6cca411a314b1e10757ba457cd4677ac280f9caa8b6c8627f5ab5e0226b8a58e8638425122cee08dabac16ca60408a062b10b1fe59e487c4c73edc
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -8,6 +8,9 @@ Vagrant Host Manager
|
|
8
8
|
|
9
9
|
`vagrant-hostmanager` is a Vagrant plugin that manages the `hosts` file on guest machines (and optionally the host). Its goal is to enable resolution of multi-machine environments deployed with a cloud provider where IP addresses are not known in advance.
|
10
10
|
|
11
|
+
Do you like what we do? Consider supporting us through Patreon. All of the money goes directly back into growing our collection of open source and free software.
|
12
|
+
[![Patreon](https://img.shields.io/badge/patreon-donate-red.svg)](https://www.patreon.com/devopsgroup)
|
13
|
+
|
11
14
|
Installation
|
12
15
|
------------
|
13
16
|
|
@@ -188,12 +191,10 @@ To contribute, fork then clone the repository, and then the following:
|
|
188
191
|
|
189
192
|
**Developing**
|
190
193
|
|
191
|
-
1.
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
3. Then install vagrant-hostmanager dependancies:
|
196
|
-
* `bundle _1.14.6_ install`
|
194
|
+
1. Install [RVM](https://rvm.io/rvm/install)
|
195
|
+
2. If using MacOS, follow these [OpenSSL instructions](https://github.com/rvm/rvm/issues/5252#issuecomment-1298835941)
|
196
|
+
3. Use Ruby v3.0.0 `rvm use 3.0.0`
|
197
|
+
4. Run `bundle install`
|
197
198
|
|
198
199
|
**Testing**
|
199
200
|
|
@@ -17,9 +17,7 @@ module VagrantPlugins
|
|
17
17
|
|
18
18
|
def call(env)
|
19
19
|
if @config.hostmanager.manage_guest?
|
20
|
-
|
21
|
-
:name => @machine.name
|
22
|
-
})
|
20
|
+
env[:ui].info I18n.t('vagrant_hostmanager.action.update_guest', name: @machine.name)
|
23
21
|
@updater.update_guest(@machine)
|
24
22
|
|
25
23
|
@app.call(env)
|
@@ -49,7 +49,7 @@ module VagrantPlugins
|
|
49
49
|
# check if aliases option is an Array
|
50
50
|
if !machine.config.hostmanager.aliases.kind_of?(Array) &&
|
51
51
|
!machine.config.hostmanager.aliases.kind_of?(String)
|
52
|
-
errors << I18n.t('vagrant_hostmanager.config.not_an_array_or_string', {
|
52
|
+
errors << I18n.t('vagrant_hostmanager.config.not_an_array_or_string', **{
|
53
53
|
:config_key => 'hostmanager.aliases',
|
54
54
|
:is_class => aliases.class.to_s,
|
55
55
|
})
|
@@ -57,7 +57,7 @@ module VagrantPlugins
|
|
57
57
|
|
58
58
|
if !machine.config.hostmanager.ip_resolver.nil? &&
|
59
59
|
!machine.config.hostmanager.ip_resolver.kind_of?(Proc)
|
60
|
-
errors << I18n.t('vagrant_hostmanager.config.not_a_proc', {
|
60
|
+
errors << I18n.t('vagrant_hostmanager.config.not_a_proc', **{
|
61
61
|
:config_key => 'hostmanager.ip_resolver',
|
62
62
|
:is_class => ip_resolver.class.to_s,
|
63
63
|
})
|
@@ -72,7 +72,7 @@ module VagrantPlugins
|
|
72
72
|
def validate_bool(key, value)
|
73
73
|
if ![TrueClass, FalseClass].include?(value.class) &&
|
74
74
|
value != UNSET_VALUE
|
75
|
-
I18n.t('vagrant_hostmanager.config.not_a_bool', {
|
75
|
+
I18n.t('vagrant_hostmanager.config.not_a_bool', **{
|
76
76
|
:config_key => key,
|
77
77
|
:value => value.class.to_s
|
78
78
|
})
|
@@ -88,8 +88,8 @@ module VagrantPlugins
|
|
88
88
|
|
89
89
|
def update_content(file_content, resolving_machine, include_id, line_endings)
|
90
90
|
id = include_id ? " id: #{read_or_create_id}" : ""
|
91
|
-
header = "## vagrant-hostmanager-start#{id}
|
92
|
-
footer = "## vagrant-hostmanager-end
|
91
|
+
header = "## vagrant-hostmanager-start#{id}"
|
92
|
+
footer = "## vagrant-hostmanager-end"
|
93
93
|
body = get_machines
|
94
94
|
.map { |machine| get_hosts_file_entry(machine, resolving_machine) }
|
95
95
|
.join
|
@@ -146,12 +146,12 @@ module VagrantPlugins
|
|
146
146
|
if body.empty?
|
147
147
|
block = "\n"
|
148
148
|
else
|
149
|
-
block = "\n\n" + header + body + footer + "\n"
|
149
|
+
block = "\n\n" + header + "\n" + body + footer + "\n\n"
|
150
150
|
end
|
151
151
|
# Pattern for finding existing block
|
152
152
|
header_pattern = Regexp.quote(header)
|
153
153
|
footer_pattern = Regexp.quote(footer)
|
154
|
-
pattern = Regexp.new("\n*#{header_pattern}.*?#{footer_pattern}\n*", Regexp::MULTILINE)
|
154
|
+
pattern = Regexp.new("[\r\n]*#{header_pattern}.*?#{footer_pattern}[\r\n]*", Regexp::MULTILINE)
|
155
155
|
# Replace existing block or append
|
156
156
|
content = old_content.match(pattern) ? old_content.sub(pattern, block) : old_content.rstrip + block
|
157
157
|
if line_endings == "crlf"
|
data/vagrant-hostmanager.gemspec
CHANGED
@@ -17,6 +17,6 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
|
20
|
-
gem.add_development_dependency 'bundler'
|
20
|
+
gem.add_development_dependency 'bundler'
|
21
21
|
gem.add_development_dependency 'rake'
|
22
22
|
end
|
metadata
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-hostmanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Dahlen
|
8
8
|
- Seth Reeser
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,11 +71,11 @@ files:
|
|
71
71
|
- test/Vagrantfile
|
72
72
|
- test/test.sh
|
73
73
|
- vagrant-hostmanager.gemspec
|
74
|
-
homepage:
|
74
|
+
homepage:
|
75
75
|
licenses:
|
76
76
|
- MIT
|
77
77
|
metadata: {}
|
78
|
-
post_install_message:
|
78
|
+
post_install_message:
|
79
79
|
rdoc_options: []
|
80
80
|
require_paths:
|
81
81
|
- lib
|
@@ -90,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
|
94
|
-
|
95
|
-
signing_key:
|
93
|
+
rubygems_version: 3.2.3
|
94
|
+
signing_key:
|
96
95
|
specification_version: 4
|
97
96
|
summary: A Vagrant plugin that manages the /etc/hosts file within a multi-machine
|
98
97
|
environment
|