poise-monit-compat 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.foodcritic +1 -0
  3. data/.gitignore +11 -0
  4. data/.kitchen.yml +8 -0
  5. data/.travis.yml +20 -0
  6. data/.yardopts +7 -0
  7. data/Berksfile +30 -0
  8. data/CHANGELOG.md +9 -0
  9. data/Gemfile +36 -0
  10. data/LICENSE +201 -0
  11. data/README.md +139 -0
  12. data/Rakefile +17 -0
  13. data/chef/attributes/default.rb +63 -0
  14. data/chef/recipes/default.rb +47 -0
  15. data/chef/recipes/postfix.rb +31 -0
  16. data/chef/recipes/postgresql.rb +32 -0
  17. data/chef/recipes/rabbitmq.rb +31 -0
  18. data/chef/recipes/resque.rb +25 -0
  19. data/chef/recipes/resque_scheduler.rb +30 -0
  20. data/chef/recipes/ssh.rb +30 -0
  21. data/chef/recipes/unicorn.rb +25 -0
  22. data/chef/templates/compat.conf.erb +43 -0
  23. data/chef/templates/resque.conf.erb +21 -0
  24. data/chef/templates/unicorn.conf.erb +17 -0
  25. data/lib/poise_monit_compat.rb +21 -0
  26. data/lib/poise_monit_compat/cheftie.rb +17 -0
  27. data/lib/poise_monit_compat/resources.rb +26 -0
  28. data/lib/poise_monit_compat/resources/monitrc.rb +95 -0
  29. data/lib/poise_monit_compat/version.rb +20 -0
  30. data/poise-monit-compat.gemspec +42 -0
  31. data/test/cookbooks/monit_test/attributes/default.rb +17 -0
  32. data/test/cookbooks/monit_test/metadata.rb +19 -0
  33. data/test/cookbooks/monit_test/recipes/default.rb +17 -0
  34. data/test/gemfiles/chef-12.gemfile +19 -0
  35. data/test/gemfiles/master.gemfile +25 -0
  36. data/test/integration/default/serverspec/default_spec.rb +37 -0
  37. data/test/spec/default_spec.rb +110 -0
  38. data/test/spec/monitrc_spec.rb +41 -0
  39. data/test/spec/postfix_spec.rb +24 -0
  40. data/test/spec/postgresql_spec.rb +24 -0
  41. data/test/spec/rabbitmq_spec.rb +24 -0
  42. data/test/spec/resque_scheduler_spec.rb +25 -0
  43. data/test/spec/resque_spec.rb +24 -0
  44. data/test/spec/spec_helper.rb +20 -0
  45. data/test/spec/ssh_spec.rb +24 -0
  46. data/test/spec/unicorn_spec.rb +24 -0
  47. metadata +167 -0
