Newer
Older
- name: "PHP | Apt Repository"
apt_repository:
repo='{{ item }}'
state='present'

jurgenhaas
committed
mode='644'
- name: "PHP | Install required packages."
apt:
pkg={{ item }}
state=installed
- name: "PHP | Hold em all"
shell: dpkg --get-selections | grep ^php | sed s/install/hold/g | sudo dpkg --set-selections
when: php_hold_version
- name: "PHP | Install PECL packages"
shell: 'pecl install --soft imagick-3.3.0'
when: php_version_main|default('7') != '7'
when: php_version_main|default('7') == '7'
- name: "PHP | Ensure Apache config directory"
file:
dest=/etc/{{ php_base_dir }}/apache2
state=directory
owner=root
group=root

jurgenhaas
committed
mode='755'
- name: "PHP | Configuration file, php.ini"
template:
src=etc-php5-apache2-php.ini
dest=/etc/{{ php_base_dir }}/apache2/php.ini

jurgenhaas
committed
mode='644'
- include_tasks: php53.yml
tags: 'always'
- name: "PHP | Configuration file, fcgid.conf"
template:
src=fcgid.conf
dest=/etc/apache2/mods-available/fcgid.conf
owner=root
group=root

jurgenhaas
committed
mode='644'
- name: "PHP | Configuration files"
src=etc-php5-conf-d-{{ item }}.ini
dest=/etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini

jurgenhaas
committed
mode='644'
with_items:
- 'opcache'
dest=/etc/{{ php_base_dir }}/apache2/extra
state=directory
owner=root
group=root
when: php_browscap
- name: "PHP | browscap.ini"
copy:
src=browscap.ini
dest=/etc/{{ php_base_dir }}/apache2/extra/browscap.ini
- name: "PHP | Create htdocs directory for apc status"
file:
dest=/var/www/apc
state=directory
owner=www-data
group=www-data
- name: "PHP | Copy APC status php script"
copy:
src=apc.php
dest=/var/www/apc
owner=www-data
group=www-data
- include_tasks: oci-{{ php_version|default('5.5') }}.yml
when: repository is defined and php_needs_oci8
tags: 'always'

jurgenhaas
committed
- name: "PHP | Ensure ImageMagick config directory"
file:
dest={{ php_imagick_config_dir }}

jurgenhaas
committed
state=directory
owner=root
group=root

jurgenhaas
committed
mode='755'

jurgenhaas
committed
- name: "PHP | ImageMagick Policy File"
template:
src=etc-imagemagick-policy.xml
dest={{ php_imagick_config_dir }}/policy.xml

jurgenhaas
committed
owner=root
group=root

jurgenhaas
committed
mode='644'
- block:
- name: "PHP | Apache FPM Socket Configuration"
template:
src='etc-apache2-conf-available-php-fpm'
dest='/etc/apache2/{{ apache_conf_dir }}/php{{ php_version_main }}-fpm.conf'
owner='root'
group='root'
mode='644'
notify:
- "Apache | Restart Apache"
- name: "PHP | Enable Apache PHP FPM Configuration"
command: a2enconf php{{ php_version_main }}-fpm creates=/etc/apache2/conf-enabled/php{{ php_version_main }}-fpm{{ apache_conf_ext }}
notify:
- "Apache | Restart Apache"
when: php_fpm_socket
- name: "PHP | FPM Default Pool Configuration"
template:
src=php_pool.conf
dest=/etc/{{ php_base_dir }}/fpm/pool.d/www.conf
owner=root
group=root
mode='644'
when: (php_version_main|default('7') == '7') and (jailkit is not defined or not jailkit) and (php_fpm)
- block:
- set_fact:
phpLogRotatePrefix='7.0'
phpLibPrefix=''
when: php_version_main|default('7') == '7'
- set_fact:
phpLogRotatePrefix='5'
phpLibPrefix='5'
when: php_version_main|default('7') != '7'
- name: "Install logrotate script"
template:
src=etc-logrotate-php
dest=/etc/logrotate.d/php{{ phpLogRotatePrefix }}-fpm
owner=root
group=root

jurgenhaas
committed
mode='644'