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
+9 -15
View File
@@ -5,13 +5,17 @@
@@define DBDIR /var/lib/aide
@@define LOGDIR /var/log/aide
{% if ansible_facts['os_family'] == 'RedHat' and
ansible_facts['distribution_major_version'] in ['8','9'] %}
# The location of the database to be read.
database=file:@@{DBDIR}/aide.db.gz
{% else %}
{% if aide_version is version('0.17.0', '>=') %}
# The location of the database to be read.
database_in=file:@@{DBDIR}/aide.db.gz
# Default.
log_level=warning
report_level=changed_attributes
{% else %}
# The location of the database to be read.
database=file:@@{DBDIR}/aide.db.gz
# Default.
verbose=5
{% endif %}
# The location of the database to be written.
@@ -22,16 +26,6 @@ database_out=file:@@{DBDIR}/aide.db.new.gz
# Whether to gzip the output to database
gzip_dbout=yes
{% if ansible_facts['os_family'] == 'RedHat' and
ansible_facts['distribution_major_version'] in ['8','9'] %}
# Default.
verbose=5
{% else %}
# Default.
log_level=warning
report_level=changed_attributes
{% endif %}
report_url=file:@@{LOGDIR}/aide.log
report_url=stdout
#report_url=stderr