Seth Vargo 3098c13869
guests/redhat: Configure NFS in one command
Previously this was very complicated trying to flip between Ruby and
bash. This commit uses a single bash command that decides between yum
and dnf in the script itself.
2016-06-06 11:58:38 -04:00

25 lines
648 B
Ruby

module VagrantPlugins
module GuestRedHat
module Cap
class NFSClient
def self.nfs_client_install(machine)
machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '')
if command -v dnf; then
dnf -y install nfs-utils nfs-utils-lib portmap
else
yum -y install nfs-utils nfs-utils-lib portmap
fi
if test $(ps -o comm= 1) == 'systemd'; then
/bin/systemctl restart rpcbind nfs
else
/etc/init.d/rpcbind restart
/etc/init.d/nfs restart
fi
EOH
end
end
end
end
end