From acc4e3806fce9e941a25362b3a4be4d1383203be Mon Sep 17 00:00:00 2001 From: Torben Knerr Date: Tue, 16 Dec 2014 23:40:22 +0100 Subject: [PATCH] pass the `download_path` parameter to the `:chef_install` capability so it is available when `Omnibus.build_command(..)` is invoked --- plugins/provisioners/chef/cap/debian/chef_install.rb | 4 ++-- plugins/provisioners/chef/cap/redhat/chef_install.rb | 4 ++-- plugins/provisioners/chef/installer.rb | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/provisioners/chef/cap/debian/chef_install.rb b/plugins/provisioners/chef/cap/debian/chef_install.rb index 5bb5f6acb..3d9302d80 100644 --- a/plugins/provisioners/chef/cap/debian/chef_install.rb +++ b/plugins/provisioners/chef/cap/debian/chef_install.rb @@ -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 diff --git a/plugins/provisioners/chef/cap/redhat/chef_install.rb b/plugins/provisioners/chef/cap/redhat/chef_install.rb index 49db9bf9c..c6aff7bad 100644 --- a/plugins/provisioners/chef/cap/redhat/chef_install.rb +++ b/plugins/provisioners/chef/cap/redhat/chef_install.rb @@ -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 diff --git a/plugins/provisioners/chef/installer.rb b/plugins/provisioners/chef/installer.rb index e8b08f10d..16467111c 100644 --- a/plugins/provisioners/chef/installer.rb +++ b/plugins/provisioners/chef/installer.rb @@ -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