Skip to content

Commit

Permalink
use windows newlines in puppet.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Peeters committed Mar 25, 2021
1 parent fd3be99 commit 8efea88
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions manifests/config/entry.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
})

Expand All @@ -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 {
Expand Down

0 comments on commit 8efea88

Please sign in to comment.