vagrant-nfs_guest 0.1.8 → 0.1.9
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 +4 -4
- data/README.md +2 -1
- data/example_box/Vagrantfile +2 -1
- data/lib/vagrant-nfs_guest/action/mount_nfs.rb +13 -2
- data/lib/vagrant-nfs_guest/hosts/bsd/cap/mount_nfs.rb +4 -1
- data/lib/vagrant-nfs_guest/hosts/bsd/cap/unmount_nfs.rb +3 -1
- data/lib/vagrant-nfs_guest/hosts/linux/cap/mount_nfs.rb +4 -1
- data/lib/vagrant-nfs_guest/hosts/linux/cap/unmount_nfs.rb +3 -1
- data/lib/vagrant-nfs_guest/providers/virtualbox/cap/nfs_settings.rb +4 -4
- data/lib/vagrant-nfs_guest/synced_folder.rb +1 -2
- data/lib/vagrant-nfs_guest/version.rb +1 -1
- data/templates/locales/en.yml +10 -0
- 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: eacf9d0633d8e0afd331d14d080dc251b5d425e8
|
4
|
+
data.tar.gz: 59e695490518b3c97c3e2c9be1a6dcc1ad27a2b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b2f3a1163f71f6f72720b2033f4455c7caedbc943a933ab97e999a22ef60ee9768a37038b9ec8eddd8ae255719ea2c5423c58349611ffd10e076cba23f45c0
|
7
|
+
data.tar.gz: 5a468411da16a54b95296e9070a5e732d53e5c8d262e8d9031284df9614964f5ff1e558ce6692ced1dee74a194a5b7f7762ebc64ff943e2a8cdb2792d9d11d9c
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## What's New?
|
4
4
|
|
5
|
-
- NEW: added untested support for
|
5
|
+
- NEW: added untested support for Docker providers (Please raise any issues if they don't work!).
|
6
|
+
- NEW: added Parallels provider support
|
6
7
|
- NEW: Redhat/CentOS guest support added.
|
7
8
|
- FIXED: suspend and resume with 'up' instead of 'resume' fixed.
|
8
9
|
- Supports Vagrant > 1.6.
|
data/example_box/Vagrantfile
CHANGED
@@ -14,13 +14,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
14
14
|
# Create a private network, which allows host-only access to the machine
|
15
15
|
# using a specific IP.
|
16
16
|
config.vm.network "private_network", ip: "192.168.55.10"
|
17
|
+
#config.vm.network "public_network"
|
17
18
|
|
18
19
|
# Share an additional folder to the guest VM. The first argument is
|
19
20
|
# the path on the host to the actual folder. The second argument is
|
20
21
|
# the path on the guest to mount the folder. And the optional third
|
21
22
|
# argument is a set of non-required options.
|
22
23
|
config.vm.synced_folder '.', '/vagrant', disabled: true
|
23
|
-
|
24
24
|
config.vm.synced_folder './vagrant_share', '/vagrant', type: 'nfs_guest'
|
25
|
+
#config.vm.synced_folder './vagrant_share', '/vagrant', type: 'nfs'
|
25
26
|
|
26
27
|
end
|
@@ -36,6 +36,19 @@ module VagrantPlugins
|
|
36
36
|
raise SyncedFolderNFSGuest::Errors::ProviderNFSSettingsCapMissing
|
37
37
|
end
|
38
38
|
|
39
|
+
# grab the folders to check if any use nfs_guest and require host networking
|
40
|
+
folders = @machine.config.vm.synced_folders
|
41
|
+
nfs_guest = false
|
42
|
+
folders.each do |name, opts|
|
43
|
+
if opts[:type] == :nfs_guest
|
44
|
+
nfs_guest = true
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
if not nfs_guest
|
49
|
+
return
|
50
|
+
end
|
51
|
+
|
39
52
|
# grab the ips from the provider
|
40
53
|
host_ip, machine_ip = @machine.provider.capability(:nfs_settings)
|
41
54
|
|
@@ -50,8 +63,6 @@ module VagrantPlugins
|
|
50
63
|
if installed
|
51
64
|
# Mount guest NFS folders
|
52
65
|
@machine.ui.info(I18n.t("vagrant_nfs_guest.actions.vm.nfs.mounting"))
|
53
|
-
folders = @machine.config.vm.synced_folders
|
54
|
-
|
55
66
|
@machine.env.host.capability(:nfs_mount, @machine.ui, @machine.id, machine_ip, folders)
|
56
67
|
end
|
57
68
|
end
|
@@ -15,8 +15,11 @@ module VagrantPlugins
|
|
15
15
|
guestpath: opts[:guestpath],
|
16
16
|
hostpath: opts[:hostpath]))
|
17
17
|
|
18
|
+
mount_options = opts.fetch(:mount_options, ["noatime"])
|
19
|
+
nfs_options = mount_options.empty? ? "" : "-o #{mount_options.join(',')}"
|
20
|
+
|
18
21
|
system("mkdir -p #{opts[:hostpath]}")
|
19
|
-
mount_command = "mount -t nfs
|
22
|
+
mount_command = "mount -t nfs #{nfs_options} '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
|
20
23
|
if system(mount_command)
|
21
24
|
break
|
22
25
|
end
|
@@ -14,8 +14,10 @@ module VagrantPlugins
|
|
14
14
|
guestpath: opts[:guestpath],
|
15
15
|
hostpath: opts[:hostpath]))
|
16
16
|
|
17
|
+
unmount_options = opts.fetch(:unmount_options, []).join(" ")
|
18
|
+
|
17
19
|
expanded_host_path = `printf #{opts[:hostpath]}`
|
18
|
-
umount_msg = `umount '#{expanded_host_path}' 2>&1`
|
20
|
+
umount_msg = `umount #{unmount_options} '#{expanded_host_path}' 2>&1`
|
19
21
|
|
20
22
|
if $?.exitstatus != 0
|
21
23
|
if not umount_msg.include? 'not currently mounted'
|
@@ -15,8 +15,11 @@ module VagrantPlugins
|
|
15
15
|
guestpath: opts[:guestpath],
|
16
16
|
hostpath: opts[:hostpath]))
|
17
17
|
|
18
|
+
mount_options = opts.fetch(:mount_options, ["noatime"])
|
19
|
+
nfs_options = mount_options.empty? ? "" : "-o #{mount_options.join(',')}"
|
20
|
+
|
18
21
|
system("mkdir -p #{opts[:hostpath]}")
|
19
|
-
mount_command = "sudo mount -t nfs
|
22
|
+
mount_command = "sudo mount -t nfs #{nfs_options} '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
|
20
23
|
if system(mount_command)
|
21
24
|
break
|
22
25
|
end
|
@@ -14,8 +14,10 @@ module VagrantPlugins
|
|
14
14
|
guestpath: opts[:guestpath],
|
15
15
|
hostpath: opts[:hostpath]))
|
16
16
|
|
17
|
+
unmount_options = opts.fetch(:unmount_options, []).join(" ")
|
18
|
+
|
17
19
|
expanded_host_path = `printf #{opts[:hostpath]}`
|
18
|
-
umount_msg = `sudo umount '#{expanded_host_path}' 2>&1`
|
20
|
+
umount_msg = `sudo umount #{unmount_options} '#{expanded_host_path}' 2>&1`
|
19
21
|
|
20
22
|
if $?.exitstatus != 0
|
21
23
|
if not umount_msg.include? 'not currently mounted'
|
@@ -1,14 +1,14 @@
|
|
1
|
+
require "vagrant/util/retryable"
|
2
|
+
|
1
3
|
module VagrantPlugins
|
2
4
|
module SyncedFolderNFSGuest
|
3
5
|
module ProviderVirtualBox
|
4
6
|
module Cap
|
7
|
+
extend Vagrant::Util::Retryable
|
5
8
|
|
6
9
|
def self.nfs_settings(machine)
|
7
10
|
adapter, host_ip = self.find_host_only_adapter(machine)
|
8
11
|
machine_ip = self.read_static_machine_ips(machine) || self.read_dynamic_machine_ip(machine, adapter)
|
9
|
-
|
10
|
-
raise Vagrant::Errors::NFSNoHostonlyNetwork if !host_ip || !machine_ip
|
11
|
-
|
12
12
|
return host_ip, machine_ip
|
13
13
|
end
|
14
14
|
|
@@ -77,7 +77,7 @@ module VagrantPlugins
|
|
77
77
|
end
|
78
78
|
|
79
79
|
# Separating these out so we can stub out the sleep in tests
|
80
|
-
def retry_options
|
80
|
+
def self.retry_options
|
81
81
|
{tries: 15, sleep: 1}
|
82
82
|
end
|
83
83
|
end
|
@@ -34,8 +34,7 @@ module VagrantPlugins
|
|
34
34
|
host_ip, machine_ip = machine.provider.capability(:nfs_settings)
|
35
35
|
machine_ip = [machine_ip] if !machine_ip.is_a?(Array)
|
36
36
|
|
37
|
-
raise Vagrant::Errors::
|
38
|
-
raise Vagrant::Errors::NFSNoGuestIP if !machine_ip
|
37
|
+
raise Vagrant::Errors::NFSNoHostonlyNetwork if !host_ip || !machine_ip
|
39
38
|
|
40
39
|
if machine.config.nfs_guest.verify_installed
|
41
40
|
if machine.guest.capability?(:nfs_server_installed)
|
data/templates/locales/en.yml
CHANGED
@@ -41,6 +41,16 @@ en:
|
|
41
41
|
Stdout from the command:
|
42
42
|
%{stdout}
|
43
43
|
|
44
|
+
Stderr from the command:
|
45
|
+
%{stderr}
|
46
|
+
nfs_create_mounts_failed: |-
|
47
|
+
Something failed while creating the NFS mounts on the guest.
|
48
|
+
|
49
|
+
%{command}
|
50
|
+
|
51
|
+
Stdout from the command:
|
52
|
+
%{stdout}
|
53
|
+
|
44
54
|
Stderr from the command:
|
45
55
|
%{stderr}
|
46
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-nfs_guest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Garfield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|