pass the `download_path` parameter to the `:chef_install` capability so it is available when `Omnibus.build_command(..)` is invoked

This commit is contained in:
Torben Knerr 2014-12-16 23:40:22 +01:00
parent d7bd65b4e2
commit acc4e3806f
3 changed files with 6 additions and 5 deletions

View File

@ -5,11 +5,11 @@ module VagrantPlugins
module Cap
module Debian
module ChefInstall
def self.chef_install(machine, version, prerelease)
def self.chef_install(machine, version, prerelease, download_path)
machine.communicate.sudo("apt-get update -y -qq")
machine.communicate.sudo("apt-get install -y -qq curl")
command = Omnibus.build_command(version, prerelease)
command = Omnibus.build_command(version, prerelease, download_path)
machine.communicate.sudo(command)
end
end

View File

@ -5,10 +5,10 @@ module VagrantPlugins
module Cap
module Redhat
module ChefInstall
def self.chef_install(machine, version, prerelease)
def self.chef_install(machine, version, prerelease, download_path)
machine.communicate.sudo("yum install -y -q curl")
command = Omnibus.build_command(version, prerelease)
command = Omnibus.build_command(version, prerelease, download_path)
machine.communicate.sudo(command)
end
end

View File

@ -6,6 +6,7 @@ module VagrantPlugins
@version = options.fetch(:version, :latest)
@prerelease = options.fetch(:prerelease, :latest)
@force = options.fetch(:force, false)
@download_path = options.fetch(:download_path, nil)
end
# This handles verifying the Chef installation, installing it if it was
@ -27,7 +28,7 @@ module VagrantPlugins
@machine.ui.detail(I18n.t("vagrant.chef_installing",
version: @version.to_s))
@machine.guest.capability(:chef_install, @version, @prerelease)
@machine.guest.capability(:chef_install, @version, @prerelease, @download_path)
if !@machine.guest.capability(:chef_installed, @version)
raise Provisioner::Base::ChefError, :install_failed