---
- name: Update apt
  apt: update_cache=yes autoremove=yes

- name: Add ppa Repository
  apt_repository: repo=ppa:ondrej/{{ php.ppa }}

- name: Update apt
  apt: update_cache=yes

- name: Install php7
  apt: pkg=php7.0 state=latest

- name: Install PHP Packages
  apt: pkg="{{ item }}" state=latest
  with_items: "{{ php.packages }}"
  when: php.packages is defined

- include: configure.yml
