poise-monit 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6d5bb865abb7d614f50d0688d4eb2938fe87007
4
- data.tar.gz: 5735c8757230cb75f30c2633a0a6d136ff1dffc7
3
+ metadata.gz: 07ff0116df0ba8f85dd624148cfbf3439b3189d3
4
+ data.tar.gz: 34f52b07a049dbcd0b40955cb7b27453c07670a8
5
5
  SHA512:
6
- metadata.gz: 5785034c296f4aa66c41fdcb61f2ca763513d5638d960fe130ae6a6b25ba000359eaa02a42d4c1e034f154e52a768ff388fe6ce2e2b18e48bd08307a21bc4812
7
- data.tar.gz: 4527c6dda84d8b3482fbcaa92980286482ff8bb04220772f567c4452ff7b04576896daf05dcc45714611f25ad8fc5072753b067fc64cafbda9b795fd4133cad9
6
+ metadata.gz: 761460bd6768bedb0a30a33f048004b1939a6ee02fc2bcccb6466588d69cf09c412dc7b006db94724e80fe918734e7d19b6694e81b74e053a5114835f1979ecf
7
+ data.tar.gz: 5b06b17af6e9411ac51004ed178650502a953bc22bdaf739850644db925973207097c645cae495b86f7c4be6c0197b37f558cbcea18ea4ef0209695ffbecbcef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Poise-Monit Changelog
2
2
 
3
+ ## v1.3.0
4
+
5
+ * More complete `:dummy` provider for weird install conditions.
6
+
3
7
  ## v1.2.1
4
8
 
5
9
  * Fix static binary URLs for recent versions of Monit on AIX.
data/README.md CHANGED
@@ -238,6 +238,10 @@ monit 'monit' do
238
238
  end
