vagrant-cachier-ng/lib/vagrant-cachier/cap/linux/chef_file_cache_path.rb
Fabio Rehm 00e2d858da Merge branch 'vagrant_1-7-1_fix' of https://github.com/Yserz/vagrant-cachier
Conflicts:
	lib/vagrant-cachier/cap/linux/chef_file_cache_path.rb
2015-01-14 23:04:32 -02:00

30 lines
902 B
Ruby

module VagrantPlugins
module Cachier
module Cap
module Linux
module ChefFileCachePath
def self.chef_provisioner?(machine)
provisioners = machine.config.vm.provisioners
chef_provisioners = [:chef_solo, :chef_client]
compat_provisioners = provisioners.select { |p| chef_provisioners.include? p.name || p.type }
if compat_provisioners.size > 1
raise "One machine is using multiple chef provisioners, which is unsupported."
end
using_chef = compat_provisioners.empty? ? false : true
using_chef
end
def self.chef_file_cache_path(machine)
chef_file_cache_path = nil
chef_file_cache_path = '/var/chef/cache' if chef_provisioner?(machine)
return chef_file_cache_path
end
end
end
end
end
end