Skip to content
Snippets Groups Projects
Commit b0be500e authored by Simon's avatar Simon
Browse files

Merge pull request #15 from kosssi/global_require

Global require
parents c82bf858 33d7bc23
Branches
Tags v1.2.0
No related merge requests found
...@@ -25,10 +25,10 @@ You can specify where is php with `env_proxy` variable. For example : ...@@ -25,10 +25,10 @@ You can specify where is php with `env_proxy` variable. For example :
You can also setup a global composer directory and make the bin directory available in the `$PATH` automatically by: 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_home_owner: kosssi
composer_home_group: kosssi
composer_path_env: true composer_path_env: true
composer_home_path: /opt/composer
composer_home_owner: root
composer_home_group: root
composer_global_packages: composer_global_packages:
phpunit/phpunit: "@stable" phpunit/phpunit: "@stable"
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
composer_path: /usr/local/bin/composer composer_path: /usr/local/bin/composer
composer_update: true composer_update: true
composer_update_day: 20 composer_update_day: 20
composer_home_path: ~ composer_path_env: False
#composer_home_path: /opt/composer
composer_home_owner: root composer_home_owner: root
composer_home_group: root composer_home_group: root
composer_path_env: False
composer_global_packages: {} composer_global_packages: {}
proxy_env: {} proxy_env: {}
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
- name: Create composer home path - name: Create composer home path
file: path={{ composer_home_path }} state=directory owner={{ composer_home_owner }} group={{ composer_home_group }} file: path={{ composer_home_path }} state=directory owner={{ composer_home_owner }} group={{ composer_home_group }}
when: composer_home_path when: composer_home_path is defined
- name: Configure composer home path - name: Configure composer home path
copy: dest=/etc/profile.d/composer-home.sh mode=0755 copy: dest=/etc/profile.d/composer-home.sh mode=0755
content="export COMPOSER_HOME={{ composer_home_path}}\n" content="export COMPOSER_HOME={{ composer_home_path}}\n"
when: composer_home_path when: composer_home_path is defined
- name: Configure composer path environment - name: Configure composer path environment
copy: dest=/etc/profile.d/composer-path.sh mode=0755 copy: dest=/etc/profile.d/composer-path.sh mode=0755
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
when: composer_path_env when: composer_path_env
- name: Global require packages - name: Global require packages
shell: composer global require {{ item.key }}:{{ item.value }} --no-progress shell: COMPOSER_HOME={{ composer_home_path|default('~/.composer') }}
composer global require {{ item.key }}:{{ item.value }} --no-progress
creates={{ composer_home_path|default('~/.composer') }}/vendor/{{ item.key }} creates={{ composer_home_path|default('~/.composer') }}/vendor/{{ item.key }}
with_dict: composer_global_packages with_dict: composer_global_packages
when: composer_global_packages|length > 0 when: composer_global_packages|length > 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment