Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
atlassian*
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ Depends on (tested with)
Example usage:

include xdebug

Advanced configuration:

xdebug::config { 'default':
remote_host => '169.254.0.1', # Vagrant users can specify their address
remote_port => '9000', # Change default settings
}
Advanced configuration:
xdebug::config { 'default':
remote_host => '169.254.0.1', # Vagrant users can specify their address
remote_port => '9000', # Change default settings
}

Author: Stefan Kögel
Contributor: Alex Knol

GitHub: git@github.com:stkoegel/puppet-xdebug.git

Changelog:

* Version 0.1 - Initial Commit for Debian/Ubuntu and three config values
* Version 0.2 - Add xdebug configuration options
* Version 0.2 - Add xdebug configuration options

ToDo:
- add support for RedHat and other os
- add support for RedHat and other os
25 changes: 15 additions & 10 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
define xdebug::config (
#Template variables
$ini_file_path = '',
$default_enable = '',
$remote_enable = '',
$remote_handler = '',
$remote_host = '',
$remote_port = '',
$remote_autostart = '',
$ini_file_path = '',
$default_enable = '',
$remote_enable = '',
$remote_handler = '',
$remote_host = '',
$remote_port = '',
$remote_autostart = '',
$remote_connect_back = '',
)
{

#Template variables default values
$xdebug_ini_file_path = $ini_file_path ? {
'' => '/etc/php5/conf.d/xdebug_config.ini',
'' => '/etc/php5/mods-available/xdebug_config.ini',
default => $ini_file_path,
}

Expand Down Expand Up @@ -46,10 +47,14 @@
default => $remote_autostart,
}

$xdebug_remote_connect_back = $remote_connect_back ? {
'' => '0',
default => $remote_connect_back,
}

file { "$xdebug_ini_file_path" :
content => template('xdebug/ini_file.erb'),
ensure => present,
require => Package['xdebug'],
notify => Service['apache2'],
}
}
}
12 changes: 9 additions & 3 deletions manifests/debian.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
class xdebug::debian {

include xdebug::params

package { "xdebug":
name => $xdebug::params::pkg,
ensure => installed,
require => Class['php'],
require => Package['php5-cli'],
}

exec { 'enable_xdebug':
command => 'php5enmod xdebug && php5enmod -s cli xdebug && php5enmod xdebug_config && php5enmod -s cli xdebug_config',
user => root,
require => [Package['php5-cli']],
}

}
}
15 changes: 8 additions & 7 deletions templates/ini_file.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# File Managed by Puppet
xdebug.default_enable=<%= default_enable %>
xdebug.remote_enable=<%= remote_enable %>
xdebug.remote_handler=<%= remote_handler %>
xdebug.remote_host=<%= remote_host %>
xdebug.remote_port=<%= remote_port %>
xdebug.remote_autostart=<%= remote_autostart %>
;File Managed by Puppet
xdebug.default_enable=<%= @default_enable %>
xdebug.remote_enable=<%= @remote_enable %>
xdebug.remote_handler=<%= @remote_handler %>
xdebug.remote_host=<%= @remote_host %>
xdebug.remote_port=<%= @remote_port %>
xdebug.remote_autostart=<%= @remote_autostart %>
xdebug.remote_connect_back=<%= @remote_connect_back %>