I found a reasonable alternative... I have a lineinfile task before the
cron task to add the "#Ansible: name" before the pre-existing line that I
want to manage through Ansible.
That works for me... I did some testing on a few scenarios and it seems to
resolve my issues.
Adam
On Thursday, January 9, 2014 3:55:58 AM UTC-8, Edgars wrote:
>
> Hi
>
> AFAIK Cron module checks only those crons which starts with #Ansible. From
> docs:
>
> - 'The module includes one line with the description of the crontab entry
> C("#Ansible: <name>")
> corresponding to the "name" passed to the module, which is used by future
> ansible/module calls
> to find/check the state.'
>
>
> I agree that this is not the best way to manage crons. Perhaps this module
> should be re-written and should use something like python-crontab
> https://pypi.python.org/pypi/python-crontab
>
> Edgars
>
>
> pirmdiena, 2014. gada 6. janvāris 22:58:17 UTC+1, Adam Morris rakstīja:
>>
>> Greetings,
>>
>> I have used the cron module in one of my playbooks and it worked
>> perfectly. However when I came to test on a second server it added a
>> second cron job identical to a previous one. The previous one was not
>> added by Ansible.
>>
>> Would it make sense to add a check to see if Ansible is planning on
>> adding an identical line to one that already exists? Does anyone else feel
>> that this might be useful or is it just me?
>>
>> Adam
>>
>
--
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.