Commit 2670406f authored by Reto Gantenbein's avatar Reto Gantenbein

Fix condition for composer.phar, update docs to be more explicit

parent 0c626804
......@@ -85,6 +85,21 @@ roundcube__base_packages: [ 'curl', 'file', 'unzip' ]
# APT packages required to install PHP composer.
roundcube__composer_packages: [ 'composer ']
# ]]]
# .. envvar:: roundcube__composer_phar [[[
#
# If this is set to ``True`` the ``composer.phar`` script will be downloaded
# from the :envvar:`roundcube__composer_phar_url` and used to install the
# missing PHP packages. If this is set to ``False`` the system-wide
# :command:`composer` is used.
# WARNING: Setting this variable to ``True`` has some security implications as
# the download is not cryptographically verified. This is only meant to be a
# work-around for old distribution releases not supporting the downstream
# packaged :command:`composer`.
roundcube__composer_phar: '{{ True
if ansible_distribution_release in [ "jessie", "trusty" ]
else False }}'
# ]]]
# .. envvar:: roundcube__composer_phar_url [[[
#
......@@ -92,9 +107,7 @@ roundcube__composer_packages: [ 'composer ']
# not available in the APT repository on distribution releases which don't
# package PHP composer. If this is set to `False`, :command:`composer` will
# be installed via APT package manager.
roundcube__composer_phar_url: '{{ "https://getcomposer.org/composer.phar"
if ansible_distribution_release in
[ "jessie", "trusty" ] else False }}'
roundcube__composer_phar_url: 'https://getcomposer.org/composer.phar'
# ]]]
# ]]]
......
......@@ -110,24 +110,21 @@
dest: '{{ roundcube__git_checkout }}'
mode: '0640'
become_user: '{{ roundcube__user }}'
when: (roundcube__composer_phar_url is string) and
(roundcube__composer_phar_url | length > 7)
when: roundcube__composer_phar|bool
- name: Install missing PHP packages via composer.phar
command: php composer.phar install
args:
chdir: '{{ roundcube__git_checkout }}'
become_user: '{{ roundcube__user }}'
when: (roundcube__composer_phar_url is string) and
(roundcube__composer_phar_url | length > 7)
when: roundcube__composer_phar|bool
- name: Install missing PHP packages via system-wide composer
composer:
command: install
working_dir: '{{ roundcube__git_checkout }}'
become_user: '{{ roundcube__user }}'
when: not ((roundcube__composer_phar_url is string) and
(roundcube__composer_phar_url | length > 7))
when: not roundcube__composer_phar|bool
- name: Install Javascript packages
command: bin/install-jsdeps.sh
......
......@@ -34,9 +34,7 @@
- '{{ roundcube__base_packages }}'
- '{{ roundcube__packages }}'
- '{{ roundcube__composer_packages
if (not roundcube__composer_phar_url is string) and
(roundcube__composer_phar_url | length > 7)
else [] }}'
if roundcube__composer_phar|bool else [] }}'
- include: deploy_roundcube.yml
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment