I have to convert a string in base64 before placing it inside a template with puppet. Is there a function available and how? Thanks Luca -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/ZgLjlG_IeI4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
----- Original Message -----> From: "Luca Gioppo" <lucagioppo@gmail.com> > To: puppet-users@googlegroups.com > Sent: Monday, October 15, 2012 8:51:43 AM > Subject: [Puppet Users] base64 within module > > I have to convert a string in base64 before placing it inside a > template with puppet. > Is there a function available and how?not sure if there''s a puppet function - do not think so. but if you''re just going to use it in the template as base64 then do this in your template: require ''base64'' Base64.encode64(yourvar) the ''require'' line is probably not needed -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Luca, I have to convert a string in base64 before placing it inside a template> with puppet. > Is there a function available and how? >Puppet templates are embedded ruby, and you can do almost anything you can with regular ruby. So you the Base64 module from ruby: <% require ''base64'' %> <%= Base64.encode64(''foobar'') %> Cheers, Paul -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VGxscxdr3bgJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.