Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 8aff5aa

Browse files
duck-rhmscherer
authored andcommitted
setup cron error email (#14)
1 parent 63ced63 commit 8aff5aa

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ This will deploy the build of https://git.example.org/website.git by
2323
using rsync as rsync_user on www.example.org, copying in /var/www/html.
2424

2525
The script will not sync if build failed, and will not send email (that's on the
26-
TODO list, see end of the file)
26+
TODO list, see end of the file). Nevertheless, failures caught by Cron can be
27+
sent to an email address if specified by `cron_error_email`; if you setup
28+
multiple builders using the same UNIX user, then beware only the latest email
29+
defined will be taken into account.
2730

2831
# Handling multiple repositories
2932

tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
job: "/usr/local/bin/build_deploy.py /srv/builder/{{ name }}.yml"
8282
user: "{{ builder_username }}"
8383

84+
- name: Setup cron email
85+
cronvar:
86+
user: "{{ builder_username }}"
87+
name: MAILTO
88+
value: "{{ cron_error_email }}"
89+
when: cron_error_email is defined
90+
8491
# TODO add ip restriction
8592
- name: Copy the key on the other side
8693
authorized_key:

0 commit comments

Comments
 (0)