@@ -0,0 +1,41 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe PoiseMonitCompat::Resources::Monitrc do
20
+ step_into(:monitrc)
21
+
22
+ describe 'action :enable' do
23
+ recipe do
24
+ monit 'monit'
25
+ monitrc 'myapp'
26
+ end
27
+
28
+ it { is_expected.to create_monit_config('myapp').with(parent: chef_run.monit('monit'), cookbook: 'monit', source: 'myapp.conf.erb', variables: {}) }
29
+ end # /describe action :enable
30
+
31
+ describe 'action :disable' do
32
+ recipe do
33
+ monit 'monit'
34
+ monitrc 'myapp' do
35
+ action :disable
36
+ end
37
+ end
38
+
39
+ it { is_expected.to delete_monit_config('myapp').with(parent: chef_run.monit('monit')) }
40
+ end # /describe action :disable
41
+ end
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::postgresql' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::postgresql' }
22
+
23
+ it { is_expected.to render_file('/etc/monit/conf.d/postgresql.conf') }
24
+ end
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::postfix' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::postfix' }
22
+
23
+ it { is_expected.to render_file('/etc/monit/conf.d/postfix.conf') }
24
+ end
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::rabbitmq' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::rabbitmq' }
22
+
23
+ it { is_expected.to render_file('/etc/monit/conf.d/rabbitmq.conf') }
24
+ end
@@ -0,0 +1,25 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::resque_scheduler' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::resque_scheduler' }
22
+ before { override_attributes['monit'] = {resque: {app_root: '/app'}} }
23
+
24
+ it { is_expected.to render_file('/etc/monit/conf.d/resque_scheduler.conf') }
25
+ end
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::resque' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::resque' }
22
+
23
+ it { is_expected.to render_file('/etc/monit/conf.d/resque.conf') }
24
+ end
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'poise_boiler/spec_helper'
18
+ require 'poise_monit_compat'
19
+ require 'poise_monit/cheftie'
20
+ require 'poise_monit_compat/cheftie'
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::ssh' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::ssh' }
22
+
23
+ it { is_expected.to render_file('/etc/monit/conf.d/ssh.conf') }
24
+ end
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'monit::unicorn' do
20
+ step_into(:monit_config)
21
+ recipe { include_recipe 'monit::unicorn' }
22
+
23
+ it { is_expected.to render_file('/etc/monit/conf.d/unicorn.conf') }
24
+ end
metadata ADDED
@@ -0,0 +1,167 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: poise-monit-compat
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Noah Kantrowitz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: halite
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: poise
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: poise-monit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: poise-boiler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
69
+ description: A deprecated Chef cookbook for managing the Monit process manager.
70
+ email:
71
+ - noah@coderanger.net
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".foodcritic"
77
+ - ".gitignore"
78
+ - ".kitchen.yml"
79
+ - ".travis.yml"
80
+ - ".yardopts"
81
+ - Berksfile
82
+ - CHANGELOG.md
83
+ - Gemfile
84
+ - LICENSE
85
+ - README.md
86
+ - Rakefile
87
+ - chef/attributes/default.rb
88
+ - chef/recipes/default.rb
89
+ - chef/recipes/postfix.rb
90
+ - chef/recipes/postgresql.rb
91
+ - chef/recipes/rabbitmq.rb
92
+ - chef/recipes/resque.rb
93
+ - chef/recipes/resque_scheduler.rb
94
+ - chef/recipes/ssh.rb
95
+ - chef/recipes/unicorn.rb
96
+ - chef/templates/compat.conf.erb
97
+ - chef/templates/resque.conf.erb
98
+ - chef/templates/unicorn.conf.erb
99
+ - lib/poise_monit_compat.rb
100
+ - lib/poise_monit_compat/cheftie.rb
101
+ - lib/poise_monit_compat/resources.rb
102
+ - lib/poise_monit_compat/resources/monitrc.rb
103
+ - lib/poise_monit_compat/version.rb
104
+ - poise-monit-compat.gemspec
105
+ - test/cookbooks/monit_test/attributes/default.rb
106
+ - test/cookbooks/monit_test/metadata.rb
107
+ - test/cookbooks/monit_test/recipes/default.rb
108
+ - test/docker/docker.ca
109
+ - test/docker/docker.pem
110
+ - test/gemfiles/chef-12.gemfile
111
+ - test/gemfiles/master.gemfile
112
+ - test/integration/default/serverspec/default_spec.rb
113
+ - test/spec/default_spec.rb
114
+ - test/spec/monitrc_spec.rb
115
+ - test/spec/postfix_spec.rb
116
+ - test/spec/postgresql_spec.rb
117
+ - test/spec/rabbitmq_spec.rb
118
+ - test/spec/resque_scheduler_spec.rb
119
+ - test/spec/resque_spec.rb
120
+ - test/spec/spec_helper.rb
121
+ - test/spec/ssh_spec.rb
122
+ - test/spec/unicorn_spec.rb
123
+ homepage: https://github.com/poise/poise-monit-compat
124
+ licenses:
125
+ - Apache 2.0
126
+ metadata:
127
+ halite_name: monit
128
+ post_install_message:
129
+ rdoc_options: []
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ requirements: []
143
+ rubyforge_project:
144
+ rubygems_version: 2.4.8
145
+ signing_key:
146
+ specification_version: 4
147
+ summary: A deprecated Chef cookbook for managing the Monit process manager.
148
+ test_files:
149
+ - test/cookbooks/monit_test/attributes/default.rb
150
+ - test/cookbooks/monit_test/metadata.rb
151
+ - test/cookbooks/monit_test/recipes/default.rb
152
+ - test/docker/docker.ca
153
+ - test/docker/docker.pem
154
+ - test/gemfiles/chef-12.gemfile
155
+ - test/gemfiles/master.gemfile
156
+ - test/integration/default/serverspec/default_spec.rb
157
+ - test/spec/default_spec.rb
158
+ - test/spec/monitrc_spec.rb
159
+ - test/spec/postfix_spec.rb
160
+ - test/spec/postgresql_spec.rb
161
+ - test/spec/rabbitmq_spec.rb
162
+ - test/spec/resque_scheduler_spec.rb
163
+ - test/spec/resque_spec.rb
164
+ - test/spec/spec_helper.rb
165
+ - test/spec/ssh_spec.rb
166
+ - test/spec/unicorn_spec.rb
167
+ has_rdoc: