Skip to content

Commit 0c38ce9

Browse files
committed
Merge pull request geerlingguy#16 from alsar/composer-version
Added variable to specify installed composer version
2 parents a1035fd + fb64d93 commit 0c38ce9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Set this to `true` to update Composer to the latest release every time the playb
2727

2828
The `COMPOSER_HOME` path and directory ownership; this is the directory where global packages will be installed.
2929

30+
composer_version: ''
31+
32+
You can install a specific release of Composer, e.g. `composer_version: '1.0.0-alpha11'`. If left empty the latest development version will be installed. Note that `composer_keep_updated` will override this variable, as it will always install the latest development version.
33+
3034
composer_global_packages: {}
3135

3236
A list of packages to install globally (using `composer global require`). If you want to install any packages globally, add a list item with a dictionary with the `name` of the package and a `release`, e.g. `- { name: phpunit/phpunit, release: "4.7.*" }`. The 'release' is optional, and defaults to `@stable`.

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
composer_path: /usr/local/bin/composer
33
composer_keep_updated: false
4+
composer_version: ''
45

56
# The directory where global packages will be installed.
67
composer_home_path: '~/.composer'

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
- name: Run Composer installer.
1919
command: >
20-
{{ php_executable }} composer-installer.php
20+
{{ php_executable }} composer-installer.php {% if composer_version != '' %} --version={{ composer_version }}{% endif %}
2121
chdir=/tmp
2222
when: not composer_bin.stat.exists
2323

0 commit comments

Comments
 (0)