vagrant-hostmanager 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -19
- data/lib/vagrant-hostmanager/hosts_file/updater.rb +2 -7
- data/lib/vagrant-hostmanager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 075560d0ced2cfb86f6b0e4688ef929ff3d7883d
|
4
|
+
data.tar.gz: 0f7fcfd445d8b99f37b506c200fc2f1f1e1dfb9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48e7d74ad76e812646c25f9fdb65ca36b6077e83caaf53b28005a2e8a0daf1b4fe8006c97026354077f16dc1c27234c1319bbea2519902dba80c950d031f3f01
|
7
|
+
data.tar.gz: 4f5afe7118dedf2bbae2c1f8d04c75ad5955fe356ad2e17d6b2e0410dafdb0110058c52c1df7e8243e89c831854d2ae466ee2b03e9399d51535b3365bb1a0828
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
Vagrant Host Manager
|
2
2
|
====================
|
3
3
|
|
4
|
+
[![Gem](https://img.shields.io/gem/v/vagrant-hostmanager.svg)](https://rubygems.org/gems/vagrant-hostmanager)
|
4
5
|
[![Gem](https://img.shields.io/gem/dt/vagrant-hostmanager.svg)](https://rubygems.org/gems/vagrant-hostmanager)
|
5
6
|
[![Gem](https://img.shields.io/gem/dtv/vagrant-hostmanager.svg)](https://rubygems.org/gems/vagrant-hostmanager)
|
6
7
|
[![Twitter](https://img.shields.io/twitter/url/https/github.com/smdahlen/vagrant-hostmanager.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20this%20awesome%20Vagrant%20plugin%21&url=https%3A%2F%2Fgithub.com%2Fsmdahlen%2Fvagrant-hostmanager&hashtags=vagrant%hostmanager&original_referer=)
|
@@ -120,13 +121,31 @@ end
|
|
120
121
|
Passwordless sudo
|
121
122
|
-----------------
|
122
123
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
actual home directory):
|
124
|
+
To avoid being asked for the password every time the hosts file is updated,
|
125
|
+
enable passwordless sudo for the specific command that hostmanager uses to
|
126
|
+
update the hosts file.
|
127
127
|
|
128
|
-
|
129
|
-
|
128
|
+
- Add the following snippet to the sudoers file (e.g.
|
129
|
+
`/etc/sudoers.d/vagrant_hostmanager`):
|
130
|
+
|
131
|
+
```
|
132
|
+
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp <home-directory>/.vagrant.d/tmp/hosts.local /etc/hosts
|
133
|
+
%<admin-group> ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
|
134
|
+
```
|
135
|
+
|
136
|
+
Replace `<home-directory>` with your actual home directory (e.g.
|
137
|
+
`/home/joe`) and `<admin-group>` with the group that is used by the system
|
138
|
+
for sudo access (usually `sudo` on Debian/Ubuntu systems and `wheel`
|
139
|
+
on Fedora/Red Hat systems).
|
140
|
+
|
141
|
+
- If necessary, add yourself to the `<admin-group>`:
|
142
|
+
|
143
|
+
```
|
144
|
+
usermod -aG <admin-group> <user-name>
|
145
|
+
```
|
146
|
+
|
147
|
+
Replace `<admin-group>` with the group that is used by the system for sudo
|
148
|
+
access (see above) and `<user-name>` with you user name.
|
130
149
|
|
131
150
|
Windows support
|
132
151
|
---------------
|
@@ -148,19 +167,6 @@ and give your user Modify permission.
|
|
148
167
|
Due to limitations caused by UAC, cancelling out of the UAC prompt will not cause any
|
149
168
|
visible errors, however the ```hosts``` file will not be updated.
|
150
169
|
|
151
|
-
Installing development version
|
152
|
-
------------------------------
|
153
|
-
|
154
|
-
If you want to install the bleeding version of vagrant-hostmanager (*at your own risk*), you can do the following
|
155
|
-
(requires ruby and git):
|
156
|
-
|
157
|
-
```
|
158
|
-
git clone https://github.com/smdahlen/vagrant-hostmanager.git
|
159
|
-
cd vagrant-hostmanager
|
160
|
-
rake gem:build
|
161
|
-
vagrant plugin install pkg/vagrant-hostmanager-*.gem
|
162
|
-
```
|
163
|
-
|
164
170
|
|
165
171
|
Contribute
|
166
172
|
----------
|
@@ -174,6 +180,17 @@ To contribute, fork then clone the repository, and then the following:
|
|
174
180
|
3. Then install vagrant-hostmanager dependancies:
|
175
181
|
* `bundle _1.6.9_ install`
|
176
182
|
|
183
|
+
**Testing**
|
184
|
+
|
185
|
+
1. Build and package your newly developed code:
|
186
|
+
* `rake gem:build`
|
187
|
+
2. Then install the packaged plugin:
|
188
|
+
* `vagrant plugin install pkg/vagrant-hostmanager-*.gem`
|
189
|
+
3. Once you're done testing, roll-back to the latest released version:
|
190
|
+
* `vagrant plugin uninstall vagrant-hostmanager`
|
191
|
+
* `vagrant plugin install vagrant-hostmanager`
|
192
|
+
4. Once you're satisfied developing and testing your new code, please submit a pull request for review.
|
193
|
+
|
177
194
|
**Releasing**
|
178
195
|
|
179
196
|
To release a new version of vagrant-hostmanager you will need to do the following:
|
@@ -17,17 +17,14 @@ module VagrantPlugins
|
|
17
17
|
|
18
18
|
if (machine.communicate.test("uname -s | grep SunOS"))
|
19
19
|
realhostfile = '/etc/inet/hosts'
|
20
|
-
move_cmd = 'mv'
|
21
20
|
elsif (machine.communicate.test("test -d $Env:SystemRoot"))
|
22
21
|
windir = ""
|
23
22
|
machine.communicate.execute("echo %SYSTEMROOT%", {:shell => :cmd}) do |type, contents|
|
24
23
|
windir << contents.gsub("\r\n", '') if type == :stdout
|
25
24
|
end
|
26
25
|
realhostfile = "#{windir}\\System32\\drivers\\etc\\hosts"
|
27
|
-
move_cmd = 'mv -force'
|
28
26
|
else
|
29
27
|
realhostfile = '/etc/hosts'
|
30
|
-
move_cmd = 'mv -f'
|
31
28
|
end
|
32
29
|
# download and modify file with Vagrant-managed entries
|
33
30
|
file = @global_env.tmp_path.join("hosts.#{machine.name}")
|
@@ -37,11 +34,9 @@ module VagrantPlugins
|
|
37
34
|
# upload modified file and remove temporary file
|
38
35
|
machine.communicate.upload(file, '/tmp/hosts')
|
39
36
|
if windir
|
40
|
-
machine.communicate.sudo("
|
41
|
-
elsif machine.communicate.test('test -f /.dockerinit')
|
42
|
-
machine.communicate.sudo("cat /tmp/hosts > #{realhostfile}")
|
37
|
+
machine.communicate.sudo("mv -force /tmp/hosts/hosts.#{machine.name} #{realhostfile}")
|
43
38
|
else
|
44
|
-
machine.communicate.sudo("
|
39
|
+
machine.communicate.sudo("cat /tmp/hosts > #{realhostfile}")
|
45
40
|
end
|
46
41
|
end
|
47
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-hostmanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Dahlen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|