From 9bf5faddf04b0a34d1065491b2fa6e09a4d455b7 Mon Sep 17 00:00:00 2001 From: doman18 Date: Fri, 8 Mar 2024 11:58:29 +0100 Subject: [PATCH] fix drush installation task Update required drush version from 11 to 12 (see: https://www.drupal.org/node/3403057) Add check for drush binary file existence and replace "when" conditional for drush installation. This works better with progressive playbook runs (when you run them after each change) in which composer json file already exists. --- drupal/provisioning/playbook.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drupal/provisioning/playbook.yml b/drupal/provisioning/playbook.yml index 0ae20dba..04e4abda 100644 --- a/drupal/provisioning/playbook.yml +++ b/drupal/provisioning/playbook.yml @@ -141,13 +141,18 @@ become_user: www-data when: not drupal_composer_json.stat.exists + - name: Check if Drush already exists. + stat: + path: "{{ drupal_core_path }}/vendor/bin/drush" + register: drush_binary + - name: Add drush to the Drupal site with Composer. composer: command: require - arguments: drush/drush:11.* + arguments: drush/drush:12.* working_dir: "{{ drupal_core_path }}" become_user: www-data - when: not drupal_composer_json.stat.exists + when: not drush_binary.stat.exists - name: Install Drupal. command: >