vagrant-bindfs 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-bindfs/bind.rb +4 -4
- data/lib/vagrant-bindfs/cap/debian/{bindfs_install.rb → install_bindfs.rb} +2 -2
- data/lib/vagrant-bindfs/cap/fedora/{bindfs_install.rb → install_bindfs.rb} +2 -2
- data/lib/vagrant-bindfs/cap/linux/bindfs_installed.rb +0 -11
- data/lib/vagrant-bindfs/cap/linux/enable_fuse.rb +15 -0
- data/lib/vagrant-bindfs/cap/linux/fuse_loaded.rb +15 -0
- data/lib/vagrant-bindfs/cap/redhat/install_bindfs.rb +27 -0
- data/lib/vagrant-bindfs/cap/suse/{bindfs_install.rb → install_bindfs.rb} +3 -3
- data/lib/vagrant-bindfs/cap/ubuntu/fuse_loaded.rb +17 -0
- data/lib/vagrant-bindfs/command.rb +3 -2
- data/lib/vagrant-bindfs/plugin.rb +34 -21
- data/lib/vagrant-bindfs/version.rb +1 -1
- data/lib/vagrant-bindfs.rb +1 -0
- data/locales/en.yml +1 -1
- metadata +9 -6
- data/lib/vagrant-bindfs/cap/redhat/bindfs_install.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb0a221dbae3d1303dff2f6f52617ab02e105a2d
|
4
|
+
data.tar.gz: 2c91c80a71052fe269ca380e18bf73b156b3dde9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 905e8a4e965323dc8433c6365707ad316159e9048697c838212fb328e2c50f303a84a4b2a13283ea41092c0ab24799cc0e942ce98ac538e70564c5d32027c2db
|
7
|
+
data.tar.gz: a8e7c4271630137d2374ce44c29582f65580d6426eff5500cc75149350a337eb31247d246a30b2cfd57ab95bf16767634f7d6dd0a9be20573cd55b2c9cf405a7
|
data/lib/vagrant-bindfs/bind.rb
CHANGED
@@ -66,16 +66,16 @@ module VagrantPlugins
|
|
66
66
|
unless @machine.guest.capability(:bindfs_installed)
|
67
67
|
@env[:ui].warn(I18n.t("vagrant.config.bindfs.not_installed"))
|
68
68
|
|
69
|
-
unless @machine.guest.capability(:
|
69
|
+
unless @machine.guest.capability(:install_bindfs)
|
70
70
|
raise Vagrant::Bindfs::Error, :cannot_install
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
unless @machine.guest.capability(:
|
74
|
+
unless @machine.guest.capability(:fuse_loaded)
|
75
75
|
@env[:ui].warn(I18n.t("vagrant.config.bindfs.not_loaded"))
|
76
76
|
|
77
|
-
unless @machine.guest.capability(:
|
78
|
-
raise Vagrant::Bindfs::Error, :
|
77
|
+
unless @machine.guest.capability(:enable_fuse)
|
78
|
+
raise Vagrant::Bindfs::Error, :cannot_enable_fuse
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -2,9 +2,9 @@ module VagrantPlugins
|
|
2
2
|
module Bindfs
|
3
3
|
module Cap
|
4
4
|
module Debian
|
5
|
-
module
|
5
|
+
module InstallBindfs
|
6
6
|
|
7
|
-
def self.
|
7
|
+
def self.install_bindfs(machine)
|
8
8
|
machine.communicate.tap do |comm|
|
9
9
|
comm.sudo("apt-get update")
|
10
10
|
comm.sudo("apt-get install -y bindfs")
|
@@ -2,9 +2,9 @@ module VagrantPlugins
|
|
2
2
|
module Bindfs
|
3
3
|
module Cap
|
4
4
|
module Fedora
|
5
|
-
module
|
5
|
+
module InstallBindfs
|
6
6
|
|
7
|
-
def self.
|
7
|
+
def self.install_bindfs(machine)
|
8
8
|
machine.communicate.tap do |comm|
|
9
9
|
comm.sudo('yum -y install bindfs')
|
10
10
|
end
|
@@ -8,17 +8,6 @@ module VagrantPlugins
|
|
8
8
|
machine.communicate.test("bindfs --help")
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.loaded_fuse?(machine)
|
12
|
-
machine.communicate.test("lsmod | grep -q fuse || grep -q fuse /etc/modules")
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.modprobe_fuse(machine)
|
16
|
-
unless machine.communicate.test("grep -q fuse /etc/modules")
|
17
|
-
machine.communicate.sudo("bash -c \"echo 'fuse' >> /etc/modules\"")
|
18
|
-
end
|
19
|
-
machine.communicate.sudo("/sbin/modprobe fuse")
|
20
|
-
end
|
21
|
-
|
22
11
|
end
|
23
12
|
end
|
24
13
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "vagrant-bindfs/version"
|
2
|
+
|
3
|
+
module VagrantPlugins
|
4
|
+
module Bindfs
|
5
|
+
module Cap
|
6
|
+
module RedHat
|
7
|
+
module InstallBindfs
|
8
|
+
|
9
|
+
def self.install_bindfs(machine)
|
10
|
+
machine.communicate.tap do |comm|
|
11
|
+
if comm.test("test 0 -eq $(sudo yum search bindfs 2>&1 >/dev/null | wc -l)")
|
12
|
+
comm.sudo("yum -y install bindfs")
|
13
|
+
else
|
14
|
+
comm.sudo("yum -y install fuse fuse-devel gcc")
|
15
|
+
comm.sudo("wget http://bindfs.org/downloads/bindfs-#{SOURCE_VERSION}.tar.gz -O bindfs.tar.gz")
|
16
|
+
comm.sudo("tar --overwrite -zxvf bindfs.tar.gz")
|
17
|
+
comm.sudo("[ -d ./bindfs-#{SOURCE_VERSION} ] && cd bindfs-#{SOURCE_VERSION} && ./configure && make && make install")
|
18
|
+
comm.sudo("ln -s /usr/local/bin/bindfs /usr/bin")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module VagrantPlugins
|
2
2
|
module Bindfs
|
3
3
|
module Cap
|
4
|
-
module
|
5
|
-
module
|
4
|
+
module Suse
|
5
|
+
module InstallBindfs
|
6
6
|
|
7
|
-
def self.
|
7
|
+
def self.install_bindfs(machine)
|
8
8
|
machine.communicate.tap do |comm|
|
9
9
|
comm.sudo("zypper -n install bindfs")
|
10
10
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Bindfs
|
3
|
+
module Cap
|
4
|
+
module Ubuntu
|
5
|
+
module FuseLoaded
|
6
|
+
|
7
|
+
def self.fuse_loaded(machine)
|
8
|
+
# Ubuntu 6.10 and after automatically load fuse.
|
9
|
+
# Just check if it is installed
|
10
|
+
machine.communicate.test("test -e /dev/fuse")
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -152,8 +152,9 @@ module VagrantPlugins
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def bindfs_version_lower_than(version)
|
155
|
-
|
156
|
-
@machine.communicate.
|
155
|
+
bindfs_version_command = %{sudo bindfs --version | cut -d" " -f2}
|
156
|
+
bindfs_version = @machine.communicate.execute(bindfs_version_command);
|
157
|
+
Gem::Version.new(bindfs_version) < Gem::Version.new(version)
|
157
158
|
end
|
158
159
|
|
159
160
|
end
|
@@ -1,51 +1,63 @@
|
|
1
1
|
module VagrantPlugins
|
2
2
|
module Bindfs
|
3
3
|
class Plugin < Vagrant.plugin("2")
|
4
|
+
|
4
5
|
name "Bindfs"
|
5
6
|
description <<-DESC
|
6
7
|
This plugin allows you to mount -o bind filesystems inside the guest. This is
|
7
8
|
useful to change their ownership and permissions.
|
8
9
|
DESC
|
9
10
|
|
11
|
+
|
10
12
|
config(:bindfs) do
|
11
13
|
require "vagrant-bindfs/config"
|
12
14
|
Config
|
13
15
|
end
|
16
|
+
|
14
17
|
|
15
|
-
guest_capability("
|
16
|
-
require "vagrant-bindfs/cap/
|
17
|
-
Cap::
|
18
|
+
guest_capability("linux", "bindfs_installed") do
|
19
|
+
require "vagrant-bindfs/cap/linux/bindfs_installed"
|
20
|
+
Cap::Linux::BindfsInstalled
|
18
21
|
end
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
|
24
|
+
guest_capability("linux", "fuse_loaded") do
|
25
|
+
require "vagrant-bindfs/cap/linux/fuse_loaded"
|
26
|
+
Cap::Linux::FuseLoaded
|
27
|
+
end
|
28
|
+
|
29
|
+
guest_capability("ubuntu", "fuse_loaded") do
|
30
|
+
require "vagrant-bindfs/cap/ubuntu/fuse_loaded"
|
31
|
+
Cap::Ubuntu::FuseLoaded
|
23
32
|
end
|
24
33
|
|
25
|
-
|
26
|
-
|
27
|
-
|
34
|
+
|
35
|
+
guest_capability("linux", "enable_fuse") do
|
36
|
+
require "vagrant-bindfs/cap/linux/enable_fuse"
|
37
|
+
Cap::Linux::EnableFuse
|
28
38
|
end
|
39
|
+
|
29
40
|
|
30
|
-
guest_capability("
|
31
|
-
require
|
32
|
-
Cap::
|
41
|
+
guest_capability("debian", "install_bindfs") do
|
42
|
+
require "vagrant-bindfs/cap/debian/install_bindfs"
|
43
|
+
Cap::Debian::InstallBindfs
|
33
44
|
end
|
34
45
|
|
35
|
-
guest_capability("
|
36
|
-
require "vagrant-bindfs/cap/
|
37
|
-
Cap::
|
46
|
+
guest_capability("suse", "install_bindfs") do
|
47
|
+
require "vagrant-bindfs/cap/suse/install_bindfs"
|
48
|
+
Cap::Suse::InstallBindfs
|
38
49
|
end
|
39
50
|
|
40
|
-
guest_capability("
|
41
|
-
require
|
42
|
-
Cap::
|
51
|
+
guest_capability("fedora", "install_bindfs") do
|
52
|
+
require 'vagrant-bindfs/cap/fedora/install_bindfs'
|
53
|
+
Cap::Fedora::InstallBindfs
|
43
54
|
end
|
44
55
|
|
45
|
-
guest_capability("
|
46
|
-
require
|
47
|
-
Cap::
|
56
|
+
guest_capability("redhat", "install_bindfs") do
|
57
|
+
require 'vagrant-bindfs/cap/redhat/install_bindfs'
|
58
|
+
Cap::RedHat::InstallBindfs
|
48
59
|
end
|
60
|
+
|
49
61
|
|
50
62
|
require "vagrant-bindfs/bind"
|
51
63
|
|
@@ -60,6 +72,7 @@ module VagrantPlugins
|
|
60
72
|
hook.before(target, Action::Bind)
|
61
73
|
end
|
62
74
|
end
|
75
|
+
|
63
76
|
end
|
64
77
|
end
|
65
78
|
end
|
data/lib/vagrant-bindfs.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -12,7 +12,7 @@ en:
|
|
12
12
|
destination_path_relative: "Destination path is relative for bind whatever"
|
13
13
|
source_path_relative: "Source path is relative for bind whatever"
|
14
14
|
source_path_not_exist: "Cannot bind source path %{path} because it doesn't exist"
|
15
|
-
|
15
|
+
cannot_enable_fuse: "The fuse kernel module seems to not be loadable on the virtual machine"
|
16
16
|
binding_failed: |-
|
17
17
|
The bind command `%{command}` failed to run!
|
18
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-bindfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaël-Ian Havard
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: A Vagrant plugin to automate bindfs mount in the VM. This allow you to
|
16
16
|
change owner, group and permissions on files and, for example, work around NFS share
|
@@ -26,11 +26,14 @@ files:
|
|
26
26
|
- README.md
|
27
27
|
- lib/vagrant-bindfs.rb
|
28
28
|
- lib/vagrant-bindfs/bind.rb
|
29
|
-
- lib/vagrant-bindfs/cap/debian/
|
30
|
-
- lib/vagrant-bindfs/cap/fedora/
|
29
|
+
- lib/vagrant-bindfs/cap/debian/install_bindfs.rb
|
30
|
+
- lib/vagrant-bindfs/cap/fedora/install_bindfs.rb
|
31
31
|
- lib/vagrant-bindfs/cap/linux/bindfs_installed.rb
|
32
|
-
- lib/vagrant-bindfs/cap/
|
33
|
-
- lib/vagrant-bindfs/cap/
|
32
|
+
- lib/vagrant-bindfs/cap/linux/enable_fuse.rb
|
33
|
+
- lib/vagrant-bindfs/cap/linux/fuse_loaded.rb
|
34
|
+
- lib/vagrant-bindfs/cap/redhat/install_bindfs.rb
|
35
|
+
- lib/vagrant-bindfs/cap/suse/install_bindfs.rb
|
36
|
+
- lib/vagrant-bindfs/cap/ubuntu/fuse_loaded.rb
|
34
37
|
- lib/vagrant-bindfs/command.rb
|
35
38
|
- lib/vagrant-bindfs/config.rb
|
36
39
|
- lib/vagrant-bindfs/errors.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module VagrantPlugins
|
2
|
-
module Bindfs
|
3
|
-
module Cap
|
4
|
-
module RedHat
|
5
|
-
module BindfsInstall
|
6
|
-
|
7
|
-
def self.bindfs_install(machine)
|
8
|
-
machine.communicate.tap do |comm|
|
9
|
-
|
10
|
-
require "vagrant-bindfs/version"
|
11
|
-
|
12
|
-
if comm.test("grep \"CentOS release 6\" /etc/centos-release")
|
13
|
-
comm.sudo("yum -y install fuse fuse-devel")
|
14
|
-
comm.sudo("wget http://bindfs.org/downloads/bindfs-#{VagrantPlugins::Bindfs::SOURCE_VERSION}.tar.gz -O bindfs.tar.gz")
|
15
|
-
comm.sudo("tar --overwrite -zxvf bindfs.tar.gz")
|
16
|
-
comm.sudo("[ -d ./bindfs-#{VagrantPlugins::Bindfs::SOURCE_VERSION} ] && cd bindfs-#{VagrantPlugins::Bindfs::SOURCE_VERSION} && ./configure && make && make install")
|
17
|
-
comm.sudo("ln -s /usr/local/bin/bindfs /usr/bin")
|
18
|
-
else
|
19
|
-
comm.sudo("yum -y install bindfs")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end # BindfsInstall
|
25
|
-
end # RedHat
|
26
|
-
end # Cap
|
27
|
-
end # Bindfs
|
28
|
-
end # VagrantPlugins
|