2014-03-01 03:39:35 +01:00
|
|
|
---
|
2014-11-11 18:34:06 +01:00
|
|
|
# Variable setup.
|
2014-04-23 18:26:37 +02:00
|
|
|
- name: Include OS-specific variables.
|
|
|
|
include_vars: "{{ ansible_os_family }}.yml"
|
|
|
|
|
2014-06-07 20:01:14 +02:00
|
|
|
- name: Define php_packages.
|
2014-09-21 06:15:45 +02:00
|
|
|
set_fact:
|
|
|
|
php_packages: "{{ __php_packages | list }}"
|
2014-06-07 20:01:14 +02:00
|
|
|
when: php_packages is not defined
|
|
|
|
|
2014-11-10 21:38:41 +01:00
|
|
|
- name: Define php_webserver_daemon.
|
|
|
|
set_fact:
|
2014-11-11 17:50:44 +01:00
|
|
|
php_webserver_daemon: "{{ __php_webserver_daemon }}"
|
2014-11-10 21:38:41 +01:00
|
|
|
when: php_webserver_daemon is not defined
|
|
|
|
|
2015-02-26 21:17:51 +01:00
|
|
|
- name: Define php_conf_path.
|
|
|
|
set_fact:
|
|
|
|
php_conf_path: "{{ __php_conf_path }}"
|
|
|
|
when: php_conf_path is not defined
|
|
|
|
|
2015-04-14 19:58:38 +02:00
|
|
|
- name: Define php_extension_conf_path.
|
|
|
|
set_fact:
|
|
|
|
php_extension_conf_path: "{{ __php_extension_conf_path }}"
|
|
|
|
when: php_extension_conf_path is not defined
|
|
|
|
|
2015-08-20 08:34:29 +02:00
|
|
|
- name: Define php_apc_conf_filename.
|
|
|
|
set_fact:
|
|
|
|
php_apc_conf_filename: "{{ __php_apc_conf_filename }}"
|
|
|
|
when: php_apc_conf_filename is not defined
|
|
|
|
|
|
|
|
- name: Define php_opcache_conf_filename.
|
|
|
|
set_fact:
|
|
|
|
php_opcache_conf_filename: "{{ __php_opcache_conf_filename }}"
|
|
|
|
when: php_opcache_conf_filename is not defined
|
|
|
|
|
2014-11-11 18:34:06 +01:00
|
|
|
# Setup/install tasks.
|
|
|
|
- include: setup-RedHat.yml
|
2015-06-01 03:51:50 +02:00
|
|
|
when: (php_install_from_source == false) and (ansible_os_family == 'RedHat')
|
2014-04-23 18:26:37 +02:00
|
|
|
|
2014-11-11 18:34:06 +01:00
|
|
|
- include: setup-Debian.yml
|
2015-06-01 03:51:50 +02:00
|
|
|
when: (php_install_from_source == false) and (ansible_os_family == 'Debian')
|
|
|
|
|
|
|
|
# Install PHP from source when php_install_from_source is true.
|
|
|
|
- include: install-from-source.yml
|
|
|
|
when: php_install_from_source == true
|
2014-03-01 03:39:35 +01:00
|
|
|
|
2015-04-30 22:54:15 +02:00
|
|
|
- name: Check the installed version of PHP.
|
2015-06-27 19:00:10 +02:00
|
|
|
shell: '{{ php_executable }} -r "echo PHP_VERSION;"'
|
2015-04-30 22:54:15 +02:00
|
|
|
register: php_version
|
|
|
|
changed_when: false
|
2015-05-26 17:32:11 +02:00
|
|
|
always_run: yes
|
2015-04-30 22:54:15 +02:00
|
|
|
|
|
|
|
- name: Disable opcache if PHP version is < 5.5.
|
|
|
|
set_fact:
|
|
|
|
php_opcache_enable: 0
|
|
|
|
when: "php_version.stdout.split('.')[0] == '5' and php_version.stdout.split('.')[1] < '5'"
|
|
|
|
|
2014-11-11 18:34:06 +01:00
|
|
|
# Configure PHP.
|
|
|
|
- include: configure.yml
|