On Tuesday, September 16, 2014 12:26:24 PM UTC-5, Juan Sierra Pons wrote:
>
> Hi guys, 
>
> From your comments I see that there are 2 issues here the parser and 
> the anchor. For clarity shake I have deleted the anchor resources and 
> Class defaults as I don't fully understand the purpose of if they have 
> meaning on my environment, even after reading the link you provided. 
> After this all the manifest seem to behave as before. 
>
> My puppet.conf working configuration with 3.6 was like this: 
>
> [...] 
> parser       = future 
> evaluator   = current 
> [...] 
>
>

Please be aware that the future parser is basically a beta / technology 
preview.  It is not guaranteed to be consistent even between minor Puppet 
versions, and I really wouldn't recommend enabling it on production systems.

 

> I needed the parser and the evaluator set like this to get some piece 
> of code from the [1] terrarum blog to work: 
>
>

If the terrarun examples you linked to earlier are characteristic of that 
blog's technical quality, then I am not very impressed.  If they are 
recommending using the future parser without warning you about the 
implications then I am not impressed at all.

 

> $trusted_networks = hiera_array('trusted_networks') 
> $trusted_networks.each |$network| { 
>   firewall { "003 allow all traffic from ${network}": 
>     proto  => 'all', 
>     source => $network, 
>     action => 'accept', 
>   } 
> } 
>
>

The future parser does make things like that easier, which is a big part of 
why it's being developed, but they are not impossible with Puppet 3's 
default parser.  The old-school way to perform code that particular bit of 
configuration would go something like this:

some.pp:
----
# ...
$trusted_networks = hiera_array('trusted_networks') 
my_module::trusted_network_firewall { $trusted_networks: }
# ...

modules/my_module/manifests/trusted_network_firewall.pp
----
define my_module::trusted_network_firewall () {
  some_module::firewall { "003 allow all traffic from ${title}": 
    proto  => 'all', 
    source => $title, 
    action => 'accept', 
  } 
} 


 

> On the other side I have comment out the parser and evaluator lines 
> because they are giving  problems with other modules too: 
>
> Error: Could not retrieve catalog from remote server: Error 400 on 
> SERVER: This Type-Name is not productive. A non productive construct 
> may only be placed last in a block/sequence at 
> /etc/puppet/environments/production/modules/postgresql/manifests/server/database.pp:73:3
>  
>
> on node server.example.com 
>
> So as far as I know my systems is as it was with 3.6 but the 
> trusted_networks are not being applied as they need the parser = 
> future. 
>
>

Henrik would know for sure, but if your code worked in 3.6 (with the future 
parser) but broke in 3.7 (still with the future parser) then it seems 
reasonable to attribute that to changes in the future parser.  Certainly 
the error message you first reported points that direction.  As I already 
said, the future parser should not be assumed stable.  (You should be able 
to rely on its stability once it is released as the standard parser in 
Puppet 4, however.)


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/81617cfc-5c2f-4bf0-8e86-6f116ec251d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to