From 8efea88f584f5739d7940af6b8d21ea8f62ece6a Mon Sep 17 00:00:00 2001 From: Simon Peeters Date: Thu, 25 Mar 2021 20:33:19 +0100 Subject: [PATCH] use windows newlines in puppet.conf --- manifests/config/entry.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/config/entry.pp b/manifests/config/entry.pp index cf30f471..8a1a45f3 100644 --- a/manifests/config/entry.pp +++ b/manifests/config/entry.pp @@ -25,17 +25,21 @@ } else { $_value = $value } + $nl = $facts['os']['family'] ? { + 'Windows' => "\r\n", + default => "\n", + } # note the spaces at he end of the 'order' parameters, # they make sure that '1_main ' is ordered before '1_main_*' ensure_resource('concat::fragment', "puppet.conf_${section}", { target => "${puppet::dir}/puppet.conf", - content => "\n[${section}]", + content => "${nl}[${section}]", order => "${sectionorder}_${section} ", }) ensure_resource('concat::fragment', "puppet.conf_${section}_end", { target => "${puppet::dir}/puppet.conf", - content => "\n", + content => $nl, order => "${sectionorder}_${section}~end", }) @@ -44,7 +48,7 @@ if (!defined(Concat::Fragment["puppet.conf_${section}_${key}"])){ concat::fragment{"puppet.conf_${section}_${key}": target => "${puppet::dir}/puppet.conf", - content => "\n ${key} = ${_value}", + content => "${nl} ${key} = ${_value}", order => "${sectionorder}_${section}_${key} ", } } else {