diff --git a/manifests/config.pp b/manifests/config.pp index be7169d38..1f9c5472d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -98,6 +98,17 @@ require => File['/etc/rabbitmq'], } + if $::osfamily == 'Debian' { + file { '/etc/default/rabbitmq-server': + ensure => file, + content => template('rabbitmq/default.erb'), + mode => '0644', + owner => '0', + group => '0', + notify => Class['rabbitmq::service'], + } + } + if $config_cluster { if $erlang_cookie == undef { @@ -115,7 +126,4 @@ } } } - - } - diff --git a/manifests/init.pp b/manifests/init.pp index a7a50ccae..348956682 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -58,6 +58,7 @@ $version = $rabbitmq::params::version, $wipe_db_on_cookie_change = $rabbitmq::params::wipe_db_on_cookie_change, $cluster_partition_handling = $rabbitmq::params::cluster_partition_handling, + $file_limit = $rabbitmq::params::file_limit, $environment_variables = $rabbitmq::params::environment_variables, $config_variables = $rabbitmq::params::config_variables, $config_kernel_variables = $rabbitmq::params::config_kernel_variables, @@ -93,6 +94,7 @@ validate_re($stomp_port, '\d+') validate_bool($wipe_db_on_cookie_change) validate_bool($tcp_keepalive) + validate_re($file_limit, '\d+') # Validate service parameters. validate_re($service_ensure, '^(running|stopped)$') validate_bool($service_manage) diff --git a/manifests/params.pp b/manifests/params.pp index f699b0db8..7942d104e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -116,4 +116,5 @@ $environment_variables = {} $config_variables = {} $config_kernel_variables = {} + $file_limit = 16384 } diff --git a/templates/default.erb b/templates/default.erb new file mode 100644 index 000000000..a2bea95e6 --- /dev/null +++ b/templates/default.erb @@ -0,0 +1,10 @@ +# File managed by Puppet. + +# This file is sourced by /etc/init.d/rabbitmq-server. Its primary +# reason for existing is to allow adjustment of system limits for the +# rabbitmq-server process. +# +# Maximum number of open file handles. This will need to be increased +# to handle many simultaneous connections. Refer to the system +# documentation for ulimit (in man bash) for more information. +ulimit -n <%= @file_limit %>