77 lines
2.2 KiB
YAML
77 lines
2.2 KiB
YAML
---
|
|
- name: Add PHP PPA repository
|
|
become: true
|
|
apt_repository: repo=ppa:ondrej/php
|
|
register: installed_php_ppa
|
|
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
|
|
|
|
# - name: Add Phalcon PPA repository
|
|
# become: true
|
|
# register: installed_phalcon_ppa
|
|
# shell: curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
|
|
# args:
|
|
# creates: /etc/apt/sources.list.d/phalcon_stable.list
|
|
# warn: no
|
|
|
|
- name: Update apt again
|
|
become: true
|
|
apt: update_cache=yes
|
|
when: installed_php_ppa.changed
|
|
|
|
- name: Install PHP Libraries
|
|
become: true
|
|
apt: package="{{ item }}" state=latest
|
|
with_items:
|
|
- php7.0-fpm
|
|
- php7.0-cli
|
|
- php7.0-gd
|
|
- php7.0-curl
|
|
- php7.0-xml # IceCast XML config
|
|
- php7.0-zip # Composer installs
|
|
- php7.0-mysqlnd # MySQL Native Driver (Doctrine)
|
|
- php7.0-mbstring # Codeception Tests
|
|
- php7.0-intl # Localization
|
|
|
|
- name: List locales
|
|
shell: "cd {{ www_base }}/app/locale/; for i in $(ls -d */); do echo ${i%%/}; done"
|
|
register: locale_list
|
|
|
|
- name: Create Locales
|
|
become: true
|
|
locale_gen: name="{{ item }}" state=present
|
|
with_items: "{{ locale_list.stdout_lines }}"
|
|
|
|
- name: Remove Old PHP Libraries
|
|
become: true
|
|
apt: package="{{ item }}" state=absent
|
|
with_items:
|
|
- php5-common
|
|
- php5-fpm
|
|
- php5-cli
|
|
- php5-phalcon
|
|
- php7.0-phalcon
|
|
|
|
- name: Configure PHP FPM Pool
|
|
template: src=fpmpool.j2 dest=/etc/php/7.0/fpm/pool.d/www.conf force=true
|
|
notify: restart php-fpm
|
|
|
|
- name: Configure php-fpm php.ini
|
|
ini_file:
|
|
dest: /etc/php/7.0/fpm/php.ini
|
|
section: PHP
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
with_items:
|
|
- { option: 'post_max_size', value: "50M" }
|
|
- { option: 'short_open_tag', value: "On" }
|
|
- { option: 'upload_max_filesize', value: "25M" }
|
|
notify: restart php-fpm
|
|
|
|
- name: Configure php-cli php.ini
|
|
ini_file:
|
|
dest: /etc/php/7.0/cli/php.ini
|
|
section: PHP
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
with_items:
|
|
- { option: 'short_open_tag', value: "On" } |