diff --git a/manifests/config.pp b/manifests/config.pp index 8beb9f96..bb2a9f31 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -82,15 +82,17 @@ -> case $::osfamily { 'Windows': { concat { "${puppet_dir}/puppet.conf": - mode => '0674', + mode => '0674', + ensure_newline => true, } } default: { concat { "${puppet_dir}/puppet.conf": - owner => 'root', - group => $::puppet::params::root_group, - mode => '0644', + owner => 'root', + group => $::puppet::params::root_group, + mode => '0644', + ensure_newline => true, } } } diff --git a/manifests/config/entry.pp b/manifests/config/entry.pp index 6fc3ff09..315a788c 100644 --- a/manifests/config/entry.pp +++ b/manifests/config/entry.pp @@ -30,7 +30,7 @@ # 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\n[${section}]", + content => "\n[${section}]", order => "${sectionorder}_${section} ", }) @@ -39,7 +39,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 => " ${key} = ${_value}", order => "${sectionorder}_${section}_${key} ", } } else { diff --git a/spec/defines/puppet_config_entry_spec.rb b/spec/defines/puppet_config_entry_spec.rb index 18577812..a6897871 100644 --- a/spec/defines/puppet_config_entry_spec.rb +++ b/spec/defines/puppet_config_entry_spec.rb @@ -20,7 +20,7 @@ } end it 'should contain the section header' do - should contain_concat__fragment('puppet.conf_main').with_content("\n\n[main]") + should contain_concat__fragment('puppet.conf_main').with_content("\n[main]") should contain_concat__fragment('puppet.conf_main').with_order("1_main ") end it 'should contain the keyvalue pair' do @@ -41,7 +41,7 @@ } end it 'should contain the section header' do - should contain_concat__fragment('puppet.conf_main').with_content("\n\n[main]") + should contain_concat__fragment('puppet.conf_main').with_content("\n[main]") should contain_concat__fragment('puppet.conf_main').with_order("1_main ") end it 'should contain the keyvalue pair' do @@ -63,7 +63,7 @@ } end it 'should contain the section header' do - should contain_concat__fragment('puppet.conf_main').with_content("\n\n[main]") + should contain_concat__fragment('puppet.conf_main').with_content("\n[main]") should contain_concat__fragment('puppet.conf_main').with_order("1_main ") end it 'should contain the keyvalue pair' do