diff --git a/manifests/config/cluster.pp b/manifests/config/cluster.pp index cad346a..1a3cc26 100644 --- a/manifests/config/cluster.pp +++ b/manifests/config/cluster.pp @@ -13,8 +13,8 @@ validate_string( $file ) } - if ! ($channel in ['carbon_ch', 'fnv1a_ch', 'forward', 'file']) { - fail("channel '${channel}' is not in ['carbon_ch', 'fnv1a_ch', 'forward', 'file']") + if ! ($channel in ['carbon_ch', 'fnv1a_ch', 'forward', 'file', 'any_of']) { + fail("channel '${channel}' is not in ['carbon_ch', 'fnv1a_ch', 'forward', 'file', 'any_of']") } unless is_array( $hosts ) { diff --git a/manifests/init.pp b/manifests/init.pp index eb681be..1d951f7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -181,55 +181,6 @@ $worker_threads = $carbon_c_relay::params::worker_threads ) inherits carbon_c_relay::params { - validate_bool( - $carbon_cache_statistics, - $package_manage, - $service_enable, - $service_manage, - $sorted_matches, - $sorted_rewrites, - ) - - validate_hash( - $config_clusters, - $config_rewrites, - ) - - validate_integer([ - $io_timeout, - $limit_no_file, - $limit_nproc, - $listen, - $listen_backlog, - $max_stalls, - $replication_factor, - $server_batch_size, - $server_queue_size, - $statistics_sending_interval, - $worker_threads, - ]) - - validate_string( - $config_file, - $group, - $init_file, - $init_file_ensure, - $init_template, - $interface, - $log_dir, - $log_file, - $output_file, - $package_ensure, - $package_name, - $pid_dir, - $pid_file, - $service_ensure, - $service_name, - $sysconfig_file, - $sysconfig_template, - $user, - ) - anchor { 'carbon_c_relay::begin': } -> class { '::carbon_c_relay::install': } -> class { '::carbon_c_relay::config': } diff --git a/manifests/install.pp b/manifests/install.pp index cd60348..40f3942 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -8,7 +8,8 @@ ) { if $package_manage { - + include epel + group { $group: ensure => present } @@ -19,7 +20,8 @@ } package { $package_name: - ensure => $package_ensure + ensure => $package_ensure, + require => Yumrepo['epel'], } } } diff --git a/manifests/params.pp b/manifests/params.pp index af3c569..42718d9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -10,7 +10,7 @@ $init_file = '/etc/init.d/carbon-c-relay' $init_file_ensure = 'file' $init_template = "carbon_c_relay${init_file}.erb" - $interface = '0.0.0.0' + $interface = undef $io_timeout = 600 $limit_fsize = undef $limit_cpu = undef @@ -40,7 +40,7 @@ $sorted_matches = true $sorted_rewrites = false $statistics_hostname = undef - $statistics_sending_interval = 60 + $statistics_sending_interval = undef $sysconfig_file = '/etc/sysconfig/carbon-c-relay' $sysconfig_template = "carbon_c_relay${sysconfig_file}.erb" $user = 'carbon-c-relay' diff --git a/metadata.json b/metadata.json index a60d818..01867bd 100644 --- a/metadata.json +++ b/metadata.json @@ -8,7 +8,14 @@ "project_page": "https://github.com/mlambrichs/puppet-carbon_c_relay.git", "issues_url": "https://github.com/mlambrichs/puppet-carbon_c_relay/issues", "dependencies": [ - {"name":"puppetlabs-stdlib","version_requirement":">=2.1.3 <5.0.0"} + { + "name": "puppetlabs-stdlib", + "version_requirement":">=2.1.3 <9.0.0" + }, + { + "name": "puppet/epel", + "version_requirement": ">= 3.0.0 < 5.0.0" + } ], "tags": [ "carbon-c-relay", diff --git a/templates/etc/sysconfig/carbon-c-relay.erb b/templates/etc/sysconfig/carbon-c-relay.erb index af7571b..440f3cc 100644 --- a/templates/etc/sysconfig/carbon-c-relay.erb +++ b/templates/etc/sysconfig/carbon-c-relay.erb @@ -24,4 +24,4 @@ # -t config test mode: prints rule matches from input on stdin # -H hostname: override hostname (used in statistics) -ARGS=-p <%= @listen %> -i <%= @interface %> -w <%= @worker_threads %> -b <%= @server_batch_size %> -q <%= @server_queue_size %> -l <%= @log_dir %>/<%= @log_file %><% if @max_stalls -%> -L <%= @max_stalls %><% end -%><% if @listen_backlog -%> -B <%= @listen_backlog %><% end -%><% if @io_timeout -%> -T <%= @io_timeout %><% end -%><% if @carbon_cache_statistics -%> -m <% end -%><% if @statistics_sending_interval -%> -S <%= @statistics_sending_interval %><% end -%><% if @allowed_chars -%> -c <%= @allowed_chars %><% end -%><% if @statistics_hostname -%> -H <%= @statistics_hostname %><% end -%> +ARGS=-p <%= @listen %><% if @interface -%> -i <%= @interface %><% end -%> -w <%= @worker_threads %> -b <%= @server_batch_size %> -q <%= @server_queue_size %> -l <%= @log_dir %>/<%= @log_file %><% if @max_stalls -%> -L <%= @max_stalls %><% end -%><% if @listen_backlog -%> -B <%= @listen_backlog %><% end -%><% if @io_timeout -%> -T <%= @io_timeout %><% end -%><% if @carbon_cache_statistics -%> -m <% end -%><% if @statistics_sending_interval -%> -S <%= @statistics_sending_interval %><% end -%><% if @allowed_chars -%> -c <%= @allowed_chars %><% end -%><% if @statistics_hostname -%> -H <%= @statistics_hostname %><% end -%> diff --git a/templates/usr/lib/systemd/system/carbon-c-relay.service.erb b/templates/usr/lib/systemd/system/carbon-c-relay.service.erb index 4e4f8b0..7ba73d3 100644 --- a/templates/usr/lib/systemd/system/carbon-c-relay.service.erb +++ b/templates/usr/lib/systemd/system/carbon-c-relay.service.erb @@ -8,7 +8,7 @@ User=<%= @user %> Group=<%= @group %> EnvironmentFile=/etc/sysconfig/<%= @service_name %> ExecStart=/bin/carbon-c-relay -f <%= @config_file %> $ARGS -ExecReload=/bin/kill -HUP ${MAINPID} +ExecReload=/bin/kill -s HUP $MAINPID Type=simple <% if @limit_fsize -%> # (file size)