aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/drush.pp35
1 files changed, 24 insertions, 11 deletions
diff --git a/manifests/drush.pp b/manifests/drush.pp
index f7ef791..96678fc 100644
--- a/manifests/drush.pp
+++ b/manifests/drush.pp
@@ -1,8 +1,7 @@
class drupal::drush(
- $launcher = false,
- $version = lookup('drupal::drush::version', undef, undef, '8.3.5')
+ $legacy_version = lookup('drupal::drush::legacy_version', undef, undef, '8.3.5')
) {
- # Drush config folder
+ # Drush legacy config folder
file { '/etc/drush':
ensure => directory,
owner => root,
@@ -10,7 +9,7 @@ class drupal::drush(
mode => '0644',
}
- # Drush default configuration
+ # Drush legacy default configuration
file { '/etc/drush/drushrc.php':
ensure => present,
owner => root,
@@ -21,7 +20,7 @@ class drupal::drush(
}
package { 'drush':
- ensure => absent,
+ ensure => absent,
}
#vcsrepo { "/usr/local/share/drush":
@@ -48,17 +47,31 @@ class drupal::drush(
# 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",
+ # Drush wrapper
+ file { '/usr/local/bin/drush':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => '0755',
+ source => 'puppet:///modules/drupal/drush',
+ }
+
+ # Drush Legacy
+ exec { 'getdrush_legacy':
+ command => "/usr/bin/wget https://github.com/drush-ops/drush/releases/download/${version}/drush.phar -O /usr/local/bin/drush-legacy && chmod +x /usr/local/bin/drush-legacy",
+ user => 'root',
+ cwd => '/tmp',
+ timeout => 0,
+ creates => '/usr/local/bin/drush-legacy',
}
- exec { 'getdrush':
+ # Drush Launcher
+ exec { 'getdrush_launcher':
#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 ${download_url} -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush",
+ command => "/usr/bin/wget https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar -O /usr/local/bin/drush-launcher && chmod +x /usr/local/bin/drush-launcher",
user => 'root',
cwd => '/tmp',
timeout => 0,
- creates => '/usr/local/bin/drush',
+ creates => '/usr/local/bin/drush-launcher',
}
}