community.general.composer – Dependency Manager for PHP¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.composer
.
Synopsis¶
Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
Requirements¶
The below requirements are needed on the host that executes this module.
php
composer installed in bin path (recommended /usr/local/bin)
Parameters¶
Notes¶
Note
Default options that are always appended in each execution are –no-ansi, –no-interaction and –no-progress if available.
We received reports about issues on macOS if composer was installed by Homebrew. Please use the official install method to avoid issues.
Examples¶
- 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
Authors¶
Dimitrios Tydeas Mengidis (@dmtrs)
René Moser (@resmo)