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
|
def distro_dispatch
|
||||||
@vm.communicate.tap do |comm|
|
@vm.communicate.tap do |comm|
|
||||||
if comm.test("cat /etc/debian_version") == 0
|
if comm.test("cat /etc/debian_version")
|
||||||
return :debian if comm.test("cat /proc/version | grep 'Debian'") == 0
|
return :debian if comm.test("cat /proc/version | grep 'Debian'")
|
||||||
return :ubuntu if comm.test("cat /proc/version | grep 'Ubuntu'") == 0
|
return :ubuntu if comm.test("cat /proc/version | grep 'Ubuntu'")
|
||||||
end
|
end
|
||||||
|
|
||||||
return :gentoo if comm.test("cat /etc/gentoo-release") == 0
|
return :gentoo if comm.test("cat /etc/gentoo-release")
|
||||||
return :fedora if comm.test("grep 'Fedora release 16' /etc/redhat-release") == 0
|
return :fedora if comm.test("grep 'Fedora release 16' /etc/redhat-release")
|
||||||
return :redhat if comm.test("cat /etc/redhat-release") == 0
|
return :redhat if comm.test("cat /etc/redhat-release")
|
||||||
return :suse if comm.test("cat /etc/SuSE-release") == 0
|
return :suse if comm.test("cat /etc/SuSE-release")
|
||||||
return :arch if comm.test("cat /etc/arch-release") == 0
|
return :arch if comm.test("cat /etc/arch-release")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Can't detect the distro, assume vanilla linux
|
# Can't detect the distro, assume vanilla linux
|
||||||
|
|
|
@ -104,7 +104,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def share_manifests
|
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
|
end
|
||||||
|
|
||||||
def share_module_paths
|
def share_module_paths
|
||||||
|
@ -112,7 +112,7 @@ module VagrantPlugins
|
||||||
@module_paths.each do |from, to|
|
@module_paths.each do |from, to|
|
||||||
# Sorry for the cryptic key here, but VirtualBox has a strange limit on
|
# Sorry for the cryptic key here, but VirtualBox has a strange limit on
|
||||||
# maximum size for it and its something small (around 10)
|
# 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
|
count += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -129,10 +129,10 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_binary(binary)
|
def verify_binary(binary)
|
||||||
env[:vm].channel.sudo("which #{binary}",
|
env[:machine].communicate.sudo("which #{binary}",
|
||||||
:error_class => PuppetError,
|
:error_class => PuppetError,
|
||||||
:error_key => :not_detected,
|
:error_key => :not_detected,
|
||||||
:binary => binary)
|
:binary => binary)
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_puppet_apply
|
def run_puppet_apply
|
||||||
|
@ -158,7 +158,7 @@ module VagrantPlugins
|
||||||
env[:ui].info I18n.t("vagrant.provisioners.puppet.running_puppet",
|
env[:ui].info I18n.t("vagrant.provisioners.puppet.running_puppet",
|
||||||
:manifest => @manifest_file)
|
: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)
|
env[:ui].info(data.chomp, :prefix => false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -166,7 +166,7 @@ module VagrantPlugins
|
||||||
def verify_shared_folders(folders)
|
def verify_shared_folders(folders)
|
||||||
folders.each do |folder|
|
folders.each do |folder|
|
||||||
@logger.debug("Checking for shared folder: #{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
|
raise PuppetError, :missing_shared_folders
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue