I'm using Ansible to create a cron.d file using the cron_file parameter.
But how can I add a MAILTO to the file?
It seems the env=true is only for crontab, not cron.d files. Am I wrong?
Since Ansible 2.0 you have the cronvar
command:
# modify /etc/cron.d/sweep_for_rebel_code
- cronvar:
name: MAILTO
value: [email protected]
cron_file: sweep_for_rebel_code
See the official documentation at https://docs.ansible.com/ansible/latest/modules/cronvar_module.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With