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:
committed by
Richard Megginson
parent
c9f0262b04
commit
cc5de8664f
@@ -0,0 +1,2 @@
|
||||
aide
|
||||
crontabs
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user