community.general.composer – Dependency Manager for PHP¶
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:
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.
The below requirements are needed on the host that executes this module.
composer installed in bin path (recommended /usr/local/bin)
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.
- 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