vagrant-nfs_guest 0.1.1 → 0.1.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41d9296319bda57f729a890c777c5f62d8ce02d9
|
4
|
+
data.tar.gz: f0a6dde015a24f3d0b64329a3ecbfdcbd80cc6d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 220e555748ee2d07ce05b4c31a18c4c865ac157a848db732344e411b84fe81fc8b8d55cb78bd3a1a885c42a0d54c80065ea8d6b96de94cdbb021c35866c1311b
|
7
|
+
data.tar.gz: 95dd9fb2783f243f6f7b8c567f1b845f6d68f800584ba298fe0c2e21ac4d1549bee0d783f88395260691e601228345c2c8d712c331390f514270fa3fb94d7050
|
data/README.md
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
## What's New?
|
4
4
|
|
5
|
-
- Supports Vagrant 1.6!
|
5
|
+
- Supports Vagrant 1.6! (For pre-1.5 vagrant support use the v0.0.4 release as Vagrant has incompatible changes)
|
6
6
|
- Handles actions ```up```, ```halt```, ```destroy```, ```suspend```, ```resume``` and ```package``` properly
|
7
7
|
- Uses retryable() for host to guest communications allow more fault tolerance
|
8
8
|
- Better error messages and handling
|
9
9
|
- Re-organisation of modules and class to better match Vagrant proper
|
10
10
|
- Simplified the plugin events binding
|
11
|
+
- Will install the NFS daemon on the guest if the guest capability is supported (Ubuntu only at this stage)
|
11
12
|
|
12
13
|
## Overview
|
13
14
|
|
@@ -15,6 +16,9 @@ Allows a guest VM to export synced folders via NFS and the host to mount them.
|
|
15
16
|
|
16
17
|
Basically it's just the usual NFS synced folders in Vagrant but the roles are reversed.
|
17
18
|
|
19
|
+
**WARNING** this has only been tested fully using an OSX host and a Ubuntu guest.
|
20
|
+
We're happy to receive pull-request to support alternatives hosts and guests. To implement this support is relatively trivial if you look in ./lib/hosts and ./lib/guests, and then just modify the "plugin.py" to include the new capabilities.
|
21
|
+
|
18
22
|
## Installation
|
19
23
|
|
20
24
|
vagrant plugin install vagrant-nfs_guest
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module SyncedFolderNFSGuest
|
3
|
+
module HostLinux
|
4
|
+
module Cap
|
5
|
+
class MountNFS
|
6
|
+
|
7
|
+
def self.nfs_mount(environment, ui, id, ips, folders)
|
8
|
+
folders.each do |name, opts|
|
9
|
+
if opts[:type] != :nfs_guest
|
10
|
+
next
|
11
|
+
end
|
12
|
+
|
13
|
+
ips.each do |ip|
|
14
|
+
ui.detail(I18n.t("vagrant.actions.vm.share_folders.mounting_entry",
|
15
|
+
guestpath: opts[:guestpath],
|
16
|
+
hostpath: opts[:hostpath]))
|
17
|
+
|
18
|
+
system("mkdir -p #{opts[:hostpath]}")
|
19
|
+
mount_command = "sudo mount -t nfs -o noatime '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
|
20
|
+
if system(mount_command)
|
21
|
+
break
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module SyncedFolderNFSGuest
|
3
|
+
module HostLinux
|
4
|
+
module Cap
|
5
|
+
class UnmountNFS
|
6
|
+
|
7
|
+
def self.nfs_unmount(environment, ui, folders)
|
8
|
+
folders.each do |name, opts|
|
9
|
+
if opts[:type] != :nfs_guest
|
10
|
+
next
|
11
|
+
end
|
12
|
+
|
13
|
+
ui.detail(I18n.t("vagrant.actions.vm.share_folders.mounting_entry",
|
14
|
+
guestpath: opts[:guestpath],
|
15
|
+
hostpath: opts[:hostpath]))
|
16
|
+
|
17
|
+
expanded_host_path = `printf #{opts[:hostpath]}`
|
18
|
+
umount_msg = `sudo umount '#{expanded_host_path}' 2>&1`
|
19
|
+
|
20
|
+
if $?.exitstatus != 0
|
21
|
+
if not umount_msg.include? 'not currently mounted'
|
22
|
+
ui.info umount_msg
|
23
|
+
ui.info "Maybe NFS mounts still in use!"
|
24
|
+
exit(1)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
begin
|
2
2
|
require "vagrant"
|
3
3
|
rescue LoadError
|
4
|
-
raise "The Vagrant
|
4
|
+
raise "The Vagrant NFS Guest plugin must be run within Vagrant."
|
5
5
|
end
|
6
6
|
|
7
7
|
# This is a sanity check to make sure no one is attempting to install
|
8
8
|
# this into an early Vagrant version.
|
9
9
|
if Vagrant::VERSION < "1.2.0"
|
10
|
-
raise "The Vagrant
|
10
|
+
raise "The Vagrant NFS Guest plugin is only compatible with Vagrant 1.2+"
|
11
11
|
end
|
12
12
|
|
13
13
|
module VagrantPlugins
|
@@ -17,8 +17,10 @@ module VagrantPlugins
|
|
17
17
|
class Plugin < Vagrant.plugin("2")
|
18
18
|
name "vagrant-nfs_guest"
|
19
19
|
description <<-DESC
|
20
|
-
The NFS Guest synced folders plugin enables you to use NFS exports from
|
21
|
-
the Guest as a synced folder implementation.
|
20
|
+
The Vagrant NFS Guest synced folders plugin enables you to use NFS exports from
|
21
|
+
the Guest as a synced folder implementation. This allows the guest to utilise
|
22
|
+
inotify (eg. file watchers) and other filesystem related functions that don't
|
23
|
+
work across NFS from the host.
|
22
24
|
DESC
|
23
25
|
|
24
26
|
config(:nfs_guest) do
|
@@ -91,6 +93,16 @@ module VagrantPlugins
|
|
91
93
|
HostBSD::Cap::UnmountNFS
|
92
94
|
end
|
93
95
|
|
96
|
+
host_capability(:linux, "nfs_mount") do
|
97
|
+
require_relative "hosts/linux/cap/mount_nfs"
|
98
|
+
HostLinux::Cap::MountNFS
|
99
|
+
end
|
100
|
+
|
101
|
+
host_capability(:linux, "nfs_unmount") do
|
102
|
+
require_relative "hosts/linux/cap/unmount_nfs"
|
103
|
+
HostLinux::Cap::UnmountNFS
|
104
|
+
end
|
105
|
+
|
94
106
|
action_hook(:nfs_guest, :machine_action_up) do |hook|
|
95
107
|
require_relative "action/prepare_nfs_guest_settings"
|
96
108
|
hook.after(
|
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.2
|
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: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,8 @@ files:
|
|
63
63
|
- lib/vagrant-nfs_guest/guests/ubuntu/cap/nfs_server.rb
|
64
64
|
- lib/vagrant-nfs_guest/hosts/bsd/cap/mount_nfs.rb
|
65
65
|
- lib/vagrant-nfs_guest/hosts/bsd/cap/unmount_nfs.rb
|
66
|
+
- lib/vagrant-nfs_guest/hosts/linux/cap/mount_nfs.rb
|
67
|
+
- lib/vagrant-nfs_guest/hosts/linux/cap/unmount_nfs.rb
|
66
68
|
- lib/vagrant-nfs_guest/plugin.rb
|
67
69
|
- lib/vagrant-nfs_guest/synced_folder.rb
|
68
70
|
- lib/vagrant-nfs_guest/version.rb
|