On 11-06-16 05:36 AM, Roband wrote:
> i can't use array in puppet. Here is my codesnipplet:
>
> $callapidata = [ 'wert1','wert2']
> notice $callapidata[1]
try something like the following instead of the second line:
notice { $callapidata[1]: }
--
Gabriel Filion
kbarber:~ ken$ puppet --version
2.6.8
kbarber:~ ken$ puppet -e '$callapidata = [ 'wert1','wert2'] notice
$callapidata[1]'
notice: Scope(Class[main]): wert2
notice: Finished catalog run in 0.01 seconds
kbarber:~ ken$
ken.
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>
Should this be:
$var0 = inline_template("<%=myarray[0]%>")
If this type of feature is needed it can be provided via puppet
function. The examples here
https://github.com/puppetlabs/puppetlabs-functions can provide a jump
start for converting any quick hacks via inline_template to something
that's much more maintainable.
Thanks,
Nan