Ask Your Question

Scope variables in erb templates (puppet 5.x)

asked 2018-07-13 10:23:26 -0600

dilana gravatar image

Folks, have a question on using scope variable syntax for populating hiera values in an erb template for puppet 5.X, when it's complex data structure, for example: consider this, @am_datasources[@am_datasource]['jndi_config']; I am trying to apply wso2am_runtime scope for this, as in like this: scope['wso2am_runtime::am_datasources....'], but still no luck, can you folks help? Thanks, Dilan.

edit retag flag offensive close merge delete


There is not enough detail to help you with your specific problem. What is the error you are getting, and do you have the value $wso2am_runtime::am_datasources defined? What does the '...' in your example indicate; a longer variable name, if so, does that exist?.

Henrik Lindberg gravatar imageHenrik Lindberg ( 2018-07-16 05:15:59 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-16 05:16:41 -0600

Henrik Lindberg gravatar image

This works just fine:

class foo::bar($fee= 'working') {
include foo::bar

$template = @(END)
This example is: ### <%= scope['foo::bar::fee'] %> ###
notice inline_template($template)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-07-13 10:23:26 -0600

Seen: 85 times

Last updated: Jul 16