Method: VagrantPlugins::VagrantHyperV::Provisioner::ChefSolo#setup_json

Defined in:
lib/vagrant-windows-hyperv/provisioner/chef_solo.rb

#setup_jsonObject


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/vagrant-windows-hyperv/provisioner/chef_solo.rb', line 37

def setup_json
  @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.json")

  # Get the JSON that we're going to expose to Chef
  json = config.json
  json[:run_list] = config.run_list if !config.run_list.empty?
  json = JSON.pretty_generate(json)

  # Create a temporary file to store the data so we
  # can upload it
  temp = Tempfile.new("vagrant")
  temp.write(json)
  temp.close

  remote_file = File.join(config.provisioning_path, "dna.json")
  @env[:machine].provider.driver.upload(temp.path, remote_file)
end