Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top