Skip to content
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

Avoid emptying set file for unmanaged sets #40

Merged
merged 1 commit into from
Jun 3, 2021
Merged

Avoid emptying set file for unmanaged sets #40

merged 1 commit into from
Jun 3, 2021

Conversation

mikesmitty
Copy link
Contributor

(#39) This change applies the inverse of the ignore_content
variable to the replace parameter on *.set file resources in the
ipset::set class, preventing unmanaged ipsets from having their set
files emptied each puppet run

Pull Request (PR) description

Per the ipset::unmanaged section in the readme, unmanaged sets won't be kept if the set options are changed, but the set file is still emptied with each puppet run. It does leave the in-memory set in place, but this is less than ideal as in the event of an unexpected reboot the set could remain empty until the set file is next updated.

This change leaves the set file intact in addition to the in-memory ipset for unmanaged sets. This is more inline with my expectation of how an unmanaged set should behave, but I'm curious what you think.

This Pull Request (PR) fixes the following issues

#39

@truthsolo
Copy link

CI failure due to CentOS 6. PR is good!

@bastelfreak bastelfreak added the bug Something isn't working label Apr 23, 2021
@bastelfreak
Copy link
Member

@mikesmitty thanks for the PR! We fixed the CI issues. Can you please rebase against our latest master branch?

@mikesmitty
Copy link
Contributor Author

Sure, I just rebased it against master. I do intend to write tests at some point, but I'm a bit lacking in free time at the moment.

@mikesmitty
Copy link
Contributor Author

mikesmitty commented Jun 1, 2021

I'm pretty new to puppet-rspec so feel free to offer any suggestions. I went ahead and added a test for verifying ignore_contents: true results in replace: false being set on the set file as well as a test to ensure ipset::unmanaged creates an ipset:set with ignore_contents: true

@bastelfreak
Copy link
Member

thanks for the tests, I think they are sufficient. Can you take a look at the rubocop complaints?

(#39) This change applies the inverse of the ignore_content
variable to the replace parameter on *.set file resources in the
ipset::set class, preventing unmanaged ipsets from having their set
files emptied each puppet run
@mikesmitty
Copy link
Contributor Author

Sure, sorry about that. Resolved the rubocop error and made that function call more consistent style-wise.

@bastelfreak
Copy link
Member

tanks for the fix!

@bastelfreak bastelfreak merged commit 7008b90 into voxpupuli:master Jun 3, 2021
@mikesmitty
Copy link
Contributor Author

@bastelfreak thanks for merging it. Do you have an idea of when v1.2.4 will end up getting tagged?

@bastelfreak
Copy link
Member

we just released v2.0.0: https://forge.puppet.com/modules/puppet/ipset/changelog#v200-2021-06-03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants