From d836862837363e9f232586fc3c44669a958a0b01 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Tue, 28 Nov 2017 08:28:41 +0100 Subject: [PATCH] Uninstall xdebug --- tasks/main.yml | 2 -- tasks/xdebug.yml | 48 +++++++++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 49555e5..1b9352c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -34,8 +34,6 @@ - name: INCLUDE | Xdebug include: xdebug.yml - when: php_install_xdebug - name: APT | Install and configure opcache include: opcache.yml - diff --git a/tasks/xdebug.yml b/tasks/xdebug.yml index 0470abe..fdc4913 100644 --- a/tasks/xdebug.yml +++ b/tasks/xdebug.yml @@ -1,21 +1,35 @@ --- -- name: APT | Install php-xdebug - apt: > - pkg="{{ php_apt_prefix }}xdebug" - state=present - update_cache=yes - cache_valid_time=3600 +- block: -- name: SHELL | Get Xdebug version - shell: dpkg -l | awk '$2 ~ /xdebug$/ { print $3 }' - changed_when: false - register: xdebug_version + - name: APT | Install php-xdebug + apt: + pkg: "{{ php_apt_prefix }}xdebug" + state: present + update_cache: yes + cache_valid_time: 3600 -- 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 + - 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: + + - name: APT | Uninstall php-xdebug + apt: + pkg: "{{ php_apt_prefix }}xdebug" + state: absent + notify: restart php-fpm + + when: not php_install_xdebug