On Tuesday, October 1, 2013 7:02:00 AM UTC-5, Sneha More wrote: > > 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 > . > >> >>
That invokes the Puppet template() function with argument "foo.rb", but from name and usage that appears to be a Ruby source file as opposed to an ERB template. The stackoverflow link looks promising, however, in that the discussion there demonstrates a technique for determining the template file's location from within the file itself, using the __FILE__ variable. To apply that to 'require'ing a Ruby source file you would probably end up with something like this: <% require File.dirname(__FILE__) + "/foo.rb" %> John -- 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.