Appending cronjobs using ansible playbook

Viewed 1820

I am new in ansible. I write a playbook for managing cron jobs using cron module on my control nodes. It worked and setup cronjob in crontab but remove all other previous cron job entries. Is there any way to append crontab entries rather than removing all previous entries. My ansible playbook is as below :

---
- hosts: all
  become: true

  tasks:

  # Cron Change
    - cron:
        name: "First Entry"
        user: "root"
        minute: "30"
        hour: "6"
        job: "php /var/www/html/app/artisan cache:clear"

    - cron:
        name: "Scond Entry"
        user: "garima"
        minute: "40"
        hour: "5"
        job: "/bin/sh /scripts/rsync.sh"
1 Answers
Related