Mamaf
Mamaf

Reputation: 360

Edit a crontab with Ansible

I would like to use Ansible in order to edit a crontab as the following line :

00 08 * * 1-5 /appli/script.ksh > /var/log/cronlog.log 2>&1

Any ideas ? Thanks !

Upvotes: 1

Views: 4277

Answers (1)

Vladimir Botka
Vladimir Botka

Reputation: 68124

Yo might want to use the cron module.

- cron:
    name: "Run script.ksh Mo-Fr at 8AM"
    minute: "0"
    hour: "8"
    weekday: "1-5"
    job: "/appli/script.ksh > /var/log/cronlog.log 2>&1"

Upvotes: 3

Related Questions