2
votes

I seem to have run into a syntax error on a previously-working puppet manifest. This is running on a local vagrant box with Ubuntu 12.04, and Puppet version 3.4.2. The puppet stuff was all generated at puphpet.com.

The error I'm getting is:

Error: Could not parse for environment production: Syntax error at '|' at /tmp/vagrant-puppet/manifests/default.pp:263:29 on node vagrant.example.com

Line 263 of default.pp is the second line of this snippet:

if count($php_values['ini']) > 0 {
  $php_values['ini'].each { |$key, $value|
    puphpet::ini { $key:
      entry       => "CUSTOM/${key}",
      value       => $value,
      php_version => $php_values['version'],
      webserver   => $php_webserver_service
    }
  }
}
1

1 Answers

3
votes

It looks like you haven't set parser to future.

Run this command:

puppet config print parser

If it returns current, you don't have access to the .each function. To change this, edit /etc/puppet/puppet.conf, and put parser = future under the [main] block. The above command should then return future.

Reference: http://docs.puppetlabs.com/references/latest/function.html#each