feat: ensure role works on ostree systems

Ensure role works on ostree systems

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson
2025-01-31 15:35:25 -07:00
committed by Richard Megginson
parent c9f0262b04
commit cc5de8664f
2 changed files with 17 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
aide
crontabs
+15
View File
@@ -3,9 +3,24 @@
- name: Ensure that the cron is set up
hosts: all
tasks:
- name: Determine if system is ostree and set flag
when: not __aide_is_ostree is defined
block:
- name: Check if system is ostree
stat:
path: /run/ostree-booted
register: __ostree_booted_stat
- name: Set flag to indicate system is ostree
set_fact:
__aide_is_ostree: "{{ __ostree_booted_stat.stat.exists }}"
- name: Install crontabs
package:
name: crontabs
state: present
use: "{{ (__aide_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
- name: Create tempfile for crontab backup
tempfile: