22.16.28. salt.modules.composer

Use composer to install PHP dependencies for a directory

salt.modules.composer.install(dir, composer=None, php=None, runas=None, prefer_source=None, prefer_dist=None, no_scripts=None, no_plugins=None, optimize=None, no_dev=None, quiet=False, composer_home='/root')

Install composer dependencies for a directory.

If composer has not been installed globally making it available in the system PATH & making it executable, the composer and php parameters will need to be set to the location of the executables.

dir
Directory location of the composer.json file.
composer
Location of the composer.phar file. If not set composer will just execute "composer" as if it is installed globally. (i.e. /path/to/composer.phar)
php
Location of the php executable to use with composer. (i.e. /usr/bin/php)
runas
Which system user to run composer as.
prefer_source
--prefer-source option of composer.
prefer_dist
--prefer-dist option of composer.
no_scripts
--no-scripts option of composer.
no_plugins
--no-plugins option of composer.
optimize
--optimize-autoloader option of composer. Recommended for production.
no_dev
--no-dev option for composer. Recommended for production.
quiet
--quiet option for composer. Whether or not to return output from composer.
composer_home
$COMPOSER_HOME environment variable

CLI Example:

salt '*' composer.install /var/www/application

salt '*' composer.install /var/www/application             no_dev=True optimize=True

Docs for previous releases are available on salt.rtfd.org.

Latest Salt release: 2014.7.2

Previous topic

22.16.27. salt.modules.cmdmod

Next topic

22.16.29. salt.modules.config

SaltStack News

Upcoming SaltStack events, webinars and local meet ups and user groups.