Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added any_of channel to cluster #16

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions manifests/config/cluster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
49 changes: 0 additions & 49 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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': }
Expand Down
6 changes: 4 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
) {

if $package_manage {

include epel

group { $group:
ensure => present
}
Expand All @@ -19,7 +20,8 @@
}

package { $package_name:
ensure => $package_ensure
ensure => $package_ensure,
require => Yumrepo['epel'],
}
}
}
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
9 changes: 8 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/sysconfig/carbon-c-relay.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down