test: add role fingerprints to syslog
Test updates based on testing with bootc and on other platforms. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
committed by
Richard Megginson
parent
659d89dd69
commit
5a4a533fee
+11
-2
@@ -3,16 +3,24 @@
|
|||||||
- name: Ensure that the role runs with default parameters
|
- name: Ensure that the role runs with default parameters
|
||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: See if /dev/log exists for the fingerprint check
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /dev/log
|
||||||
|
register: __register_dev_log
|
||||||
|
|
||||||
- name: Set the start time for the journal search
|
- name: Set the start time for the journal search
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
__journal_start_time: "{{ ansible_facts['date_time']['date'] ~ ' ' ~ ansible_facts['date_time']['time'] }}"
|
__journal_start_time: "{{ ansible_facts['date_time']['date'] ~ ' ' ~ ansible_facts['date_time']['time'] }}"
|
||||||
|
when: __register_dev_log.stat.exists
|
||||||
|
|
||||||
- name: Run the role
|
- name: Run the role
|
||||||
include_tasks: tasks/run_role_with_clear_facts.yml
|
include_tasks: tasks/run_role_with_clear_facts.yml
|
||||||
|
|
||||||
# look for the exact module invocation, not some other message that might contain the string
|
# look for the exact module invocation, not some other message that might contain the string
|
||||||
- name: Check system journal contains role fingerprints
|
- name: Check system journal contains role fingerprints
|
||||||
shell: >-
|
ansible.builtin.shell:
|
||||||
|
executable: /bin/bash
|
||||||
|
cmd: >-
|
||||||
set -eo pipefail;
|
set -eo pipefail;
|
||||||
journalctl --since "{{ __journal_start_time }}" --no-pager |
|
journalctl --since "{{ __journal_start_time }}" --no-pager |
|
||||||
grep -v " Invoked with" | grep "sr_fingerprint.*begin system_role:aide" ||
|
grep -v " Invoked with" | grep "sr_fingerprint.*begin system_role:aide" ||
|
||||||
@@ -21,6 +29,7 @@
|
|||||||
grep -v " Invoked with" | grep "sr_fingerprint.*success system_role:aide" ||
|
grep -v " Invoked with" | grep "sr_fingerprint.*success system_role:aide" ||
|
||||||
{ echo ERROR: SUCCESS fingerprint not found; exit 1; }
|
{ echo ERROR: SUCCESS fingerprint not found; exit 1; }
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
when: __register_dev_log.stat.exists
|
||||||
|
|
||||||
- name: Check if the file exists
|
- name: Check if the file exists
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
|
|||||||
Reference in New Issue
Block a user