class drupal::drush( $version = lookup('drupal::drush::version', undef, undef, '8.1.18') ) { # Drush config folder file { '/etc/drush': ensure => directory, owner => root, group => root, mode => '0644', } # Drush default configuration file { '/etc/drush/drushrc.php': ensure => present, owner => root, group => root, mode => '0644', source => 'puppet:///modules/drupal/drushrc.php', require => File['/etc/drush'], } # TODO: future package { 'drush': ensure => absent, } #vcsrepo { "/usr/local/share/drush": # ensure => present, # provider => git, # source => 'https://github.com/drush-ops/drush', # revision => '401f034c59b031221d900bec7c2ba81d1331c284', # owner => 'root', # group => 'root', #} #file { "/usr/local/bin/drush": # ensure => '/usr/local/share/drush/drush', # owner => root, # group => root, # require => [ Vcsrepo['/usr/local/share/drush'], Exec['getcomposer'] ], #} #exec { 'composer-drush': # command => '/usr/local/bin/composer global require drush/drush:dev-master', # user => 'vagrant', # creates => '/home/vagrant/composer/vendor/bin/drush', # environment => [ 'COMPOSER_HOME="/vagrant"' ], # require => Exec['getcomposer'], #} 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", user => 'root', cwd => '/tmp', timeout => 0, creates => '/usr/local/bin/drush', } }