community / community.general / 6.6.8 / module / composer Dependency Manager for PHP Authors: Dimitrios Tydeas Mengidis (@dmtrs), René Moser (@resmo)community.general.composer (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
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.
- 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: true
- name: Install a package globally community.general.composer: command: require global_command: true arguments: my/package
no_dev: default: true description: - Disables installation of require-dev packages (see --no-dev). type: bool command: default: install description: - Composer command like "install", "update" and so on. type: str arguments: default: '' description: - Composer arguments like required package, version and so on. type: str executable: aliases: - php_path description: - Path to PHP Executable on the remote host, if PHP is not in PATH. type: path no_plugins: default: false description: - Disables all plugins (see --no-plugins). type: bool no_scripts: default: false description: - Skips the execution of all scripts defined in composer.json (see --no-scripts). type: bool prefer_dist: default: false description: - Forces installation from package dist even for dev versions (see --prefer-dist). type: bool working_dir: description: - Directory of your project (see --working-dir). This is required when the command is not run globally. - Will be ignored if I(global_command=true). type: path prefer_source: default: false description: - Forces installation from package sources when possible (see --prefer-source). type: bool global_command: default: false description: - Runs the specified command globally. type: bool apcu_autoloader: default: false description: - Uses APCu to cache found/not-found classes type: bool composer_executable: description: - Path to composer executable on the remote host, if composer is not in C(PATH) or a custom composer is needed. type: path version_added: 3.2.0 version_added_collection: community.general optimize_autoloader: default: true description: - 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. type: bool ignore_platform_reqs: default: false description: - Ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill these. type: bool classmap_authoritative: default: false description: - Autoload classes from classmap only. - Implicitly enable optimize_autoloader. - Recommended especially for production, but can take a bit of time to run. type: bool