Composer更新通过puppet运行了

I'm using composer to manage dependencies. And basically want I want to do is automatically run composer update in puppet config when vagrant up is running.

I'm using puphpet to generate puppet files for vagrant.

I added composer::exec section in this code in the default.pp file:

if $php_values['composer'] == 1 {
  class { 'composer':
    target_dir      => '/usr/local/bin',
    composer_file   => 'composer',
    download_method => 'curl',
    logoutput       => true,
    tmp_path        => '/tmp',
    php_package     => "${php::params::module_prefix}cli",
    curl_package    => 'curl',
    suhosin_enabled => false,
  }

  composer::exec { 'composer-update':
    cmd             => 'update',
    cwd             => '/var/www/myproject'
  }
}

Some times I'm getting this error in output:

Error: Command exceeded timeout
Error: /Stage[main]//Composer::Exec[composer-update]/Exec[composer_update_composer-update]/returns: change from notrun to 0 failed: Command exceeded timeout

And there is no timeout property in puppet composer.

How to solve it?

Take a look at http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-timeout - it is possible to set a timeout for an exec resource. If the puppet composer module does not provide an option to override that, it really should IMO. And if by a chance it is composer itself that's timing out, not puppet exec, you'd wanna try

export COMPOSER_PROCESS_TIMEOUT=600