class drupal::drush(
- $version = lookup('drupal::drush::version', undef, undef, '8.1.18')
+ $launcher = false,
+ $version = lookup('drupal::drush::version', undef, undef, '8.3.5')
) {
# Drush config folder
file { '/etc/drush':
require => File['/etc/drush'],
}
- # TODO: future
package { 'drush':
ensure => absent,
}
# require => Exec['getcomposer'],
#}
+ $download_url = $launcher ? {
+ true => "https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar",
+ false => "https://github.com/drush-ops/drush/releases/download/${version}/drush.phar",
+ }
+
exec { 'getdrush':
#command => "/usr/bin/wget https://github.com/drush-ops/drush-launcher/releases/download/${version}/drush.phar -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush",
- command => "/usr/bin/wget https://github.com/drush-ops/drush/releases/download/${version}/drush.phar -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush",
+ command => "/usr/bin/wget ${download_url} -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush",
user => 'root',
cwd => '/tmp',
timeout => 0,