---
- name: Include OS-Specific variables.
  include_vars: "{{ ansible_os_family }}.yml"

- name: Ensure pecl is installed (if configured).
  package:
    name: "{{ php_pecl_package }}"
    state: present
  when: php_pecl_install_pecl

- name: Install PECL libaries.
  shell: "yes '' | {{ php_pecl_install_command }} {{ item }}"
  register: pecl_result
  changed_when: "pecl_result.rc == 0"
  failed_when: "not (('already installed' in pecl_result.stdout) or ('install ok:' in pecl_result.stdout))"
  with_items: "{{ php_pecl_extensions }}"
