mirror of https://github.com/ansible/ansible.git
cron: don't force changed=True when old crontab was empty
The cron module forces changed=True when there was no real change, but the original crontab did not contain a final newline, which is mandatory. When the user has no crontab or the user does not exist at all, crontab -l exits with 1 and the cron module correctly interprets this as "no crontab" and stores the old crontab as "". However this triggers changed=True, even if we're not going to change anything, e.g. when removing a crontab entry from a user who has no crontabs at all. Let's special-case the fact that the old crontab is empty and not force changed=True in that case.pull/23038/head
parent
6fa3cb55e1
commit
61579aebb2
Loading…
Reference in New Issue