diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2915f71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +atlassian* diff --git a/README.md b/README.md index 2b166e2..c84af2b 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +- add support for RedHat and other os diff --git a/manifests/config.pp b/manifests/config.pp index 0553cf0..f69c59f 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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, } @@ -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'], } -} \ No newline at end of file +} diff --git a/manifests/debian.pp b/manifests/debian.pp index 41d8bcf..70cf240 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -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']], } -} \ No newline at end of file +} diff --git a/templates/ini_file.erb b/templates/ini_file.erb index 8e555b9..a1508e7 100644 --- a/templates/ini_file.erb +++ b/templates/ini_file.erb @@ -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 %>