On Wednesday, August 1, 2018 at 5:05:32 AM UTC-5, Helmut Schneider wrote:
>
> Hi,
>
> is there a way to format text in epp? Something like
>
> a 100
> abc 20
> defgds 30
>
> Thank you!
>
> <%- | Hash $postfixTransport
> | -%>
> # This file is managed by Puppet, don't edit it by hand.
> # All changes will be overwritten!
>
> <% if ($postfixTransport) { -%>
> <% $postfixTransport.each |$domain, $target| { -%>
> <%= $domain %> <%= $target %>
> <% } -%>
> <% } -%>
>
>
EPP has access to all operators, functions, and types available in the
current Puppet environment, both built-in and module-provided. Among
Puppet's built-in functions is sprintf
<https://puppet.com/docs/puppet/5.5/function.html#sprintf>, which is a
wrapper for Ruby's Kernel::sprintf <https://apidock.com/ruby/Kernel/sprintf>,
which in turn is inspired by C's sprintf. It can perform the kind of
formatting you're looking for, perhaps something like this:
<% $postfixTransport.each |$domain, $target| { -%>
<%= sprintf("%-10s %4d", $domain, $target) %>
<% } -%>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/23c52ca2-92e5-4741-ba79-153ffd59cf57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.