Make puppet provisioner work with latest machine changes.
Specifically it was still reference env[:vm] which is now `env[:machine]`.
This commit is contained in:
parent
391dc39267
commit
b328e95045
|
@ -17,16 +17,16 @@ module VagrantPlugins
|
|||
|
||||
def distro_dispatch
|
||||
@vm.communicate.tap do |comm|
|
||||
if comm.test("cat /etc/debian_version") == 0
|
||||
return :debian if comm.test("cat /proc/version | grep 'Debian'") == 0
|
||||
return :ubuntu if comm.test("cat /proc/version | grep 'Ubuntu'") == 0
|
||||
if comm.test("cat /etc/debian_version")
|
||||
return :debian if comm.test("cat /proc/version | grep 'Debian'")
|
||||
return :ubuntu if comm.test("cat /proc/version | grep 'Ubuntu'")
|
||||
end
|
||||
|
||||
return :gentoo if comm.test("cat /etc/gentoo-release") == 0
|
||||
return :fedora if comm.test("grep 'Fedora release 16' /etc/redhat-release") == 0
|
||||
return :redhat if comm.test("cat /etc/redhat-release") == 0
|
||||
return :suse if comm.test("cat /etc/SuSE-release") == 0
|
||||
return :arch if comm.test("cat /etc/arch-release") == 0
|
||||
return :gentoo if comm.test("cat /etc/gentoo-release")
|
||||
return :fedora if comm.test("grep 'Fedora release 16' /etc/redhat-release")
|
||||
return :redhat if comm.test("cat /etc/redhat-release")
|
||||
return :suse if comm.test("cat /etc/SuSE-release")
|
||||
return :arch if comm.test("cat /etc/arch-release")
|
||||
end
|
||||
|
||||
# Can't detect the distro, assume vanilla linux
|
||||
|
|
|
@ -104,7 +104,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def share_manifests
|
||||
env[:vm].config.vm.share_folder("manifests", manifests_guest_path, @expanded_manifests_path)
|
||||
env[:machine].config.vm.share_folder("manifests", manifests_guest_path, @expanded_manifests_path)
|
||||
end
|
||||
|
||||
def share_module_paths
|
||||
|
@ -112,7 +112,7 @@ module VagrantPlugins
|
|||
@module_paths.each do |from, to|
|
||||
# Sorry for the cryptic key here, but VirtualBox has a strange limit on
|
||||
# maximum size for it and its something small (around 10)
|
||||
env[:vm].config.vm.share_folder("v-pp-m#{count}", to, from)
|
||||
env[:machine].config.vm.share_folder("v-pp-m#{count}", to, from)
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
|
@ -129,10 +129,10 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def verify_binary(binary)
|
||||
env[:vm].channel.sudo("which #{binary}",
|
||||
:error_class => PuppetError,
|
||||
:error_key => :not_detected,
|
||||
:binary => binary)
|
||||
env[:machine].communicate.sudo("which #{binary}",
|
||||
:error_class => PuppetError,
|
||||
:error_key => :not_detected,
|
||||
:binary => binary)
|
||||
end
|
||||
|
||||
def run_puppet_apply
|
||||
|
@ -158,7 +158,7 @@ module VagrantPlugins
|
|||
env[:ui].info I18n.t("vagrant.provisioners.puppet.running_puppet",
|
||||
:manifest => @manifest_file)
|
||||
|
||||
env[:vm].channel.sudo(command) do |type, data|
|
||||
env[:machine].communicate.sudo(command) do |type, data|
|
||||
env[:ui].info(data.chomp, :prefix => false)
|
||||
end
|
||||
end
|
||||
|
@ -166,7 +166,7 @@ module VagrantPlugins
|
|||
def verify_shared_folders(folders)
|
||||
folders.each do |folder|
|
||||
@logger.debug("Checking for shared folder: #{folder}")
|
||||
if !env[:vm].channel.test("test -d #{folder}")
|
||||
if !env[:machine].communicate.test("test -d #{folder}")
|
||||
raise PuppetError, :missing_shared_folders
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue