diff --git a/roles/cron/cron_drupal7/tasks/job.yml b/roles/cron/cron_drupal7/tasks/job.yml index 673125c2..38257220 100644 --- a/roles/cron/cron_drupal7/tasks/job.yml +++ b/roles/cron/cron_drupal7/tasks/job.yml @@ -6,7 +6,7 @@ - name: Define cron job command if deferred (ASG). ansible.builtin.set_fact: _cron_job_command: >- - cd {{ ce_deploy_base_dir }} && {{ ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a "{{ cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %}" + cd {{ ce_deploy_base_dir }} && {{ ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a "{{ _cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %}" when: - drupal.defer is defined - drupal.defer @@ -16,7 +16,7 @@ - name: Add dev null redirection (for non-deferred). ansible.builtin.set_fact: _cron_job_command: >- - {{ cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %} + {{ _cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %} when: - drupal.defer is not defined or not drupal.defer diff --git a/roles/cron/cron_drupal8/tasks/job.yml b/roles/cron/cron_drupal8/tasks/job.yml index 668bef9a..6fe013cc 100644 --- a/roles/cron/cron_drupal8/tasks/job.yml +++ b/roles/cron/cron_drupal8/tasks/job.yml @@ -6,7 +6,7 @@ - name: Define cron job command if deferred (ASG). ansible.builtin.set_fact: _cron_job_command: >- - cd {{ ce_deploy_base_dir }} && {{ ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a "{{ cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %}" + cd {{ ce_deploy_base_dir }} && {{ ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a "{{ _cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %}" when: - drupal.defer is defined - drupal.defer @@ -16,7 +16,7 @@ - name: Add dev null redirection (for non-deferred). ansible.builtin.set_fact: _cron_job_command: >- - {{ cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %} + {{ _cron_job_command }} > /dev/null 2>&1{% if entry.cron_error_mailto is defined %} || (echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}){% endif %} when: - drupal.defer is not defined or not drupal.defer