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

Add support for broadcast_rpc_address #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$authenticator,
$authorizer,
$rpc_address,
$rpc_broadcast_address,
$rpc_port,
$rpc_server_type,
$rpc_min_threads,
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$start_native_transport = $cassandra::params::start_native_transport,
$start_rpc = $cassandra::params::start_rpc,
$rpc_address = $cassandra::params::rpc_address,
$rpc_broadcast_address = $cassandra::params::rpc_broadcast_address,
$rpc_port = $cassandra::params::rpc_port,
$rpc_server_type = $cassandra::params::rpc_server_type,
$rpc_min_threads = $cassandra::params::rpc_min_threads,
Expand Down Expand Up @@ -128,6 +129,10 @@
fail('rpc_address must be an IP address')
}

if(!empty($rpc_broadcast_address) and !is_ip_address($rpc_broadcast_address)) {
fail('rpc_broadcast_address must be an IP address')
}

if(!is_integer($rpc_port)) {
fail('rpc_port must be a port number between 1 and 65535')
}
Expand Down Expand Up @@ -200,6 +205,7 @@
authenticator => $authenticator,
authorizer => $authorizer,
rpc_address => $rpc_address,
rpc_broadcast_address => $rpc_broadcast_address,
rpc_port => $rpc_port,
rpc_server_type => $rpc_server_type,
rpc_min_threads => $rpc_min_threads,
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@
default => $::cassandra_rpc_address,
}

$rpc_broadcast_address = $::cassandra_rpc_broadcast_address ? {
undef => '',
default => $::cassandra_rpc_broadcast_address,
}

$rpc_port = $::cassandra_rpc_port ? {
undef => 9160,
default => $::cassandra_rpc_port,
Expand Down
3 changes: 3 additions & 0 deletions templates/cassandra2.1.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ rpc_port: <%= @rpc_port %>
# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
# be set.
# broadcast_rpc_address: 1.2.3.4
<% unless @rpc_broadcast_address.nil? || @rpc_broadcast_address.empty? %>
broadcast_rpc_address: <%= @rpc_broadcast_address %>
<% end %>

# enable or disable keepalive on rpc/native connections
rpc_keepalive: true
Expand Down