Skip to content

Commit

Permalink
Print possible errors in {{ __default_system_log }}
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi authored and richm committed Jun 5, 2024
1 parent f87f754 commit 6e91b4a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/tasks/assert_varlogmessages.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# SPDX-License-Identifier: MIT
---
- name: Get content of {{ __default_system_log }}
command: cat {{ __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
- name: Ensure no errors in {{ __default_system_log }}
assert:
Expand Down

0 comments on commit 6e91b4a

Please sign in to comment.