mirror of
https://github.com/HanXHX/ansible-php.git
synced 2026-04-19 13:52:09 +07:00
Dirty commit
This commit is contained in:
10
tasks/fpm.yml
Normal file
10
tasks/fpm.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: APT | Install PHP-FPM
|
||||
apt: pkg=php5-fpm state=latest
|
||||
|
||||
- name: LINEINFILE | PHP configuration
|
||||
lineinfile: dest=/etc/php5/fpm/php.ini regexp='^;?{{ item.key }}' line='{{ item.key }} = {{ item.value }}'
|
||||
with_items: php_ini
|
||||
notify: restart php-fpm
|
||||
|
||||
@@ -1,2 +1,25 @@
|
||||
---
|
||||
# tasks file for .
|
||||
|
||||
- name: APT | Install PHP packages
|
||||
apt: pkg={{ item }} state=latest update_cache=yes cache_valid_time=3600
|
||||
with_items:
|
||||
- php_packages
|
||||
- php_extra_packages
|
||||
|
||||
- name: INCLUDE | PHP-FPM
|
||||
include: php-fpm.yml
|
||||
when: php_install_fpm
|
||||
|
||||
- name: SHELL | Get PHP version on apt
|
||||
shell: LANG=C apt-cache policy php5 2>&1 | awk '/Candidate:/ { print $2 }'
|
||||
register: php_apt_version
|
||||
changed_when: false
|
||||
|
||||
- name: APT | Install and configure php-apcu / opcache (PHP 5.5+ only)
|
||||
include: php55min.yml
|
||||
when: php_apt_version.stdout|version_compare('5.5', 'ge', False)
|
||||
|
||||
- name: APT | Install and configure php-apc (PHP 5.4 max only)
|
||||
include: php54max.yml
|
||||
when: php_apt_version.stdout|version_compare('5.5', 'lt', False)
|
||||
|
||||
|
||||
11
tasks/php55min.yml
Normal file
11
tasks/php55min.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- name: APT | Install php-apcu
|
||||
apt: pkg=php5-apcu state=latest
|
||||
|
||||
- name: TEMPLATE | Configure Opcache / APCu
|
||||
template: src=etc/php5/mods-available/{{ item }}.j2 dest=/etc/php5/mods-available/{{ item }}
|
||||
with_items:
|
||||
- apcu
|
||||
- opcache
|
||||
notify: restart php-fpm
|
||||
Reference in New Issue
Block a user