Skip to content
Snippets Groups Projects
Commit f0e83711 authored by Yosh de Vos's avatar Yosh de Vos Committed by Yosh de Vos
Browse files

Added global require feature

parent 5c5692a2
Branches
Tags
No related merge requests found
......@@ -6,7 +6,7 @@ python:
- 2.7
install:
- pip install ansible==1.4.0
- pip install ansible==1.5.0
script:
- cd tests
......
......@@ -18,11 +18,18 @@ Installs Composer, the PHP Dependency Manager.
The path where composer will be installed and available to your system. Should be in your user's `$PATH` so you can run
commands simply with `composer` instead of the full path.
You can specify where is php with `env_proxy` variable. For exemple :
You can specify where is php with `env_proxy` variable. For example :
env_proxy:
PATH: "/usr/local/zend/bin"
You can also setup a global composer directory and make the bin directory available in the `$PATH` automatically by:
composer_home_path: /var/data/composer
composer_path_env: true
composer_global_packages:
phpunit/phpunit: "@stable"
## Example Playbook
roles:
......
......@@ -3,4 +3,9 @@
composer_path: /usr/local/bin/composer
composer_update: true
composer_update_day: 20
composer_home_path: ~
composer_home_owner: root
composer_home_group: root
composer_path_env: False
composer_global_packages: {}
proxy_env: {}
......@@ -4,7 +4,7 @@ galaxy_info:
author: kosssi
description: Install and Update Composer PHP Dependency Manager
license: license MIT
min_ansible_version: 1.4
min_ansible_version: 1.5
platforms:
- name: Ubuntu
versions:
......
---
- name: Create composer home path
file: path={{ composer_home_path }} state=directory owner={{ composer_home_owner }} group={{ composer_home_group }}
when: composer_home_path
- name: Configure composer home path
copy: dest=/etc/profile.d/composer-home.sh mode=0755
content="export COMPOSER_HOME={{ composer_home_path}}\n"
when: composer_home_path
- name: Configure composer path environment
copy: dest=/etc/profile.d/composer-path.sh mode=0755
content="export PATH=${PATH}:{{ composer_home_path|default('~/.composer') }}/vendor/bin\n"
when: composer_path_env
- name: Global require packages
shell: composer global require {{ item.key }}:{{ item.value }} --no-progress
creates={{ composer_home_path|default('~/.composer') }}/vendor/{{ item.key }}
with_dict: composer_global_packages
when: composer_global_packages|length > 0
......@@ -2,5 +2,6 @@
- include: install.yml
- include: test.yml
- include: configure.yml
- include: update.yml
when: composer_update == true
\ No newline at end of file
when: composer_update == true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment