# Crontab environment variables

**URL:** <https://forum.ansible.com/t/crontab-environment-variables/17722>\
**Category:** Ansible Developer\
**Created:** [March 11, 2015, 6:07pm UTC](https://forum.ansible.com/t/crontab-environment-variables/17722 "2015-03-11T18:07:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doug\_Luce](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Doug\_Luce](https://forum.ansible.com/u/Doug_Luce)\
**Post date:** [March 11, 2015, 6:07pm UTC](https://forum.ansible.com/t/crontab-environment-variables/17722/1 "2015-03-11T18:07:26Z")

</div>

I've submitted [https://github.com/ansible/ansible-modules-core/pull/923](https://github.com/ansible/ansible-modules-core/pull/923) for more complex handling of crontab environment variables. I made it  
a separate module from cron as I wasn't sure of the best way of  
unifying the syntax. I wanted stuff like this:

&nbsp;&nbsp;&nbsp;- cronvar: name="EMAILPROG" value="/usr/sbin/sendmail"  
&nbsp;&nbsp;&nbsp;- cronvar: name="EMAILCMD" insertafter="EMAILPROG" value="$EMAILPROG doug"

I'm not sure how to integrate this with the cron module in a way that  
makes the syntax sensible without breaking changes to that module.

Doug
