diff --git a/roles/cron/cron_drupal7/tasks/job.yml b/roles/cron/cron_drupal7/tasks/job.yml index 5db27375..289b4e87 100644 --- a/roles/cron/cron_drupal7/tasks/job.yml +++ b/roles/cron/cron_drupal7/tasks/job.yml @@ -1,7 +1,7 @@ --- - name: Define cron job command. ansible.builtin.set_fact: - _cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} > /dev/null 2>&1" + _cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} >/dev/null" - name: Define cron job command if deferred (ASG). ansible.builtin.set_fact: @@ -36,8 +36,10 @@ weekday: "{{ entry.weekday | default(omit) }}" month: "{{ entry.month | default(omit) }}" job: > - {% if entry.mailto is defined and entry.mailto | length > 0 %}MAILTO={{ entry.mailto }} - {% endif %}{{ _cron_job_command }} + {% if entry.mailto is defined and entry.mailto | length > 0 %} + MAILTO={{ entry.mailto }} + {% endif %} + { _cron_job_command }} state: present disabled: "{{ entry.disabled | default(omit) }}" delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}" diff --git a/roles/cron/cron_drupal8/tasks/job.yml b/roles/cron/cron_drupal8/tasks/job.yml index 2bd74273..b138b71b 100644 --- a/roles/cron/cron_drupal8/tasks/job.yml +++ b/roles/cron/cron_drupal8/tasks/job.yml @@ -1,7 +1,7 @@ --- - name: Define cron job command. ansible.builtin.set_fact: - _cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} > /dev/null 2>&1" + _cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} >/dev/null" when: deploy_operation == "deploy" - name: Define cron job command if deferred (ASG). @@ -37,8 +37,10 @@ weekday: "{{ entry.weekday | default(omit) }}" month: "{{ entry.month | default(omit) }}" job: > - {% if entry.mailto is defined and entry.mailto | length > 0 %}MAILTO={{ entry.mailto }} - {% endif %}{{ _cron_job_command }} + {% if entry.mailto is defined and entry.mailto | length > 0 %} + MAILTO={{ entry.mailto }} + {% endif %} + { _cron_job_command }} state: present disabled: "{{ entry.disabled | default(omit) }}" delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"