Upload facts to temp dir before sudoing them to final location.

This commit is contained in:
Ben Hines 2015-07-15 17:13:47 -07:00
parent bfb66f3166
commit 97a9cd35fc
1 changed files with 6 additions and 3 deletions

View File

@ -129,11 +129,14 @@ module VagrantPlugins
@facter_config_path = "/ProgramData/PuppetLabs/facter/facts.d/vagrant_facts.yaml" @facter_config_path = "/ProgramData/PuppetLabs/facter/facts.d/vagrant_facts.yaml"
end end
t = Tempfile.new("vagrant_facts.yaml") t = Tempfile.new("vagrant_facts.yaml")
t.write(config.facter) t.write(config.facter)
t.close() t.close()
@machine.communicate.upload(t.path, @facter_config_path) @machine.communicate.tap do |comm|
comm.upload(t.path, File.join(@config.temp_dir, "vagrant_facts.yaml"))
comm.sudo("cp #{config.temp_dir}/vagrant_facts.yaml #{@facter_config_path}")
end
end end
run_puppet_apply run_puppet_apply
end end