diff --git a/tasks/main.yml b/tasks/main.yml index 772fc9c..c6435b8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -79,17 +79,23 @@ mode: 0770 become: "{{ deploydrupal_files_become }}" -- name: clear drush cache. - shell: "{{ deploydrupal_drush_path }} cache-clear drush" - args: - chdir: "{{ deploydrupal_core_path }}/sites/{{ deploydrupal_site_name }}" - - name: clear caches. shell: "{{ deploydrupal_drush_path }} cache-rebuild" args: chdir: "{{ deploydrupal_core_path }}/sites/{{ deploydrupal_site_name }}" when: - not deploydrupal_site_install + - deploydrupal_drush_cache_rebuild + +# Drush ^9 uses the Drupal service container. We intentionally clear the Drupal +# cache before the Drush cache to avoid fatal errors due to stale cache in the +# service container. +- name: clear drush cache. + shell: "{{ deploydrupal_drush_path }} cache-clear drush" + args: + chdir: "{{ deploydrupal_core_path }}/sites/{{ deploydrupal_site_name }}" + when: + - deploydrupal_drush_cache_rebuild # site-install. - name: install site.