Windows: puppet replaces Windows line endings by Linux line endings when using epp template

52 views
Skip to first unread message

exx3...@gmail.com

unread,
Dec 2, 2016, 10:28:27 AM12/2/16
to Puppet Users
Hello out there,

as puppet newbie I'm trying to create an ini file on Windows 2008 SP2 with puppet 4.8.0.
I'm using an epp template for this purpose:

 file { "${iniFileDir}\\CS2_PKCS11.INI":
   
ensure => file,
   content
=> epp('my_module/CS2_PKCS11.INI.epp'),
 
}

The epp file contains Windows line endings. But the resulting ini file has Linux line endings.
How can I change this?

I've found this very similar issue here: https://tickets.puppetlabs.com/browse/PUP-927
It reports the same behavior for erb templates.
But this issue is considered to be fixed since puppet 4.1.0. Can it be that it never has been fixed for epp templates?

BTW: nearly always when I google a specfic puppet question that arises in practice (like this one) I only find general puppet introduction tutorials. Hardly ever I find the actual answer to my problem. Are there so few puppet users out there? Or are there any tricks I need to know to find the answers?

Thanks and Regards,
Carstem

Henrik Lindberg

unread,
Dec 2, 2016, 10:39:12 AM12/2/16
to puppet...@googlegroups.com
On 02/12/16 13:56, exx3...@gmail.com wrote:
> Hello out there,
>
> as puppet newbie I'm trying to create an ini file on Windows 2008 SP2
> with puppet 4.8.0.
> I'm using an epp template for this purpose:
>
> |
> file {"${iniFileDir}\\CS2_PKCS11.INI":
> ensure=>file,
> content =>epp('my_module/CS2_PKCS11.INI.epp'),
> }
> |
>
> The epp file contains Windows line endings. But the resulting ini file
> has Linux line endings.
> How can I change this?
>
Not in a nice way. You would need to post process the result and
insert a \r before every \n.

Please file a ticket a reference PUP-927 as the fix for ERB.
(I looked at PUP-927 and see I commented a long time ago that we need to
fix this for EPP as well).

- henrik

> I've found this very similar issue
> here: https://tickets.puppetlabs.com/browse/PUP-927
> It reports the same behavior for erb templates.
> But this issue is considered to be fixed since puppet 4.1.0. Can it be
> that it never has been fixed for epp templates?
>
> BTW: nearly always when I google a specfic puppet question that arises
> in practice (like this one) I only find general puppet introduction
> tutorials. Hardly ever I find the actual answer to my problem. Are there
> so few puppet users out there? Or are there any tricks I need to know to
> find the answers?
>
> Thanks and Regards,
> Carstem
>
> --
> 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...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/f9eb37bc-ce23-4428-b825-1712676ecaf4%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/f9eb37bc-ce23-4428-b825-1712676ecaf4%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

exx3...@gmail.com

unread,
Dec 2, 2016, 11:09:44 AM12/2/16
to Puppet Users
Thanks for your answer, Hernik.

I've filed PUP-6968.
It's a very minimalistic report. I hope it's sufficient.

Carsten
Reply all
Reply to author
Forward
0 new messages