I have noticed, since upgrading to 2.1.2.0 from 2.1.1.0, that the cron module is now creating cron jobs for the root user, in addition to the user specified. For example:
- name: install cron job (ansible run)
cron: user=“ansible” name=“my job” minute=“30” job=“uptime > /dev/null”
If I run this playbook on the shell, it runs as expected. User “myuser” will have the cronjob “my job” created. However, if I run this playbook via cron, the job will ALSO be created under root’s crontab. Please note that the cron that runs this playbook is NOT being run as root. It’s being run as the ansible user. Before 2.1.2.0, this worked as intended. Now, every time my system runs its playbooks, it gets duplicate cron jobs (one for the specified user, and another for root).
I’m assuming this is a bug, but I figured I’d check here first.