Add more capabilities for Fedora guests
This commit is contained in:
parent
ece8e858a6
commit
efd7b459dd
|
@ -0,0 +1,25 @@
|
|||
module VagrantPlugins
|
||||
module GuestFedora
|
||||
module Cap
|
||||
class Flavor
|
||||
def self.flavor(machine)
|
||||
# Read the version file
|
||||
output = ""
|
||||
machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data|
|
||||
output += data if type == :stdout
|
||||
end
|
||||
version = output.split("=")[1].chomp!.to_i
|
||||
|
||||
# Detect various flavors we care about
|
||||
if version >= 20
|
||||
return :"fedora_#{version}"
|
||||
else if version >= 20
|
||||
return :"fedora_#{version}"
|
||||
else
|
||||
return :fedora
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
module VagrantPlugins
|
||||
module GuestFedora
|
||||
module Cap
|
||||
class NFSClient
|
||||
def self.nfs_client_install(machine)
|
||||
machine.communicate.tap do |comm|
|
||||
comm.sudo("yum -y install nfs-utils nfs-utils-lib")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue