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

Commit ddd6888

Browse files
committed
Merge branch 'Updating-cron-path-fixing-mailto' into Updating-cron-path-fixing-mailto-PR-devel
2 parents c5fc269 + 381aecc commit ddd6888

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

roles/cron/cron_drupal7/tasks/job.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@
2020
- drupal.defer is defined
2121
- drupal.defer
2222

23+
- name: Set global MAILTO for cron jobs (if defined)
24+
community.general.cronvar:
25+
name: MAILTO
26+
value: "{{ drupal.cron_mailto | default(omit) }}"
27+
state: present
28+
when: drupal.cron_mailto is defined and drupal.cron_mailto != ""
29+
30+
- name: Setup specific cron job with custom MAILTO
31+
community.general.cronvar:
32+
name: MAILTO
33+
value: "{{ entry.mailto | default(drupal.cron_mailto | default(omit)) }}"
34+
state: present
35+
when: entry.mailto is defined
36+
2337
- name: Setup Drupal cron tasks on app server.
2438
ansible.builtin.cron:
2539
name: "{{ project_name }}_{{ site.folder }}_{{ build_type }}_{{ entry.job }}"
@@ -31,5 +45,4 @@
3145
job: "{{ _cron_job_command }}"
3246
state: present
3347
disabled: "{{ entry.disabled | default(omit) }}"
34-
mailto: "{{ entry.mailto | default(omit) }}"
3548
delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"

roles/cron/cron_drupal8/tasks/job.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121
- drupal.defer is defined
2222
- drupal.defer
2323

24+
- name: Set global MAILTO for cron jobs (if defined)
25+
community.general.cronvar:
26+
name: MAILTO
27+
value: "{{ drupal.cron_mailto | default(omit) }}"
28+
state: present
29+
when: drupal.cron_mailto is defined and drupal.cron_mailto != ""
30+
31+
- name: Setup specific cron job with custom MAILTO
32+
community.general.cronvar:
33+
name: MAILTO
34+
value: "{{ entry.mailto | default(drupal.cron_mailto | default(omit)) }}"
35+
state: present
36+
when: entry.mailto is defined
37+
2438
- name: Setup Drupal cron tasks on app server.
2539
ansible.builtin.cron:
2640
name: "{{ project_name }}_{{ site.folder }}_{{ build_type }}_{{ entry.job }}"
@@ -32,5 +46,4 @@
3246
job: "{{ _cron_job_command }}"
3347
state: present
3448
disabled: "{{ entry.disabled | default(omit) }}"
35-
mailto: "{{ entry.mailto | default(omit) }}"
3649
delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"

0 commit comments

Comments
 (0)