-
-
Notifications
You must be signed in to change notification settings - Fork 54
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 boolean variable to change behavior of multi-line actions in conf… #204
Add boolean variable to change behavior of multi-line actions in conf… #204
Conversation
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.
Not a user of the module so only reporting style issues.
data/common.yaml
Outdated
@@ -26,6 +26,7 @@ rsyslog::parser_priority: 45 | |||
rsyslog::template_priority: 50 | |||
rsyslog::filter_priority: 55 | |||
rsyslog::action_priority: 60 | |||
rsyslog::dont_linebreak_actions: false |
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.
Don't add default value to Hiera if they are not changed from one OS to another. This prevent puppet-string from displaying default-values when generating the module REFERENCE file.
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.
I did not know this. Thanks for the explanation. Wouldn't it be prudent, then to apply this policy to all of the pre-existing variables in common.yaml?
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.
IMHO it is a good idea, submitting this is a follow-up PR is fine.
Please update REFERENCE.md with $ bundle exec rake strings:generate:reference Add it to the PR and CI should continue. |
@smortex, I updated REFERENCE.md as you suggested but still there are errors. |
It still show "REFERENCE.md is outdated". Maybe your bundle is outdated? I run the following and it passed:
|
Perhaps I'm misunderstanding but the tests are not passing. |
@@ -3,17 +3,19 @@ | |||
String $target, | |||
String $confdir, | |||
String $type, | |||
Boolean $dont_linebreak_actions = $rsyslog::dont_linebreak_actions, |
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.
Considering a catalog with:
rsyslog::component::action { 'foo':
# ...
}
this will fail because the rsyslog
was not included (it is included on line 10, but the parameter default value need it before that code is run).
The following would work:
include rsyslog
rsyslog::component::action { 'foo':
# ...
}
The test suite probably need to be adjusted to ensure the main class of the module is included before testing the rsyslog::component::action
class:
https://rspec-puppet.com/documentation/defined_types/#specifying-code-to-include-before
0ddac64
to
355d76b
Compare
355d76b
to
a71dac3
Compare
Added a boolean variable to control the multi-line behavior of the action module. If rsyslog::dont_linebreak_actions == TRUE then all the options in the action will be on a single line.
This behavior might be necessary if you have CIS or STIG scans on your /etc/rsyslog.d configuration files that are looking for settings on a single line such as:
^\s*([^#]+\s+)?action\(([^#]+\s+)?\btarget="?[^#"]+"?\b
and
^\s*\*\.\*\s+@
These regexs will fail even if the configuration is correct but spans multiple lines.