##
# Ansible file to install PHP
#

---
# file: roles/php/tasks/main.yml

- name: "PHP Role"
  set_fact: role_php_started=true
  tags: always

- block:

  - include: php.yml

  - name: "Disable OpCache for CLI and FPM, they are there twice"
    command: 'phpdismod -s {{ item }} opcache'
    with_items:
      - 'cli'
      - 'fpm'
    when: php_version|default("5.5") == "7"

  - name: 'PHP | Remember that this role had been run'
    set_fact: role_php_completed=true
    tags: always

  when: '"php" not in excluded_roles and role_php_completed is not defined'
