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