Ensure config file ends with a new line#707
Conversation
|
Last time I tried this, it didn't do what I wanted. From the reference:
We also add newlines in places and this resulted in a hard to read file. Is this still the case? |
|
Ha, right! :) |
ekohl
left a comment
There was a problem hiding this comment.
Confirmed this fixes it and is much cleaner
|
I remember @bastelfreak trying to make a similar change and us deciding that it wasn't this easy. puppet::config::entry {'example_setting 1':
key => 'example_setting',
value => '1',
section => 'example_section',
}
puppet::config::entry {'example_setting 2':
key => 'example_setting',
value => '2',
section => 'example_section',
}would have previously generated... now it generates |
| @@ -39,7 +39,7 @@ | |||
| if (!defined(Concat::Fragment["puppet.conf_${section}_${key}"])){ | |||
| concat::fragment{"puppet.conf_${section}_${key}": | |||
There was a problem hiding this comment.
This fragment will always get a newline now. This breaks adding multiple values to the same key via different instances of puppet::config::entry (the resources added in the else below).
|
Here's the IRC logs. https://gist.github.com/alexjfisher/30fe5623f620c5af5666a93407e9e284 |
|
Adding multiple values to the same key with different |
|
It looks very deliberate to me. The fragment in the |
|
Right! :( Removing it does indeed sound like a better option than just leaving it in. @ekohl What do you think? |
The puppet.conf file doesn't end with a newline which makes it hard to
cat. This ensure that the file will end with a newline.