# Ansible cron module creates jobs for the wrong user

**URL:** <https://forum.ansible.com/t/ansible-cron-module-creates-jobs-for-the-wrong-user/22735>\
**Category:** Ansible Project\
**Created:** [October 6, 2016, 10:16pm UTC](https://forum.ansible.com/t/ansible-cron-module-creates-jobs-for-the-wrong-user/22735 "2016-10-06T22:16:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_LaCroix](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Jay\_LaCroix](https://forum.ansible.com/u/Jay_LaCroix)\
**Post date:** [October 6, 2016, 10:16pm UTC](https://forum.ansible.com/t/ansible-cron-module-creates-jobs-for-the-wrong-user/22735/1 "2016-10-06T22:16:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nick\_Santamaria](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@Nick\_Santamaria](https://forum.ansible.com/u/Nick_Santamaria)\
**Post date:** [October 28, 2016, 11:40am UTC](https://forum.ansible.com/t/ansible-cron-module-creates-jobs-for-the-wrong-user/22735/2 "2016-10-28T11:40:12Z")

</div>

I have run into a similar issue. System info below:

host: OS X Sierra  
target: Ubuntu 16.04

`$ ansible --version ansible 2.1.2.0`

The following task results in a cron entry for the **root** user, not the **ubuntu** user.

`
