test.pp
$config = { 
    host1 => {
       port => 1111,
       msg  => 'dfdasfas'
    },
    host2 => {
       port => 2222,
       msg  => 'dfdasfas'
    },
  }

file { '/tmp/file.txt':
  content => template('file.txt.erb'),
}

file.txt.erb:
keys: <%= @config.keys %>

$ puppet apply --templatedir=templates/ test.pp 

this works on puppet 3.2, but it fails on puppet 2.7 with:
Unknown function keys at /home/vagrant/test.pp:12

why?

I guess that this depends on the version of ruby used for handling 
templates. why ruby version does puppet 2.7 and puppet 3 use?

what is a workaround to make this work on puppet 2.7?


-- 
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/c743e957-c58e-448e-a70f-d83a815197fd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to