From d5c13dda647e13e44b7850c7f84bab17182d4a8d Mon Sep 17 00:00:00 2001 From: Peter Carrero Date: Wed, 13 Apr 2016 16:11:25 -0500 Subject: [PATCH] puppet: Add "to_yaml" to facter call The rationale here is to make it so existing Vagrantfile configurations remain unchanged. While benh57's solution worked for me, I had to add a ".to_yaml" to the VagrantFile line that implemented puppet.facter and this would mean existing Vagrant configurations that use Puppet would produce an error if that was not present. Additionally, without this change, the Vagrant file also needed a "require('yaml')" declaration to make the ".to_yaml" conversion possible. --- plugins/provisioners/puppet/provisioner/puppet.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index cce0d4af8..28a3d8cf0 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -129,7 +129,7 @@ module VagrantPlugins @facter_config_path = "/ProgramData/PuppetLabs/facter/facts.d/vagrant_facts.yaml" end t = Tempfile.new("vagrant_facts.yaml") - t.write(config.facter) + t.write(config.facter.to_yaml) t.close() @machine.communicate.tap do |comm| comm.upload(t.path, File.join(@config.temp_dir, "vagrant_facts.yaml"))