diff --git a/roles/cli/drush/tasks/main.yml b/roles/cli/drush/tasks/main.yml index e911682a..d80f1a27 100644 --- a/roles/cli/drush/tasks/main.yml +++ b/roles/cli/drush/tasks/main.yml @@ -1,4 +1,8 @@ --- +- name: Set Drush major version integer. + ansible.builtin.set_fact: + _drush_major_version: "{{ drush.version[0] | int }}" + - name: Check if we already have a global Drush. ansible.builtin.stat: path: "{{ drush_bin }}" @@ -34,7 +38,7 @@ - deploy_operation == 'deploy' - not drush.use_vendor - not drush_global.stat.exists or not drush_global_version.stdout == drush.version - - drush.version[0] | int < 9 + - _drush_major_version < 9 - name: Download Drush archive. ansible.builtin.get_url: @@ -46,7 +50,7 @@ - deploy_operation == 'deploy' - not drush.use_vendor - not drush_global.stat.exists or not drush_global_version.stdout == drush.version - - drush.version[0] | int >= 9 + - _drush_major_version >= 9 - name: "Extract drush.tar.gz into {{ drush_bin | dirname }}" ansible.builtin.unarchive: @@ -57,7 +61,7 @@ - deploy_operation == 'deploy' - not drush.use_vendor - not drush_global.stat.exists or not drush_global_version.stdout == drush.version - - drush.version[0] | int >= 9 + - _drush_major_version >= 9 - name: Create .bashrc file if it does not exist ansible.builtin.file: