Fixes #17: Use proper configuration paths in Debian/Ubuntu.

This commit is contained in:
Jeff Geerling 2015-02-26 14:17:51 -06:00
parent ee9a827049
commit 8259d152a6
6 changed files with 26 additions and 9 deletions

View File

@ -58,7 +58,7 @@ Whether to enable APC. Other APC variables will be ineffective if this is set to
php_apc_enabled_in_ini: false
When installing APC, depending on the system and whether running PHP as a webserver module or standalone via `php-fpm`, you might need the line `extension=apc.so` in `apc.ini`. If you need that line added, set this variable to true.
When installing APC, depending on the system and whether running PHP as a webserver module or standalone via `php-fpm`, you might need the line `extension=apc.so` in `apc.ini`. If you need that line added (e.g. you're running `php-fpm`), set this variable to true.
php_apc_cache_by_default: "1"
php_apc_shm_size: "96M"

View File

@ -3,6 +3,7 @@
service:
name: "{{ php_webserver_daemon }}"
state: restarted
notify: restart php-fpm
when: php_enable_webserver
- name: restart php-fpm

View File

@ -23,6 +23,7 @@
dest: "{{ php_extension_conf_path }}/{{ php_apc_conf_filename }}"
owner: root
group: root
force: yes
mode: 0644
when: php_enable_apc
notify: restart webserver

View File

@ -13,6 +13,16 @@
php_webserver_daemon: "{{ __php_webserver_daemon }}"
when: php_webserver_daemon is not defined
- name: Define php_conf_path.
set_fact:
php_conf_path: "{{ __php_conf_path }}"
when: php_conf_path is not defined
- name: Define php_extension_conf_path.
set_fact:
php_extension_conf_path: "{{ __php_extension_conf_path }}"
when: php_extension_conf_path is not defined
# Setup/install tasks.
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'

View File

@ -1,8 +1,4 @@
---
php_conf_path: /etc/php5/apache2
php_extension_conf_path: /etc/php5/apache2/conf.d
php_apc_conf_filename: 20-apc.ini
php_fpm_daemon: php5-fpm
__php_packages:
- php5
- libapache2-mod-php5
@ -15,3 +11,10 @@ __php_packages:
- php5-gd
- php-pear
__php_webserver_daemon: "apache2"
# Vendor-specific configuration paths on Debian/Ubuntu make my brain asplode.
__php_conf_path: "{{ '/etc/php5' if php_webserver_daemon and php_webserver_daemon != 'apache2' else '/etc/php5/apache2' }}"
__php_extension_conf_path: "{{ __php_conf_path }}/conf.d"
php_apc_conf_filename: 20-apc.ini
php_fpm_daemon: php5-fpm

View File

@ -1,8 +1,4 @@
---
php_conf_path: /etc
php_extension_conf_path: /etc/php.d
php_apc_conf_filename: apc.ini
php_fpm_daemon: php-fpm
__php_packages:
- ImageMagick
- php
@ -20,3 +16,9 @@ __php_packages:
- php-xml
- php-xmlrpc
__php_webserver_daemon: "httpd"
__php_conf_path: /etc
__php_extension_conf_path: /etc/php.d
php_apc_conf_filename: apc.ini
php_fpm_daemon: php-fpm