install php composer - from http://getcomposer.org/ with puppet-composer module
git submodule add git://github.com/dazz/puppet-composer.git modules/composer
This requires additional modues in your project:
git submodule add git://github.com/puppetlabs/puppetlabs-apt.git modules/apt
git submodule add git://github.com/puppetlabs/puppetlabs-stdlib.git modules/stdlib
git submodule add git://github.com/camptocamp/puppet-augeas.git modules/augeas
Used for running apt-get update
at least once before any package is installed.
puppetlabs-apt has the puppetlabs-stdlib as dependency.
Augeas is a command line tool to manipulate configuration from the shell. see for more augeas.net Composer needs some php-ini values set. The modifications are handled by augeas.
To run composer the package php5-cli needs to be installed.
In your manifest.pp:
## top block to call apt-get update at least once ##
include apt::update
Exec { path => ['/usr/local/bin', '/opt/local/bin', '/usr/bin', '/usr/sbin', '/bin', '/sbin'], logoutput => true }
Exec["apt_update"] -> Package <| |>
## end top block ##
class {"composer":
target_dir => '/usr/local/bin',
composer_file => 'composer',
download_method => 'curl', # download methods are curl or wget
logoutput => false
}
The final file is just called composer
. It is placed into the target_dir
you specified in your manifest.
If you chose a path that is in the search path for executable files composer
can be run from anywhere (see PATH
).
- add php5-cli install path as parameter
- install php5-cli package
- modify php5-cli ini for running composer
- download composer with curl or wget method
- copy composer.phar to search path for executable files
- run composer self-update (runs every time)
I developed this module for installing the Symfony2 framework vendors. It is used in the try-symfony2 (still in beta, see develop branch) project .If you want to add to this puppet module please fork the develop branch (as I am working with git-flow
) and send me a pull request.