puppet drush composer安装失败

时间:2015-09-09 12:56:50

标签: vagrant composer-php puppet drush

我正在尝试使用vagrant 1.7.4和puppet 4.2.1配置VM。在我安装drush时,一切看起来都不错。

class tools {

  # package install list
  $packages = [
    "curl",
    "vim",
    "htop",
    "git-core"
  ]

  # install packages
  package { $packages:
    ensure => present,
    require => Exec["apt-get update"]
  }

  exec { 'composer-install':
    command => 'curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer',
    path    => '/usr/bin:/usr/sbin',
    require => Package['curl'],
  }

  exec { 'drush-install':
    command => 'composer global require drush/drush:dev-master',
    environment => ["COMPOSER_HOME=/usr/local/bin/composer"],
    path    => '/usr/bin:/usr/local/bin:~/.composer/',
    require => Exec['composer-install']
  }

}

Composer安装成功但是drush失败。以下是执行的操作日志:

==> default: Debug: Exec[composer-install](provider=posix): Executing 'curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer'
==> default: Debug: Executing: 'curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer'
==> default: Notice: /Stage[main]/Tools/Exec[composer-install]/returns: executed successfully
==> default: Debug: /Stage[main]/Tools/Exec[composer-install]: The container Class[Tools] will propagate my refresh event
==> default: Debug: Exec[drush-install](provider=posix): Executing 'composer global require drush/drush:dev-master'
==> default: Debug: Executing: 'composer global require drush/drush:dev-master'
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns: 
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns: 
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns:                                        
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns:   [ErrorException]                     
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns:   chdir(): Not a directory (errno 20)  
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns:                                        
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns: 
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns: 
==> default: Notice: /Stage[main]/Tools/Exec[drush-install]/returns: global command-name [args1] ... [argsN]
==> default: Debug: Class[Tools]: Resource is being skipped, unscheduling all events
==> default: Error: composer global require drush/drush:dev-master returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Tools/Exec[drush-install]/returns: change from notrun to 0 failed: composer global require drush/drush:dev-master returned 1 instead of one of [0]
==> default: Info: Class[Tools]: Unscheduling all events on Class[Tools]
==> default: Debug: Stage[main]: Resource is being skipped, unscheduling all events
==> default: Info: Stage[main]: Unscheduling all events on Stage[main]
==> default: Debug: Finishing transaction 15011420
==> default: Debug: Storing state
==> default: Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
==> default: Debug: Stored state in 0.01 seconds
==> default: Notice: Applied catalog in 154.95 seconds
==> default: Debug: Applying settings catalog for sections reporting, metrics
==> default: Debug: Finishing transaction 35207340
==> default: Debug: Received report to process from demo.local
==> default: Debug: Evicting cache entry for environment 'local'
==> default: Debug: Caching environment 'local' (ttl = 0 sec)
==> default: Debug: Processing report from demo.local with processor Puppet::Reports::Store
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

稍后编辑:

添加--verbose到composer命令:

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Command/GlobalCommand.php:74
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 chdir() at phar:///usr/local/bin/composer/src/Composer/Command/GlobalCommand.php:74
 Composer\Command\GlobalCommand->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:146
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:82
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
 require() at /usr/local/bin/composer:25

我做错了吗?

0 个答案:

没有答案