-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: Add check for "rsyslogd: error" in /var/log/messages in all tests #388
Changes from all commits
2186ad9
408a8c1
941b12d
947916e
1a9e3c6
4ed0583
a789904
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
- name: Get content of {{ __default_system_log }} | ||
shell: cat {{ __default_system_log }} || true | ||
register: __default_system_log_content | ||
changed_when: false | ||
no_log: true | ||
|
||
- name: Print possible errors in {{ __default_system_log }} | ||
vars: | ||
errors: >- | ||
{{ __default_system_log_content.stdout | ||
| regex_search('rsyslogd: error.*') }} | ||
debug: | ||
var: errors | ||
when: errors | length > 0 | ||
|
||
# /var/log/messages sometimes contains errors not visible in journalctl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you give me an example of this happening? It seems like a journald configuration issue e.g. journal logs are being trimmed too quickly. Note that all log messages in /var/log/messages come from journal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently,
|
||
- name: Ensure no errors in {{ __default_system_log }} | ||
assert: | ||
that: "'rsyslogd: error' not in __default_system_log_content.stdout" | ||
|
||
- name: Remove {{ __default_system_log }} | ||
file: | ||
path: "{{ __default_system_log }}" | ||
state: absent |
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.
What problem is being addressed by this?
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.
On latest Fedora this causes error messages in /var/log/messages as such:
This is because the main config file was not generated yet. Why this does not fail on RHEL 8 and 9 - I have no idea.
But it seems like a good practice to start a service using a handler after the role invocation finishes.
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.
Only on Fedora 40, but not 39, or on other platforms? Sounds like an issue with the fedora 40 rsyslog package.
The rsyslog package provides a default /etc/rsyslog.conf (and possibly files in /etc/rsyslog.d/), and the service should start with the default files. If this isn't working, it is a problem with the rsyslog package.
In general, yes, but in some cases the role needs the service to be running before it can take further actions.