ansible-php/tasks/xdebug.yml

39 lines
1.0 KiB
YAML

---
- block:
- name: APT | Install php-xdebug
apt:
pkg: "{{ php_apt_prefix }}xdebug"
state: present
update_cache: yes
cache_valid_time: 3600
- name: SHELL | Get Xdebug version
shell: dpkg -l | awk '$2 ~ /xdebug$/ { print $3 }'
changed_when: false
register: xdebug_version
- name: TEMPLATE | Deploy module configurations
template:
src: "etc/__php__/mods-available/xdebug.ini.j2"
dest: "{{ php_mods_dir }}/xdebug.ini"
owner: root
mode: 0644
notify: restart php-fpm
when: php_install_xdebug
- block:
# We can't uninstall as simple way. We can uninstall with php7.0-xdebug (virtual package), but removing virtual package doesn't affect real package.
# On Jessie: php5-xdebug, php-xdebug (sury for PHP 5.6/7.0/7.1/7.2), php5-xdebug + php7.0-xdebug (dotdeb)
# On Stretch: php-xdebug
- name: COMMAND | Disable xdebug package
command: phpdismod -v {{ php_version }} xdebug
args:
removes: "{{ php_etc_dir }}/cli/conf.d/20-xdebug.ini"
when: not php_install_xdebug