Serving static data from a task?

14 views
Skip to first unread message

Howard Jones

unread,
May 11, 2018, 6:13:30 AM5/11/18
to puppet-razor
As part of several install tasks, I need to provide additional drivers for the particular hardware we're using (Dell 14G). If possible, I'd like to keep these additional files with the task, so that I can just keep that one directory in version control. Is there an ERB helper like file_url() that doesn't pass the file through the template processor, and just returns the bits in the file instead?

Thanks,

Howard

Tim Bishop

unread,
May 11, 2018, 11:51:44 AM5/11/18
to Howard Jones, puppet-razor
Hi Howard,

Looks like file_url() has a raw flag, defaulting to false, which when
set returns the contents of the file without passing it through the
processor. Will that do what you want?

https://github.com/puppetlabs/razor-server/blob/master/app.rb#L136

Tim.
--
Tim Bishop
http://www.bishnet.net/tim/
PGP Key: 0x6C226B37FDF38D55

Howard Jones

unread,
May 11, 2018, 11:55:22 AM5/11/18
to Tim Bishop, puppet-razor
n 11/05/2018 16:51, Tim Bishop wrote:
> Hi Howard,
>
> Looks like file_url() has a raw flag, defaulting to false, which when
> set returns the contents of the file without passing it through the
> processor. Will that do what you want?
>
> https://github.com/puppetlabs/razor-server/blob/master/app.rb#L136
There I go trusting the docs again ;-)

That looks promising, I'll give it a try. Thanks!

Howard

Howard Jones

unread,
May 14, 2018, 9:01:37 AM5/14/18
to puppet-razor
On Friday, 11 May 2018 16:55:22 UTC+1, Howard Jones wrote:

That looks promising, I'll give it a try. Thanks!


So just for the record, this worked fine to serve driver files from the task directory:

dud=<%= file_url('megaraid_sas-07.700.52.00-2-sles12sp2.x86_64.iso', raw=true)%>


Scott McClellan

unread,
May 21, 2018, 1:27:21 PM5/21/18
to puppet...@googlegroups.com
Just to follow up on this, we've modified the docs going forward to include this optional flag. I'll note too that the second argument can even be passed as simply `true` rather than `raw=true`.

--
You received this message because you are subscribed to the Google Groups "puppet-razor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-razor...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-razor.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages