chef-container 0.0.2.pre.dev2 → 0.0.2.pre.dev4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/container/version.rb +1 -1
- data/lib/chef/provider/service/container.rb +26 -0
- 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: 838894583d23c9ba150b4c3df093dcc49761cb13
|
4
|
+
data.tar.gz: 6da49bd76cac3a52cdbe4b1be447ee41bad80c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe20cb8e05149858b31e37ff2d8504932d6099f1e7fa6cfe247f8b8906567d0f76a4e4959bcdfc91ce1738f7220f417c5a85aa64b2813c9ba72b9fe0714bcf7
|
7
|
+
data.tar.gz: 6c307306a8912e068978c462590626e252c3ce1957628d4b738186efdcae5e788b787cd49d5a9d885434d9788caf0e47bba1f3ba3bca191020e1e84c04f4cac8
|
@@ -33,6 +33,23 @@ class Chef
|
|
33
33
|
super
|
34
34
|
end
|
35
35
|
|
36
|
+
def load_current_resource
|
37
|
+
@current_resource = Chef::Resource::RunitService.new(new_resource.name)
|
38
|
+
@current_resource.service_name(new_resource.service_name)
|
39
|
+
|
40
|
+
Chef::Log.debug("Checking status of service #{new_resource.service_name}")
|
41
|
+
|
42
|
+
# verify Runit was installed properly
|
43
|
+
unless ::File.exist?(Chef::Container::Runit::SV_BIN) && ::File.executable?(Chef::Container::Runit::SV_BIN)
|
44
|
+
no_runit_message = "Could not locate main runit sv_bin at \"#{Chef::Container::Runit::SV_BIN}\"."
|
45
|
+
fail no_runit_message
|
46
|
+
end
|
47
|
+
|
48
|
+
@current_resource.running(running?)
|
49
|
+
@current_resource.enabled(enabled?)
|
50
|
+
@current_resource
|
51
|
+
end
|
52
|
+
|
36
53
|
#
|
37
54
|
# Override Service Actions
|
38
55
|
#
|
@@ -77,6 +94,15 @@ class Chef
|
|
77
94
|
end
|
78
95
|
|
79
96
|
|
97
|
+
def running?
|
98
|
+
cmd = shell_out("#{Chef::Container::Runit::SV_BIN} status #{service_dir_name}")
|
99
|
+
(cmd.stdout =~ /^run:/ && cmd.exitstatus == 0)
|
100
|
+
end
|
101
|
+
|
102
|
+
def enabled?
|
103
|
+
::File.exists?(::File.join(service_dir_name, 'run'))
|
104
|
+
end
|
105
|
+
|
80
106
|
#
|
81
107
|
# Helper Resource Methods
|
82
108
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2.pre.
|
4
|
+
version: 0.0.2.pre.dev4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Duffield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|