---
- name: Set name of directory for XDebug
  set_fact:
    cikit_php_xdebug: "xdebug-{{ php.xdebug }}"

- name: Download XDebug
  get_url:
    url: "https://xdebug.org/files/{{ cikit_php_xdebug }}.tgz"
    dest: "/tmp/{{ cikit_php_xdebug }}.tgz"

- name: Unarchive XDebug
  shell: "tar -xf /tmp/{{ cikit_php_xdebug }}.tgz -C /tmp/"
  args:
    # Unarchive module does not work properly in Ansible 2.1.1.0.
    warn: no

- include_tasks: fixtures/compile.yml name="XDebug" dir="/tmp/{{ cikit_php_xdebug }}"

---
- name: Set name of directory for XDebug
  set_fact:
    cikit_php_xdebug: "xdebug-{{ php.xdebug }}"

- name: Download XDebug
  get_url:
    url: "https://xdebug.org/files/{{ cikit_php_xdebug }}.tgz"
    dest: "/tmp/{{ cikit_php_xdebug }}.tgz"

- name: Unarchive XDebug
  shell: "tar -xf /tmp/{{ cikit_php_xdebug }}.tgz -C /tmp/"
  args:
    # Unarchive module does not work properly in Ansible 2.1.1.0.
    warn: no

- include_tasks: fixtures/compile.yml name="XDebug" dir="/tmp/{{ cikit_php_xdebug }}"

- name: Set environment variable
  lineinfile:
    dest: /etc/bash.bashrc
    line: 'export {{ item.key }}="{{ item.value }}"'
    regexp: "{{ item.value | regex_escape }}"
    insertbefore: BOF
  with_dict:
    XDEBUG_CONFIG: "idekey={{ php.extensions.xdebug.config.idekey }}"
    PHP_IDE_CONFIG: "serverName={{ ansible_fqdn }}"

Set "XDEBUG_CONFIG" and "PHP_IDE_CONFIG" environment variables
[PHP] Set "XDEBUG_CONFIG" and "PHP_IDE_CONFIG" environment variables
