From 9bbfbef9776cd107cb1c17893985059f8e570ef2 Mon Sep 17 00:00:00 2001 From: Ben Hines Date: Mon, 27 Apr 2015 23:09:07 -0700 Subject: [PATCH] Be a bit more robust when parsing environment.conf --- plugins/provisioners/puppet/provisioner/puppet.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index e2c7b17e1..00cc1554c 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -57,14 +57,17 @@ module VagrantPlugins end def parse_environment_metadata + # Parse out the environment manifest path since puppet apply doesnt do that for us. environment_conf = File.join(environments_guest_path, @config.environment, "environment.conf") if @machine.communicate.test("test -e #{environment_conf}", sudo: true) conf = @machine.communicate.sudo("cat #{environment_conf}") do | type, data| if type == :stdout - # Parse out the environment manifest path since puppet apply doesnt do that for us. - if data =~ /\s+manifest\s+=\s(.*)/ - @manifest_file = $1 - @manifest_file.gsub! '$basemodulepath:', "#{environments_guest_path}/#{@config.environment}/" + data.each_line do |line| + if line =~ /^\s*manifest\s+=\s+([^\s]+)/ + @manifest_file = $1 + @manifest_file.gsub! '$basemodulepath:', "#{environments_guest_path}/#{@config.environment}/" + @logger.debug("Using manifest from environment.conf: #{@manifest_file}") + end end end end