Merge pull request #5770 from mitchellh/pr-4847

Add nfs and flavor cap to Fedora
This commit is contained in:
Seth Vargo 2015-05-31 19:07:04 -07:00
commit 50f8c161e3
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,23 @@
module VagrantPlugins
module GuestFedora
module Cap
class Flavor
def self.flavor(machine)
# Read the version file
version = nil
machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data|
if type == :stdout
version = data.split("=")[1].chomp.to_i
end
end
if version.nil?
return :fedora
else
return "fedora_#{version}".to_sym
end
end
end
end
end
end

View File

@ -0,0 +1,11 @@
module VagrantPlugins
module GuestFedora
module Cap
class NFSClient
def self.nfs_client_install(machine)
machine.communicate.sudo("yum -y install nfs-utils nfs-utils-lib")
end
end
end
end
end

View File

@ -25,6 +25,16 @@ module VagrantPlugins
require_relative "cap/network_scripts_dir"
Cap::NetworkScriptsDir
end
guest_capability("fedora", "flavor") do
require_relative "cap/flavor"
Cap::Flavor
end
guest_capability("fedora", "nfs_client_install") do
require_relative "cap/nfs_client"
Cap::NFSClient
end
end
end
end