Skip to content

Commit

Permalink
Merge pull request #341 from superseb/superseb/configure_client_port
Browse files Browse the repository at this point in the history
Make client port configurable, issue #335
  • Loading branch information
jamtur01 committed Apr 10, 2015
2 parents dc88e94 + d8b9d32 commit 6aca0c2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/puppet/provider/sensu_client_config/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ def bind=(value)
conf['client']['bind'] = value
end

def port
conf['client']['port']
end

def port=(value)
conf['client']['port'] = value
end

def subscriptions
conf['client']['subscriptions'] || []
end
Expand Down
5 changes: 5 additions & 0 deletions lib/puppet/type/sensu_client_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def insync?(is)
defaultto '127.0.0.1'
end

newproperty(:port) do
desc "The port that client will bind to"
defaultto '3030'
end

newparam(:base_path) do
desc "The base path to the client config file"
defaultto '/etc/sensu/conf.d/'
Expand Down
1 change: 1 addition & 0 deletions manifests/client/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
client_name => $sensu::client_name,
address => $sensu::client_address,
bind => $sensu::client_bind,
port => $sensu::client_port,
subscriptions => $sensu::subscriptions,
safe_mode => $sensu::safe_mode,
custom => $sensu::client_custom,
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
$api_password = undef,
$subscriptions = [],
$client_bind = '127.0.0.1',
$client_port = '3030',
$client_address = $::ipaddress,
$client_name = $::fqdn,
$client_custom = {},
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/sensu_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
:ensure => 'present',
:client_name => 'host.domain.com',
:address => '2.3.4.5',
:bind => '127.0.0.1',
:port => '3030',
:subscriptions => [],
:ensure => 'present',
:custom => {}
Expand All @@ -33,6 +35,8 @@
:ensure => 'present',
:client_name => 'myclient',
:address => '1.2.3.4',
:bind => '127.0.0.1',
:port => '3030',
:subscriptions => ['all'],
:ensure => 'present',
:safe_mode => true,
Expand Down

0 comments on commit 6aca0c2

Please sign in to comment.