provisioners/chef: Install in one command
This commit is contained in:
parent
4ec2b2af85
commit
e925f3793a
|
@ -6,21 +6,17 @@ module VagrantPlugins
|
||||||
module Redhat
|
module Redhat
|
||||||
module ChefInstall
|
module ChefInstall
|
||||||
def self.chef_install(machine, project, version, channel, options = {})
|
def self.chef_install(machine, project, version, channel, options = {})
|
||||||
if dnf?(machine)
|
machine.communicate.sudo <<-EOH.gsub(/^ {14}/, '')
|
||||||
machine.communicate.sudo("dnf install -y -q curl")
|
if command -v dnf; then
|
||||||
else
|
dnf -y install curl
|
||||||
machine.communicate.sudo("yum install -y -q curl")
|
else
|
||||||
end
|
yum -y install curl
|
||||||
|
fi
|
||||||
|
EOH
|
||||||
|
|
||||||
command = Omnibus.sh_command(project, version, channel, options)
|
command = Omnibus.sh_command(project, version, channel, options)
|
||||||
machine.communicate.sudo(command)
|
machine.communicate.sudo(command)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def self.dnf?(machine)
|
|
||||||
machine.communicate.test("/usr/bin/which -s dnf")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue