poise-service 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -4
- data/.travis.yml +21 -12
- data/.yardopts +2 -1
- data/.yo-rc.json +8 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +2 -2
- data/README.md +34 -0
- data/lib/poise_service/service_providers/base.rb +2 -0
- data/lib/poise_service/service_providers/dummy.rb +65 -26
- data/lib/poise_service/service_providers/systemd.rb +2 -2
- data/lib/poise_service/service_providers/upstart.rb +10 -2
- data/lib/poise_service/version.rb +1 -1
- data/poise-service.gemspec +3 -1
- data/test/gemfiles/chef-12.gemfile +1 -1
- data/test/gemfiles/chef-13.gemfile +19 -0
- data/test/gemfiles/master.gemfile +9 -5
- data/test/spec/resources/poise_service_user_spec.rb +4 -1
- data/test/spec/service_providers/base_spec.rb +20 -4
- metadata +29 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37677f101577b3c801076ce0f20ea825e5e8d81d
|
4
|
+
data.tar.gz: 7829d757e5dc5c59cb304ed301c91c58c36cddd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce81c9d02b0e1d80eeb3c3beed90aed95f05c8ce494bddebbf9c79a9a3de6610cd4358bc63f5fe613963e590a738a053e6886d366e5dc43e97ecde171c36b86e
|
7
|
+
data.tar.gz: 41f131e359368c7573d8ba4bff445d6c8b82c5b59d62cbd3e913566dff4dbef6d13900c7978b41b9683c180ae2bcf7fcde6add32393d9cfd9274e4fbb1dca9bc
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,18 +1,27 @@
|
|
1
1
|
sudo: false
|
2
2
|
cache: bundler
|
3
3
|
language: ruby
|
4
|
-
rvm:
|
5
|
-
- 2.3.1
|
6
4
|
env:
|
7
5
|
global:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
before_install:
|
13
|
-
|
6
|
+
- RACKSPACE_USERNAME=coderanger
|
7
|
+
- secure: XpFA4AwBW5v4o3IuwKVSCTeVr6jXsW13T6ShGPpru4q+W2Zpcwh1qyBbxkkIWlkNjbhAT7G0HzQOqYcvUssYLEUYUNSlN10hxjpTZxvVj5sGjjhS3iTXbSop0NXzQthNRHfVZeK9ZWc+zP1MHGImjGCkErkin1+vu/SwMfIl2/8=
|
8
|
+
- secure: k36byJyrxjPXKqMjlhojJJwA3iTgVcy1z8zJzUMf0v6JGLsbLbMLfOxkTwIhuLZ3mFEQHvv0TZ8rm84Mg8pYb95fChF2rZNHasRDDB5rFBd++HaYirSC0kndXpZ5gLBhSZXggDv8ROANgKwgWmI0PDDZz96rR/tPDD7edZIvgfc=
|
9
|
+
- secure: OZhgvnu2op+rxg6ECSYlWGwaD1xIyOhzQtxqwzA4F/59RiR667JWaSTAmdEDN6SKmrqphxmZatzDEVXLaidbzAC0yAVv7zt4JbkLLZwmLFpq0YL+128sjgI4iUXomJhLxFqZyl8xmDhbu2pZLVyIR0S5Y0VUnu4kTmKDpvBwYsA=
|
10
|
+
before_install:
|
11
|
+
- 'if [[ $BUNDLE_GEMFILE == *master.gemfile ]]; then gem update --system; fi'
|
12
|
+
- gem --version
|
13
|
+
- gem install bundler
|
14
|
+
- bundle --version
|
15
|
+
- 'bundle config --local path ${BUNDLE_PATH:-$(dirname $BUNDLE_GEMFILE)/vendor/bundle}'
|
16
|
+
- bundle config --local bin $PWD/bin
|
17
|
+
install: bundle update --jobs=3 --retry=3
|
14
18
|
script:
|
15
|
-
-
|
16
|
-
|
17
|
-
|
18
|
-
-
|
19
|
+
- ./bin/rake travis
|
20
|
+
matrix:
|
21
|
+
include:
|
22
|
+
- rvm: 2.3.1
|
23
|
+
gemfile: test/gemfiles/chef-12.gemfile
|
24
|
+
- rvm: 2.4.1
|
25
|
+
gemfile: test/gemfiles/chef-13.gemfile
|
26
|
+
- rvm: 2.4.1
|
27
|
+
gemfile: test/gemfiles/master.gemfile
|
data/.yardopts
CHANGED
data/.yo-rc.json
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Poise-Service Changelog
|
2
2
|
|
3
|
+
## v1.5.0
|
4
|
+
|
5
|
+
* Added `never_start` and `never_stop` provider options to prevent Chef from starting
|
6
|
+
or stopping a service.
|
7
|
+
* Automatically reload systemd when removing a service if auto_reload is enabled.
|
8
|
+
* Improved dummy provider, records process output to `/var/run/service_name.out`
|
9
|
+
and a `restart_delay` provider option to the dummy provider to wait between
|
10
|
+
stopping and starting.
|
11
|
+
|
3
12
|
## v1.4.2
|
4
13
|
|
5
14
|
* Fix the `noterm` test service to work on Ruby 2.3.
|
data/Gemfile
CHANGED
@@ -23,11 +23,11 @@ def dev_gem(name, path: File.join('..', name), github: nil)
|
|
23
23
|
if File.exist?(path)
|
24
24
|
gem name, path: path
|
25
25
|
elsif github
|
26
|
-
gem name,
|
26
|
+
gem name, git: "https://github.com/#{github}.git"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
dev_gem 'halite'
|
31
31
|
dev_gem 'poise'
|
32
|
-
dev_gem 'poise-boiler'
|
32
|
+
dev_gem 'poise-boiler'
|
33
33
|
dev_gem 'poise-profiler'
|
data/README.md
CHANGED
@@ -256,6 +256,8 @@ process creating a PID file in the given path.
|
|
256
256
|
* `reload_signal` – Override the service reload signal.
|
257
257
|
* `stop_signal` – Override the service stop signal.
|
258
258
|
* `user` – Override the service user.
|
259
|
+
* `never_start` – Never try to start the service.
|
260
|
+
* `never_stop` – Never try to stop the service.
|
259
261
|
* `never_restart` – Never try to restart the service.
|
260
262
|
* `never_reload` – Never try to reload the service.
|
261
263
|
* `script_path` – Override the path to the generated service script.
|
@@ -294,6 +296,8 @@ default and will throw an error if a reload signal other than SIGHUP is used.
|
|
294
296
|
* `reload_signal` – Override the service reload signal.
|
295
297
|
* `stop_signal` – Override the service stop signal.
|
296
298
|
* `user` – Override the service user.
|
299
|
+
* `never_start` – Never try to start the service.
|
300
|
+
* `never_stop` – Never try to stop the service.
|
297
301
|
* `never_restart` – Never try to restart the service.
|
298
302
|
* `never_reload` – Never try to reload the service.
|
299
303
|
|
@@ -320,6 +324,8 @@ end
|
|
320
324
|
* `reload_signal` – Override the service reload signal.
|
321
325
|
* `stop_signal` – Override the service stop signal.
|
322
326
|
* `user` – Override the service user.
|
327
|
+
* `never_start` – Never try to start the service.
|
328
|
+
* `never_stop` – Never try to stop the service.
|
323
329
|
* `never_restart` – Never try to restart the service.
|
324
330
|
* `never_reload` – Never try to reload the service.
|
325
331
|
* `auto_reload` – Run `systemctl daemon-reload` after changes to the unit file. *(default: true)*
|
@@ -343,6 +349,8 @@ as they are enabled.
|
|
343
349
|
|
344
350
|
#### Options
|
345
351
|
|
352
|
+
* `never_start` – Never try to start the service.
|
353
|
+
* `never_stop` – Never try to stop the service.
|
346
354
|
* `never_restart` – Never try to restart the service.
|
347
355
|
* `never_reload` – Never try to reload the service.
|
348
356
|
* `pid_file` – Path to PID file that the service command will create.
|
@@ -350,6 +358,32 @@ as they are enabled.
|
|
350
358
|
auto-generated hash based on the service name. If these collide, bad things
|
351
359
|
happen. Don't do that.
|
352
360
|
|
361
|
+
### `dummy`
|
362
|
+
|
363
|
+
The `dummy` provider supports launching services directly from Chef itself.
|
364
|
+
This is for testing purposes only and is entirely unsuitable for use in
|
365
|
+
production. This is mostly useful when used alongside kitchen-docker.
|
366
|
+
|
367
|
+
```ruby
|
368
|
+
poise_service 'myapp' do
|
369
|
+
provider :dummy
|
370
|
+
command 'myapp --serve'
|
371
|
+
end
|
372
|
+
```
|
373
|
+
|
374
|
+
The service information is written to `/var/run`. The PID file is `service_name.pid`,
|
375
|
+
the command output is `service_name.out`, and the service parameters are in
|
376
|
+
`service_name.json`.
|
377
|
+
|
378
|
+
#### Options
|
379
|
+
|
380
|
+
* `never_start` – Never try to start the service.
|
381
|
+
* `never_stop` – Never try to stop the service.
|
382
|
+
* `never_restart` – Never try to restart the service.
|
383
|
+
* `never_reload` – Never try to reload the service.
|
384
|
+
* `restart_delay` – Number of seconds to wait between stop and start when
|
385
|
+
restarting. *(default: 1)*
|
386
|
+
|
353
387
|
## ServiceMixin
|
354
388
|
|
355
389
|
For the common case of a resource (LWRP or plain Ruby) that roughly maps to
|
@@ -70,12 +70,14 @@ module PoiseService
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def action_start
|
73
|
+
return if options['never_start']
|
73
74
|
notify_if_service do
|
74
75
|
service_resource.run_action(:start)
|
75
76
|
end
|
76
77
|
end
|
77
78
|
|
78
79
|
def action_stop
|
80
|
+
return if options['never_stop']
|
79
81
|
notify_if_service do
|
80
82
|
service_resource.run_action(:stop)
|
81
83
|
end
|
@@ -25,7 +25,16 @@ module PoiseService
|
|
25
25
|
class Dummy < Base
|
26
26
|
provides(:dummy)
|
27
27
|
|
28
|
+
# @api private
|
29
|
+
def self.default_inversion_options(node, resource)
|
30
|
+
super.merge({
|
31
|
+
# Time to wait between stop and start.
|
32
|
+
restart_delay: 1,
|
33
|
+
})
|
34
|
+
end
|
35
|
+
|
28
36
|
def action_start
|
37
|
+
return if options['never_start']
|
29
38
|
return if pid
|
30
39
|
Chef::Log.debug("[#{new_resource}] Starting #{new_resource.command}")
|
31
40
|
# Clear the pid file if it exists.
|
@@ -45,39 +54,62 @@ module PoiseService
|
|
45
54
|
end
|
46
55
|
else
|
47
56
|
# :nocov:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
begin
|
58
|
+
Chef::Log.debug("[#{new_resource}] Forked")
|
59
|
+
# First child, daemonize and go to town. This handles multi-fork,
|
60
|
+
# setsid, and shutting down stdin/out/err.
|
61
|
+
Process.daemon(true)
|
62
|
+
Chef::Log.debug("[#{new_resource}] Daemonized")
|
63
|
+
# Daemonized, set up process environment.
|
64
|
+
Dir.chdir(new_resource.directory)
|
65
|
+
Chef::Log.debug("[#{new_resource}] Directory changed to #{new_resource.directory}")
|
66
|
+
ENV['HOME'] = Dir.home(new_resource.user)
|
67
|
+
new_resource.environment.each do |key, val|
|
68
|
+
ENV[key.to_s] = val.to_s
|
69
|
+
end
|
70
|
+
Chef::Log.debug("[#{new_resource}] Process environment configured")
|
71
|
+
# Make sure to open the output file and write the pid file before we
|
72
|
+
# drop privs.
|
73
|
+
output = ::File.open(output_file, 'ab')
|
74
|
+
IO.write(pid_file, Process.pid)
|
75
|
+
Chef::Log.debug("[#{new_resource}] PID #{Process.pid} written to #{pid_file}")
|
76
|
+
ent = Etc.getpwnam(new_resource.user)
|
77
|
+
if Process.euid != ent.uid || Process.egid != ent.gid
|
78
|
+
Process.initgroups(ent.name, ent.gid)
|
79
|
+
Process::GID.change_privilege(ent.gid) if Process.egid != ent.gid
|
80
|
+
Process::UID.change_privilege(ent.uid) if Process.euid != ent.uid
|
81
|
+
Chef::Log.debug("[#{new_resource}] Changed privs to #{new_resource.user} (#{ent.uid}:#{ent.gid})")
|
82
|
+
end
|
83
|
+
# Log the command. Happens before ouput redirect or this ends up in the file.
|
84
|
+
Chef::Log.debug("[#{new_resource}] Execing #{new_resource.command}")
|
85
|
+
# Set up output logging.
|
86
|
+
Chef::Log.debug("[#{new_resource}] Logging output to #{output_file}")
|
87
|
+
$stdout.reopen(output)
|
88
|
+
$stdout.sync = true
|
89
|
+
$stderr.reopen(output)
|
90
|
+
$stderr.sync = true
|
91
|
+
$stdout.write("#{Time.now} Starting #{new_resource.command}")
|
92
|
+
# Split the command so we don't get an extra sh -c.
|
93
|
+
Kernel.exec(*Shellwords.split(new_resource.command))
|
94
|
+
# Just in case, bail out.
|
95
|
+
$stdout.reopen(STDOUT)
|
96
|
+
$stderr.reopen(STDERR)
|
97
|
+
Chef::Log.debug("[#{new_resource}] Exec failed, bailing out.")
|
98
|
+
exit!
|
99
|
+
rescue Exception => e
|
100
|
+
# Welp, we tried.
|
101
|
+
$stdout.reopen(STDOUT)
|
102
|
+
$stderr.reopen(STDERR)
|
103
|
+
Chef::Log.error("[#{new_resource}] Error during process spawn: #{e}")
|
104
|
+
exit!
|
68
105
|
end
|
69
|
-
Chef::Log.debug("[#{new_resource}] Changed privs to #{new_resource.user} (#{ent.uid}:#{ent.gid})")
|
70
|
-
# Split the command so we don't get an extra sh -c.
|
71
|
-
Chef::Log.debug("[#{new_resource}] Execing #{new_resource.command}")
|
72
|
-
Kernel.exec(*Shellwords.split(new_resource.command))
|
73
|
-
# Just in case, bail out.
|
74
|
-
exit!
|
75
106
|
# :nocov:
|
76
107
|
end
|
77
108
|
Chef::Log.debug("[#{new_resource}] Started.")
|
78
109
|
end
|
79
110
|
|
80
111
|
def action_stop
|
112
|
+
return if options['never_stop']
|
81
113
|
return unless pid
|
82
114
|
Chef::Log.debug("[#{new_resource}] Stopping with #{new_resource.stop_signal}. Current PID is #{pid.inspect}.")
|
83
115
|
Process.kill(new_resource.stop_signal, pid)
|
@@ -87,6 +119,8 @@ module PoiseService
|
|
87
119
|
def action_restart
|
88
120
|
return if options['never_restart']
|
89
121
|
action_stop
|
122
|
+
# Give things a moment to stop before we try starting again.
|
123
|
+
sleep(options['restart_delay'])
|
90
124
|
action_start
|
91
125
|
end
|
92
126
|
|
@@ -151,6 +185,11 @@ module PoiseService
|
|
151
185
|
"/var/run/#{new_resource.service_name}.pid"
|
152
186
|
end
|
153
187
|
|
188
|
+
# Path to the output file.
|
189
|
+
def output_file
|
190
|
+
"/var/run/#{new_resource.service_name}.out"
|
191
|
+
end
|
192
|
+
|
154
193
|
end
|
155
194
|
end
|
156
195
|
end
|
@@ -27,8 +27,6 @@ module PoiseService
|
|
27
27
|
|
28
28
|
# @api private
|
29
29
|
def self.provides_auto?(node, resource)
|
30
|
-
# Don't allow systemd under docker, it won't work in most cases.
|
31
|
-
return false if node['virtualization'] && %w{docker lxc}.include?(node['virtualization']['system'])
|
32
30
|
service_resource_hints.include?(:systemd)
|
33
31
|
end
|
34
32
|
|
@@ -75,8 +73,10 @@ module PoiseService
|
|
75
73
|
end
|
76
74
|
|
77
75
|
def destroy_service
|
76
|
+
reloader = systemctl_daemon_reload
|
78
77
|
file "/etc/systemd/system/#{new_resource.service_name}.service" do
|
79
78
|
action :delete
|
79
|
+
notifies :run, reloader, :immediately if options['auto_reload']
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -30,11 +30,17 @@ module PoiseService
|
|
30
30
|
provides(:upstart)
|
31
31
|
|
32
32
|
def self.provides_auto?(node, resource)
|
33
|
-
# Don't allow upstart under docker, it won't work.
|
34
|
-
return false if node['virtualization'] && %w{docker lxc}.include?(node['virtualization']['system'])
|
35
33
|
service_resource_hints.include?(:upstart)
|
36
34
|
end
|
37
35
|
|
36
|
+
# @api private
|
37
|
+
def self.default_inversion_options(node, resource)
|
38
|
+
super.merge({
|
39
|
+
# Time to wait between stop and start.
|
40
|
+
restart_delay: 1,
|
41
|
+
})
|
42
|
+
end
|
43
|
+
|
38
44
|
# True restart in Upstart preserves the original config data, we want the
|
39
45
|
# more obvious behavior like everything else in the world that restart
|
40
46
|
# would re-read the updated config file. Use stop+start to get this
|
@@ -42,6 +48,8 @@ module PoiseService
|
|
42
48
|
def action_restart
|
43
49
|
return if options['never_restart']
|
44
50
|
action_stop
|
51
|
+
# Give things a moment to stop before we try starting again.
|
52
|
+
sleep(options['restart_delay'])
|
45
53
|
action_start
|
46
54
|
end
|
47
55
|
|
data/poise-service.gemspec
CHANGED
@@ -26,13 +26,15 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.description = "A Chef cookbook for managing system services."
|
27
27
|
spec.summary = spec.description
|
28
28
|
spec.homepage = 'https://github.com/poise/poise-service'
|
29
|
-
spec.license = 'Apache
|
29
|
+
spec.license = 'Apache-2.0'
|
30
|
+
spec.metadata['platforms'] = 'ubuntu debian centos redhat fedora amazon suse opensuse'
|
30
31
|
|
31
32
|
spec.files = `git ls-files`.split($/)
|
32
33
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
33
34
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
34
35
|
spec.require_paths = %w{lib}
|
35
36
|
|
37
|
+
spec.add_dependency 'chef', '>= 12', '< 14'
|
36
38
|
spec.add_dependency 'halite', '~> 1.0'
|
37
39
|
spec.add_dependency 'poise', '~> 2.0'
|
38
40
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, 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
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 13.0'
|
@@ -16,8 +16,12 @@
|
|
16
16
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
|
-
gem 'chef',
|
20
|
-
gem '
|
21
|
-
gem '
|
22
|
-
|
23
|
-
gem '
|
19
|
+
gem 'chef', git: 'https://github.com/chef/chef.git'
|
20
|
+
gem 'chefspec', git: 'https://github.com/sethvargo/chefspec.git'
|
21
|
+
gem 'fauxhai', git: 'https://github.com/customink/fauxhai.git'
|
22
|
+
gem 'foodcritic', git: 'https://github.com/foodcritic/foodcritic.git'
|
23
|
+
gem 'halite', git: 'https://github.com/poise/halite.git'
|
24
|
+
gem 'ohai', git: 'https://github.com/chef/ohai.git'
|
25
|
+
gem 'poise', git: 'https://github.com/poise/poise.git'
|
26
|
+
gem 'poise-boiler', git: 'https://github.com/poise/poise-boiler.git'
|
27
|
+
gem 'poise-profiler', git: 'https://github.com/poise/poise-profiler.git'
|
@@ -23,7 +23,10 @@ describe PoiseService::Resources::PoiseServiceUser do
|
|
23
23
|
let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} }
|
24
24
|
let(:shells) { [] }
|
25
25
|
before do
|
26
|
-
allow(File).to receive(:exist?)
|
26
|
+
allow(File).to receive(:exist?).and_call_original
|
27
|
+
described_class::DEFAULT_SHELLS.each do |shell|
|
28
|
+
allow(File).to receive(:exist?).with(shell).and_return(shells.include?(shell))
|
29
|
+
end
|
27
30
|
end
|
28
31
|
recipe do
|
29
32
|
poise_service_user 'poise'
|
@@ -57,6 +57,14 @@ describe PoiseService::ServiceProviders::Base do
|
|
57
57
|
expect(service_resource).to receive(:run_action).with(:start).ordered
|
58
58
|
subject.action_start
|
59
59
|
end
|
60
|
+
|
61
|
+
context 'with never_start' do
|
62
|
+
before { options['never_start'] = true }
|
63
|
+
it do
|
64
|
+
expect(service_resource).to_not receive(:run_action).with(:start).ordered
|
65
|
+
subject.action_start
|
66
|
+
end
|
67
|
+
end # /context with never_start
|
60
68
|
end # /describe #action_start
|
61
69
|
|
62
70
|
describe '#action_stop' do
|
@@ -64,6 +72,14 @@ describe PoiseService::ServiceProviders::Base do
|
|
64
72
|
expect(service_resource).to receive(:run_action).with(:stop).ordered
|
65
73
|
subject.action_stop
|
66
74
|
end
|
75
|
+
|
76
|
+
context 'with never_stop' do
|
77
|
+
before { options['never_stop'] = true }
|
78
|
+
it do
|
79
|
+
expect(service_resource).to_not receive(:run_action).with(:stop).ordered
|
80
|
+
subject.action_stop
|
81
|
+
end
|
82
|
+
end # /context with never_stop
|
67
83
|
end # /describe #action_stop
|
68
84
|
|
69
85
|
describe '#action_restart' do
|
@@ -185,7 +201,7 @@ describe PoiseService::ServiceProviders::Base do
|
|
185
201
|
end
|
186
202
|
end
|
187
203
|
|
188
|
-
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy'}) }
|
204
|
+
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy', 'restart_delay' => 1}) }
|
189
205
|
end # /context with an options resource
|
190
206
|
|
191
207
|
context 'with an options resource using service_name' do
|
@@ -199,7 +215,7 @@ describe PoiseService::ServiceProviders::Base do
|
|
199
215
|
end
|
200
216
|
end
|
201
217
|
|
202
|
-
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy'}) }
|
218
|
+
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy', 'restart_delay' => 1}) }
|
203
219
|
end # /context with an options resource using service_name
|
204
220
|
|
205
221
|
context 'with node attributes' do
|
@@ -212,7 +228,7 @@ describe PoiseService::ServiceProviders::Base do
|
|
212
228
|
end
|
213
229
|
end
|
214
230
|
|
215
|
-
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy'}) }
|
231
|
+
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy', 'restart_delay' => 1}) }
|
216
232
|
end # /context with node attributes
|
217
233
|
|
218
234
|
context 'with node attributes using service_name' do
|
@@ -225,7 +241,7 @@ describe PoiseService::ServiceProviders::Base do
|
|
225
241
|
end
|
226
242
|
end
|
227
243
|
|
228
|
-
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy'}) }
|
244
|
+
it { is_expected.to eq({'command' => 'myapp', 'provider' => 'dummy', 'restart_delay' => 1}) }
|
229
245
|
end # /context with node attributes using service_name
|
230
246
|
end # /describe #options
|
231
247
|
end
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poise-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.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:
|
11
|
+
date: 2017-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: chef
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '12'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '14'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '12'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '14'
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: halite
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,6 +97,7 @@ files:
|
|
77
97
|
- ".kitchen.yml"
|
78
98
|
- ".travis.yml"
|
79
99
|
- ".yardopts"
|
100
|
+
- ".yo-rc.json"
|
80
101
|
- CHANGELOG.md
|
81
102
|
- Gemfile
|
82
103
|
- LICENSE
|
@@ -112,6 +133,7 @@ files:
|
|
112
133
|
- test/cookbook/recipes/mixin.rb
|
113
134
|
- test/cookbook/resources/mixin.rb
|
114
135
|
- test/gemfiles/chef-12.gemfile
|
136
|
+
- test/gemfiles/chef-13.gemfile
|
115
137
|
- test/gemfiles/master.gemfile
|
116
138
|
- test/integration/default/serverspec/Gemfile
|
117
139
|
- test/integration/default/serverspec/default_spec.rb
|
@@ -129,8 +151,9 @@ files:
|
|
129
151
|
- test/spec/utils_spec.rb
|
130
152
|
homepage: https://github.com/poise/poise-service
|
131
153
|
licenses:
|
132
|
-
- Apache
|
133
|
-
metadata:
|
154
|
+
- Apache-2.0
|
155
|
+
metadata:
|
156
|
+
platforms: ubuntu debian centos redhat fedora amazon suse opensuse
|
134
157
|
post_install_message:
|
135
158
|
rdoc_options: []
|
136
159
|
require_paths:
|
@@ -147,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
170
|
version: '0'
|
148
171
|
requirements: []
|
149
172
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.6.
|
173
|
+
rubygems_version: 2.6.11
|
151
174
|
signing_key:
|
152
175
|
specification_version: 4
|
153
176
|
summary: A Chef cookbook for managing system services.
|
@@ -158,6 +181,7 @@ test_files:
|
|
158
181
|
- test/cookbook/recipes/mixin.rb
|
159
182
|
- test/cookbook/resources/mixin.rb
|
160
183
|
- test/gemfiles/chef-12.gemfile
|
184
|
+
- test/gemfiles/chef-13.gemfile
|
161
185
|
- test/gemfiles/master.gemfile
|
162
186
|
- test/integration/default/serverspec/Gemfile
|
163
187
|
- test/integration/default/serverspec/default_spec.rb
|