|
|
|
|
|
|
|
|
{% from "php/map.jinja" import php with context %} |
|
|
{% from "php/map.jinja" import php with context %} |
|
|
{% set install_file = php.local_bin + '/' + php.composer_bin %} |
|
|
{% set install_file = php.local_bin + '/' + php.composer_bin %} |
|
|
|
|
|
|
|
|
|
|
|
{% if not salt['config.get']('sudo_user') %} |
|
|
|
|
|
{% set salt_user = salt['config.get']('user', 'root') %} |
|
|
|
|
|
{% else %} |
|
|
|
|
|
{% set salt_user = salt['config.get']('sudo_user', 'root') %} |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} |
|
|
|
|
|
|
|
|
include: |
|
|
include: |
|
|
- php |
|
|
- php |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd.run: |
|
|
cmd.run: |
|
|
- name: php {{ php.temp_dir }}/installer --filename={{ php.composer_bin }} --install-dir={{ php.local_bin }} |
|
|
- name: php {{ php.temp_dir }}/installer --filename={{ php.composer_bin }} --install-dir={{ php.local_bin }} |
|
|
- unless: test -f {{ install_file }} |
|
|
- unless: test -f {{ install_file }} |
|
|
|
|
|
- env: |
|
|
|
|
|
- HOME: {{ salt_user_home }} |
|
|
- require: |
|
|
- require: |
|
|
- file: get-composer |
|
|
- file: get-composer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: "{{ install_file }} selfupdate" |
|
|
- name: "{{ install_file }} selfupdate" |
|
|
- unless: test $(grep --text COMPOSER_DEV_WARNING_TIME {{ install_file }} | egrep '^\s*define' | sed -e 's,[^[:digit:]],,g') \> $(php -r 'echo time();') |
|
|
- unless: test $(grep --text COMPOSER_DEV_WARNING_TIME {{ install_file }} | egrep '^\s*define' | sed -e 's,[^[:digit:]],,g') \> $(php -r 'echo time();') |
|
|
- cwd: {{ php.local_bin }} |
|
|
- cwd: {{ php.local_bin }} |
|
|
|
|
|
- env: |
|
|
|
|
|
- HOME: {{ salt_user_home }} |
|
|
- require: |
|
|
- require: |
|
|
- cmd: install-composer |
|
|
- cmd: install-composer |