0

I'm trying to run this Puppet code, as described in Puppet documentation:

# test.pp
$a = [1, 2, 3]
$b = $a.collect |$x| { $x + 1 }
alert $b

But it gives me syntax error:

$ puppet parser validate --debug test.pp
Error: Could not parse for environment production: Syntax error at '.' at /tmp/test.pp:3
Error: Try 'puppet help parser validate' for usage
$ puppet --version
3.1.1

Please, point me out the right way.

vvolodko
  • 113
  • 1
  • 4

1 Answers1

1

According to those same docs, the collect function is available for puppet >= 3.2. You appear to be using puppet 3.1.1.

Marvin Pinto
  • 27,868
  • 7
  • 35
  • 52
  • Yes, you are right. I've already found this out myself after searching [Puppet bug tracker](http://projects.puppetlabs.com/issues/21028). And for those who like me use Puppet with Vagrant the answer to "[How do I change the puppet version installed by vagrant?](http://stackoverflow.com/questions/14792491/how-do-i-change-the-puppet-version-installed-by-vagrant)" will be useful. – vvolodko Jun 20 '13 at 10:59