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|
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),
}
You need neither inline_template nor inline_epp - you can do that
transformation directly in puppet. (Untested rewrite - pardon typos):
$header = "LD_LIBRARY_PATH=$destdir:\$LD_LIBRARY_PATH\n\nexport
LD_LIBRARY_PATH\n"
$format = "${memcache_command} -m ${memory_per_instance} -p %s &"
$entries = $ports.map |$port| { sprintf($format, $port) }.join("\n")
file { "$destdir/startmemcached.sh":
ensure => file,
owner => $title,
group => $title,
mode => '0744',
content => "${header}\n${entries}\n"
}
Hope that is of value,
Best,
- henrik
--
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/pi05sc%24qed%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.