diff --git a/plugins/provisioners/chef/cap/redhat/chef_install.rb b/plugins/provisioners/chef/cap/redhat/chef_install.rb index f91356d13..7e72a902e 100644 --- a/plugins/provisioners/chef/cap/redhat/chef_install.rb +++ b/plugins/provisioners/chef/cap/redhat/chef_install.rb @@ -6,21 +6,17 @@ module VagrantPlugins module Redhat module ChefInstall def self.chef_install(machine, project, version, channel, options = {}) - if dnf?(machine) - machine.communicate.sudo("dnf install -y -q curl") - else - machine.communicate.sudo("yum install -y -q curl") - end + machine.communicate.sudo <<-EOH.gsub(/^ {14}/, '') + if command -v dnf; then + dnf -y install curl + else + yum -y install curl + fi + EOH command = Omnibus.sh_command(project, version, channel, options) machine.communicate.sudo(command) end - - protected - - def self.dnf?(machine) - machine.communicate.test("/usr/bin/which -s dnf") - end end end end