php-composer.yml
- name: check composer
stat: path=/usr/local/bin/composer
register: composer_bin
tags: composer
- block:
- name: download composer
get_url:
url: https://getcomposer.org/installer
dest: /tmp/installer
- name: install composer
shell: cat /tmp/installer | php -- --install-dir=/usr/local/bin
- name: rename composer.phar to composer
shell: mv /usr/local/bin/composer.phar /usr/local/bin/composer
- name: make composer executable
file:
path: /usr/local/bin/composer
mode: a+x
state: file
when: not composer_bin.stat.exists
tags: composer