New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter to not create empty files when no fragments are defined #766
Conversation
165ddaf
to
1e0308a
Compare
By default concat would always create an empty file if no fragment was defined. Sometimes we don't want a file unless it has content.
1e0308a
to
2b61a6f
Compare
Ran a rubocop:auto_correct, should be good now. Also, this is a non-breaking change. Default behaviour is how it was before the param existed. |
@LukasAud Seems like the two failing jobs are due to a provisioning error? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Waiting for acceptance to finish before merging. |
Did this change introduce a regression? I had puppetlabs/concat v7.3.0 and saz/ssh v10.0.0 installed on my puppet7 server.
I immediately reverted back to concat v7.3.0 (I let saz/ssh v10.1.0 remain) and everything started working fine again. I see in the changelog for puppetlabs/concat v7.4.0, that changes were made for "create_empty_file" stuff, so this PR seems relevant. :) Unfortunately I needed to stress my revert to get all my puppet nodes running, so I don't have any more debug information. The code calling Concat_file[/etc/ssh/sshd_config] is Steffen Siegler's module https://forge.puppet.com/modules/saz/ssh/readme v10.1.0. |
@elofu17 This sounds very much alike #772 (see the mention above your comment). The module you mention (saz/ssh) has the same "outdated" version requirement (i.e. lower than 8). Could you test with puppetlabs/concat v7.4.0? That version should have the new param as well but should work, given the metadata of saz/ssh v10.1.0. If that works, then metadata is here the issue as well. :) |
I will upgrade concat from 7.3.0 to 7.4.0 now and see. |
Identical error with 7.4.0 as with 8.0.0. |
Same issue here with puppet-nginx 4.4.0 and puppetlabs-concat 8.0.0, as well as with puppetlabs-concat 7.4.0.
Highest version that works is concat 7.3.3. |
Nope. :-) I don't even know what you are saying to be honest. :) I've always just bumped the module version number in my Puppetfile. Then a client node performs a puppet run, and the error is triggered. I.e. I don't restart the puppet server, I don't clear its caches, I don't generate types or anything. Is this wrong? |
I just tested upgrading to v8.0.0 again, and then restarted the puppet server. It sounds like I was using some cached version instead of the new. I'll remember to restart the server (or clear its cache) upon bumping modules in the future. Sorry to have wasted your time, and thanks for your comments. |
@elofu17 no worries, most important part is that it's fixed! A colleague pointed out that r10k probably takes care of the type generation, so I think you're good. (We're not using r10k, which is why we need to run the type generation manually) @siebrand could you test bumping and then restarting puppetserver as well? |
FYI: https://www.puppet.com/docs/puppet/7/man/generate.html is the manpage for the command. It is important when using multiple environments because Puppetserver sometimes has a hard time isolating them. It's even the first item in the r10k FAQ: https://github.com/puppetlabs/r10k/blob/main/doc/faq.mkd#how-can-run-i-puppet-generate-types-for-each-changed-environment-during-deployment |
@JonasVerhofste I can confirm that the issue with 7.4.0/8.0.0 does not surface after a restart of puppetserver. Thank you for the help. |
By default concat would always create an empty file if no fragment was defined. Sometimes we don't want a file unless it has content.