2015-06-01 03:51:50 +02:00
|
|
|
---
|
|
|
|
- name: Ensure dependencies for building from source are installed (RedHat).
|
|
|
|
yum: "pkg={{ item }} state=installed"
|
|
|
|
with_items:
|
|
|
|
- recode-devel
|
|
|
|
- aspell-devel
|
|
|
|
- libmcrypt-devel
|
|
|
|
- t1lib-devel
|
|
|
|
- libXpm-devel
|
|
|
|
- libpng-devel
|
|
|
|
- libjpeg-turbo-devel
|
|
|
|
- bzip2-devel
|
|
|
|
- openssl-libs
|
|
|
|
- libicu-devel
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
|
|
|
- name: Update apt cache (Debian).
|
|
|
|
apt: update_cache=yes cache_valid_time=86400
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- name: Ensure dependencies for building from source are installed (Debian).
|
|
|
|
apt: "pkg={{ item }} state=installed"
|
|
|
|
with_items:
|
|
|
|
- build-essential
|
|
|
|
- autoconf
|
|
|
|
- automake
|
|
|
|
- libtool
|
|
|
|
- bison
|
|
|
|
- re2c
|
|
|
|
- libxml2-dev
|
|
|
|
- libcurl4-openssl-dev
|
|
|
|
- libbz2-dev
|
|
|
|
- libjpeg-dev
|
2015-06-01 05:05:46 +02:00
|
|
|
- libpng12-dev
|
2015-06-01 03:51:50 +02:00
|
|
|
- libxpm-dev
|
|
|
|
- libfreetype6-dev
|
|
|
|
- libgmp3-dev
|
|
|
|
- libmcrypt-dev
|
|
|
|
- libmysqlclient-dev
|
|
|
|
- libpspell-dev
|
|
|
|
- librecode-dev
|
2015-10-02 20:58:48 +02:00
|
|
|
- libssl-dev
|
2015-06-01 03:51:50 +02:00
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
2015-06-01 04:05:08 +02:00
|
|
|
- name: Check if gmp.h is already in a location accessible to gcc.
|
|
|
|
stat: path=/usr/include/gmp.h
|
|
|
|
register: gmp_file
|
|
|
|
|
2015-06-01 03:51:50 +02:00
|
|
|
- name: Ensure gmp.h is symlinked into a location accessible to gcc.
|
|
|
|
file:
|
2015-10-02 19:49:11 +02:00
|
|
|
src: "{{ php_source_install_gmp_path }}"
|
2015-06-01 03:51:50 +02:00
|
|
|
dest: /usr/include/gmp.h
|
|
|
|
state: link
|
2015-06-01 04:05:08 +02:00
|
|
|
when: gmp_file.stat.exists == false
|
2015-06-01 03:51:50 +02:00
|
|
|
|
2015-06-01 05:22:36 +02:00
|
|
|
- name: Check if PHP is installed.
|
|
|
|
command: which php
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: php_installed
|
|
|
|
|
2015-06-01 03:51:50 +02:00
|
|
|
- name: Clone the PHP repository.
|
|
|
|
git:
|
|
|
|
repo: https://git.php.net/repository/php-src.git
|
|
|
|
dest: "{{ php_source_clone_dir }}"
|
|
|
|
version: "{{ php_source_version }}"
|
|
|
|
accept_hostkey: yes
|
|
|
|
depth: 1
|
2015-06-01 05:22:36 +02:00
|
|
|
when: php_installed|failed
|
2015-06-01 03:51:50 +02:00
|
|
|
|
|
|
|
- name: Ensure PHP installation path exists.
|
|
|
|
file:
|
|
|
|
path: "{{ php_source_install_path }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
when: php_installed|failed
|
|
|
|
|
|
|
|
- name: Build configure script.
|
|
|
|
shell: >
|
2015-07-06 04:07:51 +02:00
|
|
|
./buildconf --force
|
2015-06-01 03:51:50 +02:00
|
|
|
chdir={{ php_source_clone_dir }}
|
|
|
|
when: php_installed|failed
|
|
|
|
|
|
|
|
- name: Run configure script.
|
|
|
|
shell: >
|
|
|
|
{{ php_source_configure_command }}
|
|
|
|
chdir={{ php_source_clone_dir }}
|
|
|
|
when: php_installed|failed
|
|
|
|
|
|
|
|
- name: Make and install PHP.
|
|
|
|
shell: >
|
|
|
|
{{ item }}
|
|
|
|
chdir={{ php_source_clone_dir }}
|
|
|
|
with_items:
|
|
|
|
- "{{ php_source_make_command }}"
|
|
|
|
- make install
|
|
|
|
when: php_installed|failed
|
|
|
|
|
|
|
|
- name: Ensure php executable is symlinked into a standard path.
|
|
|
|
file:
|
|
|
|
src: "{{ php_source_install_path }}/bin/php"
|
|
|
|
dest: /usr/bin/php
|
|
|
|
state: link
|
2015-07-06 05:21:58 +02:00
|
|
|
|
2015-07-06 17:07:58 +02:00
|
|
|
# PHP FPM configuration.
|
2015-07-06 05:21:58 +02:00
|
|
|
- name: Ensure php-fpm executable is symlinked into a standard path.
|
|
|
|
file:
|
|
|
|
src: "{{ php_source_install_path }}/sbin/php-fpm"
|
|
|
|
dest: "/usr/sbin/{{ php_fpm_daemon }}"
|
2015-07-06 17:07:58 +02:00
|
|
|
state: link
|
|
|
|
when: "'--enable-fpm' in php_source_configure_command"
|
|
|
|
|
|
|
|
- name: Ensure php-fpm init script is installed.
|
|
|
|
template:
|
|
|
|
src: fpm-init.j2
|
|
|
|
dest: "/etc/init.d/{{ php_fpm_daemon }}"
|
|
|
|
mode: 0755
|
|
|
|
when: "'--enable-fpm' in php_source_configure_command"
|
|
|
|
notify: restart php-fpm
|
|
|
|
|
2015-07-07 02:46:04 +02:00
|
|
|
- name: Ensure php-fpm config directory exists.
|
|
|
|
file:
|
|
|
|
path: "{{ php_conf_path }}/fpm"
|
|
|
|
state: directory
|
|
|
|
when: "'--enable-fpm' in php_source_configure_command"
|
|
|
|
|
2015-07-06 17:07:58 +02:00
|
|
|
- name: Ensure php-fpm config file is installed.
|
|
|
|
template:
|
|
|
|
src: php-fpm.conf.j2
|
|
|
|
dest: "{{ php_conf_path }}/fpm/php-fpm.conf"
|
|
|
|
mode: 0644
|
2015-07-06 05:21:58 +02:00
|
|
|
when: "'--enable-fpm' in php_source_configure_command"
|
2015-07-06 17:07:58 +02:00
|
|
|
notify: restart php-fpm
|