diff --git a/plugins/guests/fedora/cap/flavor.rb b/plugins/guests/fedora/cap/flavor.rb new file mode 100644 index 000000000..2a29f50b5 --- /dev/null +++ b/plugins/guests/fedora/cap/flavor.rb @@ -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 diff --git a/plugins/guests/fedora/cap/nfs_client.rb b/plugins/guests/fedora/cap/nfs_client.rb new file mode 100644 index 000000000..58e084510 --- /dev/null +++ b/plugins/guests/fedora/cap/nfs_client.rb @@ -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 diff --git a/plugins/guests/fedora/plugin.rb b/plugins/guests/fedora/plugin.rb index 66b2d111f..78e376f96 100644 --- a/plugins/guests/fedora/plugin.rb +++ b/plugins/guests/fedora/plugin.rb @@ -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