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

Commit 3f23647

Browse files
committed
Updating-cron-path-fixing-mailto
1 parent ad3165c commit 3f23647

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

roles/cron/cron_drupal7/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ drupal:
1212
# month:
1313
job: cron
1414
# disabled: true
15-
mailto: "{{ drupal.cron_mailto | default('') }}"
15+
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
1616
cron_mailto: ""
1717
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
1818
defer: false

roles/cron/cron_drupal7/tasks/job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Define cron job command.
33
ansible.builtin.set_fact:
4-
_cron_job_command: "cd {{ deploy_path }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}"
4+
_cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} > /dev/null 2>&1"
55

66
- name: Define cron job command if deferred (ASG).
77
ansible.builtin.set_fact:
@@ -31,5 +31,5 @@
3131
job: "{{ _cron_job_command }}"
3232
state: present
3333
disabled: "{{ entry.disabled | default(omit) }}"
34-
mailto: "{{ entry.mailto if entry.mailto is defined else omit }}"
34+
mailto: "{{ entry.mailto | default(omit) }}"
3535
delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"

roles/cron/cron_drupal8/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ drupal:
1212
# month:
1313
job: cron
1414
# disabled: true
15-
mailto: "{{ drupal.cron_mailto | default('') }}"
15+
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
1616
cron_mailto: ""
1717
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
1818
defer: false

roles/cron/cron_drupal8/tasks/job.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
---
22
- name: Define cron job command.
33
ansible.builtin.set_fact:
4-
_cron_job_command: "cd {{ deploy_path }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}"
4+
_cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} > /dev/null 2>&1"
55
when: deploy_operation == "deploy"
66

7-
- name: Revert cron job command.
8-
ansible.builtin.set_fact:
9-
_cron_job_command: "cd {{ previous_deploy_path }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}"
10-
when: deploy_operation == "revert"
11-
127
- name: Define cron job command if deferred (ASG).
138
ansible.builtin.set_fact:
149
_cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a \"{{ _cron_job_command }}\""
@@ -37,5 +32,5 @@
3732
job: "{{ _cron_job_command }}"
3833
state: present
3934
disabled: "{{ entry.disabled | default(omit) }}"
40-
mailto: "{{ entry.mailto if entry.mailto is defined else omit }}"
35+
mailto: "{{ entry.mailto | default(omit) }}"
4136
delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"

0 commit comments

Comments
 (0)