I have a pretty simple requirement, but I've tried every escape sequence I can think of, but can't get the output needed.
I need to litterally output into a file:
%{VAR}
Here's my YAML file:
myclass::outputstuff:
- Heres a litteral var %{VAR}
- Heres something else %{SOMETHING}
And my template.erb:
<%= @outputstuff.each do | ostuff | -%>
<%= ostuff -%>
<% end -%>
But it like this, it outputs:
Heres a litteral var
Heres something else
If I add a percent sign like %%{VAR}, as advised by other posts, it outputs:
Heres a litteral var %
Heres something else %
If I add a backslash like %\{VAR} it outputs:
Heres a litteral var %\{VAR}
Heres something else %\{SOMETHING}
I need this lol:
Heres a litteral var %{VAR}
Heres something else %{SOMETHING}
With Hiera 3.3.1 you can use this in your YAML:
%%{}{EXAMPLE}
Which will output this literal:
%{EXAMPLE}
From v2.0.0 on, there is the literal function, which is the more 'proper' way to do it:
%{literal('%')}{VAR}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With