forked from ISTI-ansible-roles/ansible-roles
library/roles: apache, composer, php-fpm. Various fixes.
This commit is contained in:
parent
86422ed956
commit
a30c96eb88
|
@ -16,10 +16,10 @@ apache_packages:
|
||||||
|
|
||||||
# Only one can be present at the same time. It needs to be listed as the last one
|
# Only one can be present at the same time. It needs to be listed as the last one
|
||||||
apache_worker_modules:
|
apache_worker_modules:
|
||||||
|
- { name: 'mpm_{{ apache_mpm_mode }}', state: 'present' }
|
||||||
# - { name: 'mpm_itm', state: 'absent' }
|
# - { name: 'mpm_itm', state: 'absent' }
|
||||||
- { name: 'mpm_event', state: 'absent' }
|
- { name: 'mpm_event', state: 'absent' }
|
||||||
- { name: 'mpm_prefork', state: 'absent' }
|
- { name: 'mpm_prefork', state: 'absent' }
|
||||||
- { name: 'mpm_{{ apache_mpm_mode }}', state: 'present' }
|
|
||||||
|
|
||||||
apache_default_modules:
|
apache_default_modules:
|
||||||
- headers
|
- headers
|
||||||
|
|
|
@ -6,6 +6,5 @@ composer_get_url: https://getcomposer.org/installer
|
||||||
composer_dest_dir: /usr/local/bin
|
composer_dest_dir: /usr/local/bin
|
||||||
composer_exec_name: composer
|
composer_exec_name: composer
|
||||||
composer_signature_type: SHA384
|
composer_signature_type: SHA384
|
||||||
composer_signature: 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae'
|
|
||||||
composer_setup: composer-setup.php
|
composer_setup: composer-setup.php
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
|
||||||
php -r "copy('{{ composer_get_url }}', '{{ composer_setup }}');"
|
php -r "copy('{{ composer_get_url }}', '{{ composer_setup }}');"
|
||||||
php -r "if (hash_file('{{ composer_signature_type }}', '{{ composer_setup }}') === '{{ composer_signature }}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('{{ composer_setup }}'); } echo PHP_EOL;"
|
ACTUAL_SIGNATURE=$(php -r "echo hash_file('{{ composer_signature_type }}', 'composer-setup.php');")
|
||||||
php {{ composer_setup }} --install-dir={{ composer_dest_dir }} --filename={{ composer_exec_name }}
|
|
||||||
|
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
|
||||||
|
then
|
||||||
|
>&2 echo 'ERROR: Invalid installer signature'
|
||||||
|
rm composer-setup.php
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
php {{ composer_setup }} --install-dir={{ composer_dest_dir }} --filename={{ composer_exec_name }} --quiet
|
||||||
|
RESULT=$?
|
||||||
php -r "unlink('{{ composer_setup }}');"
|
php -r "unlink('{{ composer_setup }}');"
|
||||||
|
|
||||||
chmod 755 {{ composer_dest_dir }}/{{ composer_exec_name }}
|
chmod 755 {{ composer_dest_dir }}/{{ composer_exec_name }}
|
||||||
|
exit $RESULT
|
||||||
exit 0
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ php_fpm_packages:
|
||||||
|
|
||||||
#php_global_settings:
|
#php_global_settings:
|
||||||
# - { option='', value='', state='' }
|
# - { option='', value='', state='' }
|
||||||
|
#php_cli_global_settings:
|
||||||
|
# - { option='', value='', state='' }
|
||||||
|
|
||||||
# Main confign file settings
|
# Main confign file settings
|
||||||
# It can be 'syslog'
|
# It can be 'syslog'
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
- name: Modify the global php cli settings
|
- name: Modify the global php cli settings
|
||||||
ini_file: dest={{ phpfpm_cli_dir }}/php.ini section={{ item.section | default('PHP') }} option={{ item.option }} value={{ item.value }} backup=yes state={{ item.state | default('present') }}
|
ini_file: dest={{ phpfpm_cli_dir }}/php.ini section={{ item.section | default('PHP') }} option={{ item.option }} value={{ item.value }} backup=yes state={{ item.state | default('present') }}
|
||||||
with_items: '{{ php_global_settings | default([]) }}'
|
with_items: '{{ php_cli_global_settings | default([]) }}'
|
||||||
tags: [ 'php', 'php_ini' ]
|
tags: [ 'php', 'php_ini' ]
|
||||||
|
|
||||||
- name: Activate the memcache sessions support and redundancy if needed
|
- name: Activate the memcache sessions support and redundancy if needed
|
||||||
|
|
Loading…
Reference in New Issue