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

Make testing and installing rulesets more reliable #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented Aug 10, 2023

If a pattern database is failing, it is not installed, but on subsequent run of Puppet the pattern database is not tested again and the configuration converge to a state where the expected pattern database is not installed.

Rework the pattern database testing and installation so that a failing pattern database fail on each subsequent run of Puppet, so that errors can be spotted more easily.

Fixes #42

@smortex smortex force-pushed the more-reliable-test branch 3 times, most recently from 232113c to a4f7d28 Compare August 10, 2023 23:47
@smortex smortex changed the title Make testing and installing more reliable Make testing and installing rulesets more reliable Aug 10, 2023
@smortex smortex force-pushed the more-reliable-test branch 4 times, most recently from f64ea9c to 2bed001 Compare August 11, 2023 00:23
@smortex smortex marked this pull request as ready for review August 11, 2023 00:32
@smortex smortex requested a review from faxm0dem August 11, 2023 00:44
Copy link
Member

@faxm0dem faxm0dem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to test this but it looks good, thanks !
I tested it and it works indeed using our setup.
Then it got me thinking : wouldn't it be great if /etc/syslog-ng/patterndb/ was also up-to-date, with patterns that actually validated ? I think it's overkill to pdb test all the files individually and would slow things down. But we could keep the old valid /etc/syslog-ng/patterndb/ files if the pdb test <merged file> fails, what do you think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why drop the purge ?

Copy link
Collaborator Author

@smortex smortex Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have managed file resources in this directory anymore. They used to be created in manifests/parser.pp on line 27. I removed them because when validation fail, we had empty files which can be merged successfully.

I think we can revert the purge / file resources if we add a dependency Exec["patterndb::deploy::${name}"] -> File["patterndb::file::${name}"] (i.e. manage the file at the very end, instead of using it to trigger validation and deployment).

I'll test this and report my findings.

If a pattern database is failing, it is not installed, but on subsequent
run of Puppet the pattern database is not tested again and the
configuration converge to a state where the expected pattern database is
not installed.

Rework the pattern database testing and installation so that a failling
pattern database fail on each subsequent run of Puppet, so that errors
can be spotted more easily.

Fixes #42
@smortex smortex force-pushed the more-reliable-test branch from 2bed001 to ddf1468 Compare August 31, 2023 17:43
@smortex smortex requested a review from a team as a code owner August 31, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration is deceptive on pdbtool(1) error
2 participants