Skip to content

Commit

Permalink
Add extra xdebug.ini variables, remove ability to enable xdebug
Browse files Browse the repository at this point in the history
  • Loading branch information
ndench committed Feb 7, 2018
1 parent d9da5d3 commit db8f57e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 27 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,32 @@ All variables are listed below, along with their default values in [defaults/mai
Variables for installing xdebug:

```yaml
xdebug_version: 7.1 # The version of PHP that's running
xdebug_enable_mod: false # Whether to run phpenmod to enable the xdebug model
```
# The version of the xdebug package to install (ie. php7.2-xdebug)
xdebug_php_version: 7.2

Settings for the `xdebug.ini` file, see [xdebug docs](https://xdebug.org/docs/all_settings):
# xdbebug.ini settings
# see: https://xdebug.org/docs/all_settings

```yaml
xdebug_conf_max_nesting_level: 256
xdebug_conf_remote_port: 9000
xdebug_conf_idekey: PHPSTORM

# Start xdebug on every requset, regardless of the GET/POST variable
xdebug_remote_autostart: 0

# Connect to the client that sent the request
xdebug_conf_remote_connect_back: 0

# Connect to the specified host (overidden by remote_connect_back)
# 10.0.2.2 is the default IP address virtualbox assigns to the host
xdebug_remote_enable: 0
xdebug_remote_host: 10.0.2.2
xdebug_conf_remote_port: 9000
```
Dependencies
------------
* [geerlingguy.php](https://github.com/geerlingguy/ansible-role-php)
* [geerlingguy.php-version](https://github.com/geerlingguy/ansible-role-php-versions)
None.
Example Playbook
----------------
Expand Down
19 changes: 17 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
xdebug_enable_mod: false
# The version of the xdebug package to install (ie. php7.2-xdebug)
xdebug_php_version: 7.2

# xdbebug.ini settings
# see: https://xdebug.org/docs/all_settings

xdebug_conf_max_nesting_level: 256
xdebug_conf_remote_port: 9000
xdebug_conf_idekey: PHPSTORM

# Start xdebug on every requset, regardless of the GET/POST variable
xdebug_remote_autostart: 0

# Connect to the client that sent the request
xdebug_conf_remote_connect_back: 0

# Connect to the specified host (overidden by remote_connect_back)
# 10.0.2.2 is the default IP address virtualbox assigns to the host
xdebug_remote_enable: 0
xdebug_remote_host: 10.0.2.2
xdebug_conf_remote_port: 9000
4 changes: 1 addition & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ galaxy_info:
- debug
- xdebug

dependencies:
- { role: geerlingguy.php-versions, become: yes }
- { role: geerlingguy.php, become: yes }
dependencies: []
8 changes: 1 addition & 7 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
---
- name: install php xdebug
apt:
pkg: php-xdebug
pkg: php{{ xdebug_php_version }}-xdebug
state: present

- name: configure xdebug
template:
src: xdebug.ini.j2
dest: /etc/php/{{ php_version }}/mods-available/xdebug.ini

- name: enable xdebug module
command: phpenmod xdbeug
when: xdebug_enable_mod == true
notify:
- restart php-fpm
13 changes: 6 additions & 7 deletions templates/xdebug.ini.j2
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
zend_extension=xdebug.so
xdebug.max_nesting_level={{ xdebug_conf_max_nesting_level }}
xdebug.remote_port={{ xdebug_conf_remote_port }}
xdebug.idekey={{ xdebug_conf_idekey }}

;xdebug.remote_enable=1
; Start Xdebug on every request, regardless of the GET/POST variable
xdebug.remote_autostart={{ xdebug_remote_autostart }}

; Connect to the client that made the request (overrides remote_host)
xdebug.remote_connect_back={{ xdebug_conf_remote_connect_back }}

; Start Xdebug on every request, regardless of the GET/POST variable
;xdebug.remote_autostart=1

; IP address of the host machine (if remote_connect_back doesn't work)
xdebug.remote_host=10.0.2.2
; Connect to specified remote host (overridden by remote_connect_back)
xdebug.remote_enable={{ xdebug_remote_enable }}
xdebug.remote_host={{ xdebug_remote_host }}
xdebug.remote_port={{ xdebug_conf_remote_port }}

; Xdebug Profiling
;xdebug.profiler_enable=1
Expand Down

0 comments on commit db8f57e

Please sign in to comment.