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

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/44d69bdb-8d11-e136-db6a-f3b53bc8417c%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to