From fa22ff35e3ec38b3b22e8c78c041dc44cf2d52a3 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Fri, 20 Jul 2018 14:01:21 +0200 Subject: [PATCH] Monkey-patch drush module for puppet 4 The puppet-drush module that the puppet-drupal module depends on has some quirks on puppet 4. First, with the new ordering algorithm, it's not guaranteed that the drush repo and the composer installation will happen in the same order as before. We can fix that without touching the drush module itself by creating resource orderings from the drupal::drush class. Second, on puppet 3 the empty string '' was interpreted as falsey, so you could expect `if '' {}` to evaluate as false. On puppet 4, it's interpreted as truthy, and for the drush module using '' as the default for the git_tag parameter causes the drush $git_ref variable to be set to the empty string which causes the module to stay on the master branch instead of checking out the 6.x branch. There's no semantic difference between the git_branch and git_tag parameter, so we'll just set git_tag to the same as git_branch. Change-Id: I3acbda4edd546b4f145c9991f18ca80bb3e2171e --- manifests/drush.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/drush.pp b/manifests/drush.pp index 4d10432..36251d1 100644 --- a/manifests/drush.pp +++ b/manifests/drush.pp @@ -27,8 +27,12 @@ define drupal::drush ( $drushdsdtar = 'https://github.com/mkissam/drush-dsd/archive/v0.10.tar.gz', ) { + # Fix the resource ordering in the drush::git::drush class + Drush::Git['https://github.com/drush-ops/drush.git'] -> Exec['Install composer'] + class {'::drush::git::drush': git_branch => '6.x', + git_tag => '6.x', } file { '/usr/share/drush/commands/dsd':