poise-monit 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -0
- data/chef/attributes/default.rb +5 -0
- data/lib/poise_monit/resources/monit_service.rb +1 -6
- data/lib/poise_monit/version.rb +1 -1
- data/test/spec/resources/monit_service_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5910f2212aae422952d183c3181c7a9f16ba7645
|
|
4
|
+
data.tar.gz: be58c2407526be1cfdc0f618898c18b1333447a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a72322971a42e15e31d8c6c5008d1186b4b66bf38a4f7339a0cfaf2a5a069267077d2c228b1308a82a99f2f42adbf680de67e48b1dcbc9bed2a34cb3e09cf633
|
|
7
|
+
data.tar.gz: 7918da029cf7e55e252f69cf166e66998bdefe6939bc8b8a90209990b40b189b33bca84f1decc79abb776fba327713a9851f8fadc76d4b762793834cff126e56
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -261,6 +261,13 @@ end
|
|
|
261
261
|
|
|
262
262
|
To set the `monit` provider as the global default, use [`poise-sevice-monit`](https://github.com/poise/poise-service-monit).
|
|
263
263
|
|
|
264
|
+
The service provider has two node attributes that can used for global tuning:
|
|
265
|
+
|
|
266
|
+
* `node['poise-monit']['monit_service_timeout']` – Seconds before timeout when
|
|
267
|
+
registering a new service with Monit. *(default: 20)*
|
|
268
|
+
* `node['poise-monit']['monit_service_wait']` – Seconds to wait between attempts
|
|
269
|
+
when registering a new service with Monit. *(default: 1)*
|
|
270
|
+
|
|
264
271
|
## Upgrading From `monit`
|
|
265
272
|
|
|
266
273
|
Upgrading from the older [`monit` cookbook](https://github.com/poise/poise-monit-compat)
|
data/chef/attributes/default.rb
CHANGED
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
16
|
|
|
17
|
+
# Seconds before timeout when registering a new service with Monit.
|
|
18
|
+
default['poise-monit']['monit_service_timeout'] = 20
|
|
19
|
+
# Seconds to wait between attempts when registering a new service with Monit.
|
|
20
|
+
default['poise-monit']['monit_service_wait'] = 1
|
|
21
|
+
|
|
17
22
|
# Recipe to include when a parent is needed for poise_service.
|
|
18
23
|
default['poise-monit']['default_recipe'] = 'poise-monit'
|
|
19
24
|
|
|
@@ -31,11 +31,6 @@ module PoiseMonit
|
|
|
31
31
|
# Value from monit action subcommands that mean the service doesn't exist.
|
|
32
32
|
NO_SERVICE_ERROR = /There is no service/
|
|
33
33
|
|
|
34
|
-
# Default time to wait for a monit command to succeed.
|
|
35
|
-
DEFAULT_TIMEOUT = 20
|
|
36
|
-
# Default time to sleep between tries.
|
|
37
|
-
DEFAULT_WAIT = 1
|
|
38
|
-
|
|
39
34
|
# A `monit_service` resource to control Monit-based services.
|
|
40
35
|
#
|
|
41
36
|
# @provides monit_service
|
|
@@ -175,7 +170,7 @@ module PoiseMonit
|
|
|
175
170
|
status_cmd.stdout =~ re && $1
|
|
176
171
|
end
|
|
177
172
|
|
|
178
|
-
def monit_shell_out!(monit_cmd, timeout:
|
|
173
|
+
def monit_shell_out!(monit_cmd, timeout: node['poise-monit']['monit_service_timeout'], wait: node['poise-monit']['monit_service_wait'], &block)
|
|
179
174
|
while true
|
|
180
175
|
cmd_args = [new_resource.parent.monit_binary]
|
|
181
176
|
cmd_args << '-v' if (defined?(new_resource.monit_verbose) && new_resource.monit_verbose) || Chef::Log.level == :debug
|
data/lib/poise_monit/version.rb
CHANGED
|
@@ -31,8 +31,9 @@ describe PoiseMonit::Resources::MonitService do
|
|
|
31
31
|
allow(File).to receive(:exist?).with('/exists').and_return(true)
|
|
32
32
|
allow(File).to receive(:exist?).with('/not_exists').and_return(false)
|
|
33
33
|
# Override these so our tests don't take forever.
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
override_attributes['poise-monit'] ||= {}
|
|
35
|
+
override_attributes['poise-monit']['monit_service_timeout'] = 2
|
|
36
|
+
override_attributes['poise-monit']['monit_service_wait'] = 0.01
|
|
36
37
|
# Status for simple cases.
|
|
37
38
|
stub_status(status) if status
|
|
38
39
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: poise-monit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Noah Kantrowitz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-04-
|
|
11
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: halite
|