Ask Your Question
0

getting scope within custom provider

asked 2013-09-18 08:59:42 -0500

evilezh gravatar image

updated 2013-09-18 09:00:36 -0500

Hello, general idea is to get template processed from my custom provider. I've created custom type and one provider for it. When user calls that type i would like to invoke tamplate('aaaa/bbb.erb') Or i can go through path: Puppet::Parser::TemplateWrapper.new , but I'll get error as there is no scope variable defined. or even i could use: Puppet::Parser::Files.findtemplate(path, scope.compiler.environment.tos) .. like in TemplateWrapper code ... but i do not have that scope defined.

Actually it is more generic question - how to use functions, classes etc. from custom ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-09-19 17:35:58 -0500

Stefan gravatar image

You may be able to call a function from within your provider (custom_functions) if the function is pluginsynced onto your agent. (Haven't tried it myself)

But you cannot access variables or templates from some manifest because they are not part of the catalog. Keep in mind that catalog compilation (including evaluating templates) happens on the master whereas your provider will always run on the agent.

What are your trying to accomplish?

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

1 follower

Stats

Asked: 2013-09-18 08:59:42 -0500

Seen: 193 times

Last updated: Sep 19 '13