On 26.01.17 20:46 Manas Shukla wrote:
> As I understand the ansible cron module prefixes all the cron jobs
> set by it with* #Ansible: Name *and uses this to manage them in the
> future. My existing crontabs do not have this tag prefixed. Can I
> still update and delete them through Ansible cron module ?
The lineinfile is always an option, but you lose a lot of ansibles
simplicity, and the regexp stuff is horror...
I would try to convert your existing cronjobs to ansible syntax (i.e.
write an ansible task that spits out the same line in the crontab) and
then prefix your lines with the corresponding "#Ansibe: foo" line.
This can be done manually, via template or with lineinefile.
It all depends on the variety of your existing cronjobs. One per
server? 20? The same everywhere, only with different arguments?
Testing this with the disabled option to the cron module seems like a
good idea. ;-)
Johannes