Hi,
   You can use here the concept of partial template.
Try including 

<%= scope.function_template("foo.rb") %>

This may help you, please refer 
http://somethingsinistral.net/blog/partial-templates-with-puppet/
Here is the link, someone has faced the similar issue as including file in 
template, refer 
http://stackoverflow.com/questions/16551717/how-to-include-a-subtemplate-in-a-puppet-template.
I hope its useful to you.

Thanks and Regards,
Sneha More,
NTT DATA GTS, OSS Center, India

On Tuesday, October 1, 2013 8:07:26 AM UTC+5:30, Tom Noonan wrote:
>
> Hello, folks: 
>
> I want to include a file into my templates to deduplicate code. 
> However, I'm running into problems with the module path.  If I try to 
> include the relative path with code like the following it fails: 
>
>     # Fails 
>     require 'foo.rb' 
>
> However, a fully qualified path succeeds: 
>
>     # Works as expected 
>     require '/etc/puppet/modules/foobar/templates/foo.rb' 
>
> While the latter works it causes problems if I want to move the 
> module.  Am I overlooking something here?  I've grepped through the 
> variables passed into the templates and I don't see any paths passed in 
> that I could use. 
>
> Thanks in advance. 
>
> --Tom Noonan II 
>

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to