2016-02-16 17:25:40 +01:00
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
|
|
|
|
vars:
|
|
|
|
php_enable_webserver: false
|
2017-05-15 06:10:58 +02:00
|
|
|
php_enable_php_fpm: true
|
2016-03-04 03:24:47 +01:00
|
|
|
php_memory_limit: "192M"
|
2016-05-12 05:45:27 +02:00
|
|
|
php_enablerepo: "remi,remi-php70"
|
2016-11-07 18:32:45 +01:00
|
|
|
php_install_recommends: no
|
2016-02-16 17:25:40 +01:00
|
|
|
|
|
|
|
pre_tasks:
|
2016-09-18 02:06:40 +02:00
|
|
|
- name: Update apt cache.
|
2016-11-23 16:13:22 +01:00
|
|
|
apt: update_cache=yes cache_valid_time=600
|
2016-09-18 02:06:40 +02:00
|
|
|
when: ansible_os_family == 'Debian'
|
2016-11-23 17:40:54 +01:00
|
|
|
changed_when: false
|
2016-09-18 02:06:40 +02:00
|
|
|
|
2017-05-15 06:10:58 +02:00
|
|
|
# Ubuntu-specific tasks.
|
2016-05-12 05:45:27 +02:00
|
|
|
- name: Add repository for PHP 7.
|
|
|
|
apt_repository: repo='ppa:ondrej/php'
|
2017-07-27 04:46:30 +02:00
|
|
|
when: ansible_distribution == 'Ubuntu'
|
2016-02-16 22:59:49 +01:00
|
|
|
|
2017-05-15 06:10:58 +02:00
|
|
|
# Debian-specific tasks.
|
|
|
|
- name: Add dependencies for PHP versions (Debian).
|
|
|
|
apt:
|
|
|
|
name: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- apt-transport-https
|
|
|
|
- ca-certificates
|
|
|
|
when: ansible_distribution == "Debian"
|
|
|
|
|
|
|
|
- name: Add Ondrej Sury's apt key (Debian).
|
|
|
|
apt_key:
|
|
|
|
url: https://packages.sury.org/php/apt.gpg
|
|
|
|
state: present
|
|
|
|
when: ansible_distribution == "Debian"
|
|
|
|
|
|
|
|
- name: Add Ondrej Sury's repo (Debian).
|
|
|
|
apt_repository:
|
|
|
|
repo: "deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
|
|
|
|
state: present
|
|
|
|
register: php_ondrej_debian_repo
|
|
|
|
when: ansible_distribution == "Debian"
|
|
|
|
|
|
|
|
- name: Update apt caches after repo is added (Debian).
|
|
|
|
apt: update_cache=yes
|
|
|
|
when: php_ondrej_debian_repo.changed and (ansible_distribution == "Debian")
|
|
|
|
|
2016-02-16 17:25:40 +01:00
|
|
|
roles:
|
2016-09-14 22:46:27 +02:00
|
|
|
- role: geerlingguy.repo-remi
|
2016-09-18 01:42:47 +02:00
|
|
|
when: ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora'
|
2016-02-16 17:25:40 +01:00
|
|
|
- role_under_test
|