---

- name: Install php
  apt:
    name: '{{ item }}'
    update_cache: yes
    cache_valid_time: 36000
    state: latest
  with_items:
  - php-fpm
  - php-cli
  - php-mysql
  - php-intl
  - php-curl
  - php-memcached
  - php-imagick
  - php-mcrypt
  - php-xml
  - php-mbstring
  - memcached
  - composer

- name: Remove default fpm pool
  file:
    path: /etc/php/7.0/fpm/pool.d/www.conf
    state: absent
  notify: reload php-fpm

- name: Drop php-fpm configuration
  copy:
    src: tatoeba.conf
    dest: /etc/php/7.0/fpm/pool.d
    owner: root
    group: root
    mode: 0640
  notify: reload php-fpm

# Desired state

- name: Start/Enable php-fpm
  service:
    name: php7.0-fpm
    state: started
    enabled: yes

---

- name: Install php
  apt:
    name: '{{ item }}'
    update_cache: yes
    cache_valid_time: 36000
    state: latest
  with_items:
  - php-fpm
  - php-cli
  - php-mysql
  - php-intl
  - php-curl
  - php-memcached
  - php-imagick
  - php-mcrypt
  - php-xml
  - php-mbstring
  - php-zip
  - memcached
  - composer

- name: Remove default fpm pool
  file:
    path: /etc/php/7.0/fpm/pool.d/www.conf
    state: absent
  notify: reload php-fpm

- name: Drop php-fpm configuration
  copy:
    src: tatoeba.conf
    dest: /etc/php/7.0/fpm/pool.d
    owner: root
    group: root
    mode: 0640
  notify: reload php-fpm

# Desired state

- name: Start/Enable php-fpm
  service:
    name: php7.0-fpm
    state: started
    enabled: yes

Add php-zip to allow composer to download dists
Add php-zip to allow composer to download dists

I was getting the following warning:

    Failed to download cakephp/cakephp from dist: The zip extension and unzip command are both missing, skipping.
The php.ini used by your command-line PHP is: /etc/php/7.0/cli/php.ini
    Now trying to download from source
