# Add feature to cron module to support state enable/disable

**URL:** <https://forum.ansible.com/t/add-feature-to-cron-module-to-support-state-enable-disable/18661>\
**Category:** Ansible Developer\
**Created:** [July 2, 2015, 1:58pm UTC](https://forum.ansible.com/t/add-feature-to-cron-module-to-support-state-enable-disable/18661 "2015-07-02T13:58:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [July 2, 2015, 1:58pm UTC](https://forum.ansible.com/t/add-feature-to-cron-module-to-support-state-enable-disable/18661/1 "2015-07-02T13:58:28Z")

</div>

Currently the cron module supports present/absent to add/delete a cron task. I’d like to add support for enable/disable where disable comments out the line and enable uncomments the line. We move cronjobs throughout our datacenters and I like the idea of the crontask being there just commented out if its in the offline datacenter (rather than entirely removed). I think this fits the paradigm of other ansible modules and my pull request for a win\_scheduled\_task module supports this functionality. I’m willing to do the work if there is a consensus.

[https://github.com/ansible/ansible-modules-core/blob/devel/system/cron.py](https://github.com/ansible/ansible-modules-core/blob/devel/system/cron.py)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 2, 2015, 7:42pm UTC](https://forum.ansible.com/t/add-feature-to-cron-module-to-support-state-enable-disable/18661/2 "2015-07-02T19:42:42Z")

</div>

I believe you want this:

[https://github.com/ansible/ansible-modules-core/pull/878](https://github.com/ansible/ansible-modules-core/pull/878)

---

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [July 2, 2015, 7:51pm UTC](https://forum.ansible.com/t/add-feature-to-cron-module-to-support-state-enable-disable/18661/3 "2015-07-02T19:51:40Z")

</div>

Thanks, didn’t think to check existing pull requests. I’ll check it out. Just skimming the code, I don’t see a way to uncomment an existing job.
