Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.composer.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| apcu_autoloader boolean |
| Uses APCu to cache found/not-found classes aliases: apcu-autoloader |
| arguments string | Composer arguments like required package, version and so on. | |
| classmap_authoritative boolean |
| Autoload classes from classmap only. Implicitely enable optimize_autoloader. Recommended especially for production, but can take a bit of time to run. aliases: classmap-authoritative |
| command string | Default: "install" | Composer command like "install", "update" and so on. |
| executable string | Path to PHP Executable on the remote host, if PHP is not in PATH. aliases: php_path | |
| global_command boolean |
| Runs the specified command globally. aliases: global-command |
| ignore_platform_reqs boolean |
| Ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill these. aliases: ignore-platform-reqs |
| no_dev boolean |
| Disables installation of require-dev packages (see --no-dev). aliases: no-dev |
| no_plugins boolean |
| Disables all plugins ( see --no-plugins ). aliases: no-plugins |
| no_scripts boolean |
| Skips the execution of all scripts defined in composer.json (see --no-scripts). aliases: no-scripts |
| optimize_autoloader boolean |
| Optimize autoloader during autoloader dump (see --optimize-autoloader). Convert PSR-0/4 autoloading to classmap to get a faster autoloader. Recommended especially for production, but can take a bit of time to run. aliases: optimize-autoloader |
| prefer_dist boolean |
| Forces installation from package dist even for dev versions (see --prefer-dist). aliases: prefer-dist |
| prefer_source boolean |
| Forces installation from package sources when possible (see --prefer-source). aliases: prefer-source |
| working_dir string | Directory of your project (see --working-dir). This is required when the command is not run globally. Will be ignored if global_command=true.aliases: working-dir |
Note
- name: Download and installs all libs and dependencies outlined in the /path/to/project/composer.lock
community.general.composer:
command: install
working_dir: /path/to/project
- name: Install a new package
community.general.composer:
command: require
arguments: my/package
working_dir: /path/to/project
- name: Clone and install a project with all dependencies
community.general.composer:
command: create-project
arguments: package/package /path/to/project ~1.0
working_dir: /path/to/project
prefer_dist: yes
- name: Install a package globally
community.general.composer:
command: require
global_command: yes
arguments: my/package
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/composer_module.html