Ask Your Question
0

Scope variables in erb templates (puppet 5.x)

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

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

Comments

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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

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'] %> ###
END
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

Stats

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

Seen: 76 times

Last updated: Jul 16