Commit 073edff Thom Duran
committed
1 parent 3b86e55 commit 073edff Copy full SHA for 073edff
File tree 4 files changed +29
-1
lines changed
provider/sensu_api_config
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def flush
30
30
# Returns nothing.
31
31
def create
32
32
conf [ 'api' ] = { }
33
+ self . bind = resource [ :bind ]
33
34
self . port = resource [ :port ]
34
35
self . host = resource [ :host ]
35
36
self . user = resource [ :user ] unless resource [ :user ] . nil?
@@ -50,14 +51,30 @@ def exists?
50
51
conf . has_key? 'api'
51
52
end
52
53
54
+
55
+ # Public: Retrieve the bind IP that the API is bound on the server
56
+ #
57
+ # Returns the String bind IP
58
+
59
+ def bind
60
+ conf [ 'api' ] [ 'bind' ]
61
+ end
62
+
63
+ # Public: Set the IP that bind will use.
64
+ #
65
+ # Returns nothing.
66
+
67
+ def bind = ( value )
68
+ conf [ 'api' ] [ 'bind' ] = value
69
+ end
70
+
53
71
# Public: Retrieve the port number that the API is configured to listen on.
54
72
#
55
73
# Returns the String port number.
56
74
def port
57
75
conf [ 'api' ] [ 'port' ] . to_s
58
76
end
59
77
60
-
61
78
def config_file
62
79
"#{ resource [ :base_path ] } /api.json"
63
80
end
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ def initialize(*args)
38
38
defaultto 'localhost'
39
39
end
40
40
41
+ newproperty ( :bind ) do
42
+ desc "The bind IP that sensu will bind to"
43
+
44
+ defaultto '0.0.0.0'
45
+ end
46
+
41
47
newparam ( :base_path ) do
42
48
desc "The base path to the client config file"
43
49
defaultto '/etc/sensu/conf.d/'
Original file line number Diff line number Diff line change 23
23
24
24
sensu_api_config { $::fqdn :
25
25
ensure => $ensure ,
26
+ bind => $sensu::api_bind ,
26
27
host => $sensu::api_host ,
27
28
port => $sensu::api_port ,
28
29
user => $sensu::api_user ,
Original file line number Diff line number Diff line change 91
91
# Integer. Redis port to be used by sensu
92
92
# Default: 6379
93
93
#
94
+ # [*api_bind*]
95
+ # String. IP to bind api service
96
+ # Default: 0.0.0.0
94
97
# [*api_host*]
95
98
# String. Hostname of the sensu api service
96
99
# Default: localhost
187
190
$rabbitmq_ssl_cert_chain = undef ,
188
191
$redis_host = ' localhost' ,
189
192
$redis_port = 6379,
193
+ $api_bind = ' 0.0.0.0' ,
190
194
$api_host = ' localhost' ,
191
195
$api_port = 4567,
192
196
$api_user = undef ,
You can’t perform that action at this time.
0 commit comments