0

Installing AIDE needs to follow by a init proces.

aide:
pkg:
- installed

Now the following commands need to run only once:
/usr/sbin/aide --config=/etc/aide.conf --init
mv -f /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz


How to manage this in a state file?

BdK
  • 1
  • 1

1 Answers1

1

I usually do something like this:

run aide once after installation:
  cmd.run:
    - name: usr/sbin/aide --config=/etc/aide.conf --init mv -f /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
    - unless: test -e /var/lib/aide/aide.db.gz
    - require: aide

Untested, obviously, but you get the idea. The cmd.run state will only run if the command passed to the unless option returns a non-zero exit status.

cmd.run state documemtation

natxo asenjo
  • 5,641
  • 2
  • 25
  • 27