239
239
  ```
240
240
 
241
+ #### Provider Options
242
+
243
+ * `monit_binary` – Path to the `monit` executable. *(default: /usr/bin/monit)*
244
+
241
245
  ## Service Provider
242
246
 
243
247
  The `monit` service provider is included to allow [`poise_service` resources](https://github.com/poise/poise-service)
@@ -24,6 +24,15 @@ module PoiseMonit
24
24
  class Dummy < Base
25
25
  provides(:dummy)
26
26
 
27
+ # Manual overrides for dummy data.
28
+ #
29
+ # @api private
30
+ def self.default_inversion_options(node, resource)
31
+ super.merge({
32
+ monit_binary: '/usr/bin/monit',
33
+ })
34
+ end
35
+
27
36
  # Enable by default on ChefSpec.
28
37
  #
29
38
  # @api private
@@ -35,8 +44,7 @@ module PoiseMonit
35
44
  #
36
45
  # @return [String]
37
46
  def monit_binary
38
- # Until I run into a counter example, probably always true.
39
- '/bin/monit'
47
+ options['monit_binary']
40
48
  end
41
49
 
42
50
  private
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoiseMonit
19
- VERSION = '1.2.1'
19
+ VERSION = '1.3.0'
20
20
  end
@@ -29,7 +29,7 @@ describe PoiseMonit::MonitProviders::Dummy do
29
29
  describe '#monit_binary' do
30
30
  subject { monit_resource.monit_binary }
31
31
 
32
- it { is_expected.to eq '/bin/monit' }
32
+ it { is_expected.to eq '/usr/bin/monit' }
33
33
  end # /describe #monit_binary
34
34
 
35
35
  describe 'action :enable' do
@@ -43,7 +43,7 @@ describe PoiseMonit::Resources::MonitService do
43
43
  else
44
44
  allow(fake_cmd).to receive(:error!)
45
45
  end
46
- matcher = receive(:poise_shell_out).with(['/bin/monit', (verbose ? '-v' : []), '-c', '/etc/monit/monitrc', cmd, 'myapp'].flatten, user: nil, group: nil).and_return(fake_cmd).ordered
46
+ matcher = receive(:poise_shell_out).with(['/usr/bin/monit', (verbose ? '-v' : []), '-c', '/etc/monit/monitrc', cmd, 'myapp'].flatten, user: nil, group: nil).and_return(fake_cmd).ordered
47
47
  matcher = block.call(matcher) if block
48
48
  expect(test_provider).to matcher
49
49
  end
@@ -24,7 +24,7 @@ describe PoiseMonit::Resources::Monit do
24
24
  # Force the default log level because it alters the tests.
25
25
  chefspec_options.delete(:log_level)
26
26
  allow_any_instance_of(described_class::Resource).to receive(:shell_out).and_call_original
27
- allow_any_instance_of(described_class::Resource).to receive(:shell_out).with(%w{/bin/monit -V}).and_return(monit_version_cmd)
27
+ allow_any_instance_of(described_class::Resource).to receive(:shell_out).with(%w{/usr/bin/monit -V}).and_return(monit_version_cmd)
28
28
  end
29
29
  def service_resource(name)
30
30
  chef_run.monit(name).provider_for_action(:enable).send(:service_resource)
@@ -56,7 +56,7 @@ EOH
56
56
  it { is_expected.to create_directory('/etc/monit/conf.d') }
57
57
  it { is_expected.to create_directory('/var/lib/monit') }
58
58
  it { is_expected.to create_directory('/var/lib/monit/events') }
59
- it { expect(service_resource('monit').command).to eq '/bin/monit -c /etc/monit/monitrc -I -d 120' }
59
+ it { expect(service_resource('monit').command).to eq '/usr/bin/monit -c /etc/monit/monitrc -I -d 120' }
60
60
 
61
61
  context 'with a different name' do
62
62
  recipe do
@@ -84,7 +84,7 @@ EOH
84
84
  it { is_expected.to create_directory('/etc/monit-other/conf.d') }
85
85
  it { is_expected.to create_directory('/var/lib/monit-other') }
86
86
  it { is_expected.to create_directory('/var/lib/monit-other/events') }
87
- it { expect(service_resource('other').command).to eq '/bin/monit -c /etc/monit-other/monitrc -I -d 120' }
87
+ it { expect(service_resource('other').command).to eq '/usr/bin/monit -c /etc/monit-other/monitrc -I -d 120' }
88
88
  end # /context with a different name
89
89
 
90
90
  context 'with daemon_delay 0' do
@@ -112,7 +112,7 @@ SET HTTPD UNIXSOCKET /var/run/monit.sock
112
112
 
113
113
  INCLUDE /etc/monit/conf.d/*
114
114
  EOH
115
- it { expect(service_resource('monit').command).to eq '/bin/monit -c /etc/monit/monitrc -I' }
115
+ it { expect(service_resource('monit').command).to eq '/usr/bin/monit -c /etc/monit/monitrc -I' }
116
116
  end # /context with daemon_delay 0
117
117
 
118
118
  context 'with daemon_delay 5' do
@@ -141,7 +141,7 @@ SET HTTPD UNIXSOCKET /var/run/monit.sock
141
141
 
142
142
  INCLUDE /etc/monit/conf.d/*
143
143
  EOH
144
- it { expect(service_resource('monit').command).to eq '/bin/monit -c /etc/monit/monitrc -I' }
144
+ it { expect(service_resource('monit').command).to eq '/usr/bin/monit -c /etc/monit/monitrc -I' }
145
145
  end # /context with daemon_delay 5
146
146
 
147
147
  context 'with 0 events slots' do
@@ -171,7 +171,7 @@ EOH
171
171
  end
172
172
  end
173
173
 
174
- it { expect(service_resource('monit').command).to eq '/bin/monit -c /etc/monit/monitrc -I -d 120 -v' }
174
+ it { expect(service_resource('monit').command).to eq '/usr/bin/monit -c /etc/monit/monitrc -I -d 120 -v' }
175
175
  end # /context with daemon_verbose
176
176
 
177
177
  context 'with log_level debug' do
@@ -182,7 +182,7 @@ EOH
182
182
  allow(Chef::Log).to receive(:debug)
183
183
  end
184
184
 
185
- it { expect(service_resource('monit').command).to eq '/bin/monit -c /etc/monit/monitrc -I -d 120 -v' }
185
+ it { expect(service_resource('monit').command).to eq '/usr/bin/monit -c /etc/monit/monitrc -I -d 120 -v' }
186
186
  end # /context with log_level debug
187
187
  end # /context action :enable
188
188
  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.2.1
4
+ version: 1.3.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-03-29 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: halite