Hi

I'm migrating my puppet configuration from 3.6 to v4.2, but I'm having some 
problem with ip type facts. For example, I have this line :

priority          => inline_template('<%= 256 - 
ipaddress.split(".")[3].to_i %>')

on puppet 3.6 and it works, putting there the last octet of my ip address. 
on puppet 4.2 I get:

==> node-1: Error: Evaluation Error: Error while evaluating a Function 
Call, Failed to parse inline template: undefined local variable or method 
`ipaddress' for #<Puppet::Parser::TemplateWrapper:0x00000003d44628> at 
/tmp/vagrant-puppet/environments/test/manifests/default.pp:25:16 on node 
node-1.station

I think it depends on the new facts being no longer strings. in facts this 
works:

file { "/var/lib/zookeeper/myid":
    ensure => 
present,                                                                        
                                                   

    content => "${ipaddress}"
}

my file contains the whole ip address, but with this: 

file { "/var/lib/zookeeper/myid":
    ensure => 
present,                                                                        
                                                   

    content => "${ipaddress.split('.')[3]}"
}

the file is empty
any idea?

thanks in advance
the file contains 



-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bc86501d-24b0-4439-83c9-84120a32219a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to