On 2018-07-09 19:06, Henrik Lindberg wrote:
On 2018-07-09 18:12, Suresh P wrote:
Hi,

I used following code in puppet3.8.x,  it worked well.

After i migrated to Puppet5 it throws error.

$header="LD_LIBRARY_PATH=$destdir:\$LD_LIBRARY_PATH\n\nexport LD_LIBRARY_PATH\n" $content = inline_template('<%= header+"\n"+ports.map {|port|


You want @header in an ERB - this changed in puppet 4 I think.
Earlier you just referred to the variable name.

If you instead want to, you could switch to using EPP and
modify the syntax slightly (use $ instead of @) and slight change
in how the lambda given is written.

Best,

- henrik

memcache_command+" -m "+memory_per_instance+" -p "+port+" &"}.join("\n")+"\n" %>')
file { "$destdir/startmemcached.sh":
     ensure => file,
     owner => $title,
     group => $title,
     mode => '0744',
     content => inline_template($content),

That is also wrong, you have already called inline_template, so $content contains the result of the template.

- henrik

}

Error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Failed to parse inline template: undefined local variable or method `header' for #<Puppet::Parser::TemplateWrapper:0x5f6a0cd8> (file: /home/sas/in2_puppet/environments/production/modules/pkg/manifests/memcache/installmemcache.pp, line: 45, column: 12) (file: /home/sas/in2_puppet/environments/production/modules/in2/manifests/memcache/common.pp, line: 13) on node


Can you help me on this.

Regards,
Suresh





--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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/pi053m%24359%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to