fix: support new config file options, expose aide_version

Cause: The aide role custom config test is using the old configuration options
on newer EL9 systems which use AIDE version 0.17 and later.

Consequence: The test gives errors like "ERROR: /etc/aide.conf:12: unexpected character"
and the test fails.

Fix: The role will now determine the AIDE version, set the new aide_version variable,
and use this variable to determine the old or new style configuration.

Result: The aide system role can process custom config on all supported AIDE
versions.

See https://github.com/aide/aide/blob/master/ChangeLog#L241

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson
2025-11-24 09:26:37 -05:00
committed by Richard Megginson
parent 21e441ee90
commit 189c7a6f85
4 changed files with 57 additions and 31 deletions
+14
View File
@@ -11,6 +11,20 @@
use: "{{ (__aide_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
- name: Get AIDE version
ansible.builtin.command:
cmd: aide --version
register: __aide_version_register
changed_when: false
# assumes the version starts with a digit and goes to the end of the line
- name: Set AIDE version
set_fact:
aide_version: "{{ __output | regex_search('(?m)^A[iI][dD][eE] (\\d.*)$', '\\1') | first }}"
vars:
__output: "{{ __aide_version_register.stdout if __aide_version_register.stdout | length > 0
else __aide_version_register.stderr }}"
- name: Ensure required services are enabled and started
ansible.builtin.service:
name: "{{ item }}"