chef 16.0.287 → 16.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +2 -2
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +7 -7
- data/lib/chef/provider/launchd.rb +11 -9
- data/lib/chef/provider/package/cab.rb +1 -1
- data/lib/chef/provider/powershell_script.rb +1 -1
- data/lib/chef/provider/service/macosx.rb +9 -0
- data/lib/chef/resource/windows_security_policy.rb +29 -0
- data/lib/chef/resource/windows_user_privilege.rb +42 -0
- data/lib/chef/version.rb +1 -1
- data/spec/functional/resource/launchd_spec.rb +232 -0
- data/spec/unit/provider/launchd_spec.rb +0 -42
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b138b7c33a13cb8016b0883638027a663dfd9a69b581b762905186accbf26583
|
4
|
+
data.tar.gz: 718b25c47f4adb5761c915a7445a3b450f062f5f79ee3eaa8d6c5f165bf077c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12485669d051d24c96a784f753d6c85a9a7b7afed6cdcf218c8dda31dc99133c26ee4e315c51f47d5868688ec3c8955eafa7e1c7fa2e63cceac370d146a41002
|
7
|
+
data.tar.gz: 85a441f6ae29db6e725621182fef6e9e4fd69f6393457bfaeb4a928212e2dcb09a8e6be54808c21282fdc8dd35bd0c6c50dbfa8e1562b73fbba70f1a551ab264
|
@@ -46,7 +46,7 @@ class Chef
|
|
46
46
|
when Chef::Exceptions::PrivateKeyMissing
|
47
47
|
error_description.section("Private Key Not Found:", <<~E)
|
48
48
|
Your private key could not be loaded. If the key file exists, ensure that it is
|
49
|
-
readable by #{Chef::Dist::
|
49
|
+
readable by #{Chef::Dist::PRODUCT}.
|
50
50
|
E
|
51
51
|
error_description.section("Relevant Config Settings:", <<~E)
|
52
52
|
client_key "#{api_key}"
|
@@ -99,7 +99,7 @@ class Chef
|
|
99
99
|
# redirect.
|
100
100
|
def describe_404_error(error_description)
|
101
101
|
error_description.section("Resource Not Found:", <<~E)
|
102
|
-
The
|
102
|
+
The #{Chef::Dist::SERVER_PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
|
103
103
|
E
|
104
104
|
error_description.section("Relevant Config Settings:", <<~E)
|
105
105
|
chef_server_url "#{server_url}"
|
@@ -28,7 +28,7 @@ class Chef
|
|
28
28
|
humanize_http_exception(error_description)
|
29
29
|
when Errno::ECONNREFUSED, Timeout::Error, Errno::ETIMEDOUT, SocketError
|
30
30
|
error_description.section("Network Error:", <<~E)
|
31
|
-
There was a network error connecting to the Chef
|
31
|
+
There was a network error connecting to the #{Chef::Dist::SERVER_PRODUCT}:
|
32
32
|
#{exception.message}
|
33
33
|
E
|
34
34
|
error_description.section("Relevant Config Settings:", <<~E)
|
@@ -39,14 +39,14 @@ class Chef
|
|
39
39
|
when Chef::Exceptions::PrivateKeyMissing
|
40
40
|
error_description.section("Private Key Not Found:", <<~E)
|
41
41
|
Your private key could not be loaded. If the key file exists, ensure that it is
|
42
|
-
readable by #{Chef::Dist::
|
42
|
+
readable by #{Chef::Dist::PRODUCT}.
|
43
43
|
E
|
44
44
|
error_description.section("Relevant Config Settings:", <<~E)
|
45
45
|
validation_key "#{api_key}"
|
46
46
|
E
|
47
47
|
when Chef::Exceptions::InvalidRedirect
|
48
48
|
error_description.section("Invalid Redirect:", <<~E)
|
49
|
-
Change your
|
49
|
+
Change your #{Chef::Dist::SERVER_PRODUCT} location in client.rb to the #{Chef::Dist::SERVER_PRODUCT}'s FQDN to avoid unwanted redirections.
|
50
50
|
E
|
51
51
|
when EOFError
|
52
52
|
describe_eof_error(error_description)
|
@@ -61,13 +61,13 @@ class Chef
|
|
61
61
|
when Net::HTTPUnauthorized
|
62
62
|
if clock_skew?
|
63
63
|
error_description.section("Authentication Error:", <<~E)
|
64
|
-
Failed to authenticate to the
|
64
|
+
Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
|
65
65
|
The request failed because your clock has drifted by more than 15 minutes.
|
66
66
|
Syncing your clock to an NTP Time source should resolve the issue.
|
67
67
|
E
|
68
68
|
else
|
69
69
|
error_description.section("Authentication Error:", <<~E)
|
70
|
-
Failed to authenticate to the
|
70
|
+
Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
|
71
71
|
E
|
72
72
|
|
73
73
|
error_description.section("Server Response:", format_rest_error)
|
@@ -81,7 +81,7 @@ class Chef
|
|
81
81
|
end
|
82
82
|
when Net::HTTPForbidden
|
83
83
|
error_description.section("Authorization Error:", <<~E)
|
84
|
-
Your validation client is not authorized to create the client for this node (HTTP 403).
|
84
|
+
Your validation client is not authorized to create the client for this node on the #{Chef::Dist::SERVER_PRODUCT} (HTTP 403).
|
85
85
|
E
|
86
86
|
error_description.section("Possible Causes:", <<~E)
|
87
87
|
* There may already be a client named "#{config[:node_name]}"
|
@@ -94,7 +94,7 @@ class Chef
|
|
94
94
|
error_description.section("Server Response:", format_rest_error)
|
95
95
|
when Net::HTTPNotFound
|
96
96
|
error_description.section("Resource Not Found:", <<~E)
|
97
|
-
The
|
97
|
+
The #{Chef::Dist::SERVER_PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url configuration is incorrect.
|
98
98
|
E
|
99
99
|
error_description.section("Relevant Config Settings:", <<~E)
|
100
100
|
chef_server_url "#{server_url}"
|
@@ -62,23 +62,23 @@ class Chef
|
|
62
62
|
end
|
63
63
|
|
64
64
|
action :delete do
|
65
|
-
|
66
|
-
# the service will be in memory and you wont be able to stop it.
|
67
|
-
if ::File.exists?(@path)
|
65
|
+
if ::File.exists?(path)
|
68
66
|
manage_service(:disable)
|
69
67
|
end
|
70
68
|
manage_plist(:delete)
|
71
69
|
end
|
72
70
|
|
73
71
|
action :enable do
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
manage_service(:enable)
|
72
|
+
manage_service(:nothing)
|
73
|
+
manage_plist(:create) do
|
74
|
+
notifies :restart, "macosx_service[#{label}]", :immediately
|
78
75
|
end
|
76
|
+
manage_service(:enable)
|
79
77
|
end
|
80
78
|
|
81
79
|
action :disable do
|
80
|
+
return unless ::File.exist?(path)
|
81
|
+
|
82
82
|
manage_service(:disable)
|
83
83
|
end
|
84
84
|
|
@@ -86,13 +86,14 @@ class Chef
|
|
86
86
|
manage_service(:restart)
|
87
87
|
end
|
88
88
|
|
89
|
-
def manage_plist(action)
|
89
|
+
def manage_plist(action, &block)
|
90
90
|
if source
|
91
91
|
cookbook_file path do
|
92
92
|
cookbook_name = new_resource.cookbook if new_resource.cookbook
|
93
93
|
copy_properties_from(new_resource, :backup, :group, :mode, :owner, :source)
|
94
94
|
action(action)
|
95
95
|
only_if { manage_agent?(action) }
|
96
|
+
instance_eval(&block) if block_given?
|
96
97
|
end
|
97
98
|
else
|
98
99
|
file path do
|
@@ -100,6 +101,7 @@ class Chef
|
|
100
101
|
content(file_content) if file_content?
|
101
102
|
action(action)
|
102
103
|
only_if { manage_agent?(action) }
|
104
|
+
instance_eval(&block) if block_given?
|
103
105
|
end
|
104
106
|
end
|
105
107
|
end
|
@@ -207,7 +209,7 @@ class Chef
|
|
207
209
|
|
208
210
|
# @api private
|
209
211
|
def path
|
210
|
-
@path
|
212
|
+
@path ||= new_resource.path ? new_resource.path : gen_path_from_type
|
211
213
|
end
|
212
214
|
end
|
213
215
|
end
|
@@ -74,7 +74,7 @@ class Chef
|
|
74
74
|
|
75
75
|
def dism_command(command)
|
76
76
|
with_os_architecture(nil) do
|
77
|
-
result = shell_out("dism.exe /Online /English #{command} /NoRestart",
|
77
|
+
result = shell_out("dism.exe /Online /English #{command} /NoRestart", timeout: new_resource.timeout)
|
78
78
|
if result.exitstatus == -2146498530
|
79
79
|
raise Chef::Exceptions::Package, "The specified package is not applicable to this image." if result.stdout.include?("0x800f081e")
|
80
80
|
|
@@ -94,7 +94,7 @@ class Chef
|
|
94
94
|
# means a non-zero return and thus a syntactically invalid script.
|
95
95
|
|
96
96
|
with_os_architecture(node, architecture: new_resource.architecture) do
|
97
|
-
shell_out!(validation_command,
|
97
|
+
shell_out!(validation_command, returns: [0])
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
@@ -142,6 +142,15 @@ class Chef
|
|
142
142
|
#
|
143
143
|
# This makes some sense on macOS since launchctl is an "init"-style
|
144
144
|
# supervisor that will restart daemons that are crashing, etc.
|
145
|
+
#
|
146
|
+
# FIXME: Does this make any sense at all? The difference between enabled and
|
147
|
+
# running as state would seem to only be useful for completely broken
|
148
|
+
# services (enabled, not restarting, but not running => totally broken?).
|
149
|
+
#
|
150
|
+
# It seems like otherwise :enable is equivalent to :start, and :disable is
|
151
|
+
# equivalent to :stop? But just with strangely different behavior in the
|
152
|
+
# face of a broken service?
|
153
|
+
#
|
145
154
|
def enable_service
|
146
155
|
if @current_resource.enabled
|
147
156
|
logger.trace("#{@new_resource} already enabled, not enabling")
|
@@ -43,6 +43,35 @@ class Chef
|
|
43
43
|
description "Use the **windows_security_policy** resource to set a security policy on the Microsoft Windows platform."
|
44
44
|
introduced "16.0"
|
45
45
|
|
46
|
+
examples <<~DOC
|
47
|
+
**Set Administrator Account to Enabled**:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
windows_security_policy 'EnableAdminAccount' do
|
51
|
+
secvalue '1'
|
52
|
+
action :set
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
**Rename Administrator Account**:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
windows_security_policy 'NewAdministratorName' do
|
60
|
+
secvalue 'AwesomeChefGuy'
|
61
|
+
action :set
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
**Set Guest Account to Disabled**:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
windows_security_policy 'EnableGuestAccount' do
|
69
|
+
secvalue '0'
|
70
|
+
action :set
|
71
|
+
end
|
72
|
+
```
|
73
|
+
DOC
|
74
|
+
|
46
75
|
property :secoption, String, name_property: true, required: true, equal_to: policy_names,
|
47
76
|
description: "The name of the policy to be set on windows platform to maintain its security."
|
48
77
|
|
@@ -72,6 +72,48 @@ class Chef
|
|
72
72
|
|
73
73
|
introduced "16.0"
|
74
74
|
|
75
|
+
examples <<~DOC
|
76
|
+
**Set the SeNetworkLogonRight Privilege for the Builtin Administrators Group and Authenticated Users**:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
windows_user_privilege 'Netowrk Logon Rights' do
|
80
|
+
privilege 'SeNetworkLogonRight'
|
81
|
+
users ['BUILTIN\Administrators', 'NT AUTHORITY\Authenticated Users']
|
82
|
+
action :set
|
83
|
+
end
|
84
|
+
```
|
85
|
+
|
86
|
+
**Add the SeDenyRemoteInteractiveLogonRight Privilege to the Builtin Guests and Local Accounts User Groups**:
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
windows_user_privilege 'Remote interactive logon' do
|
90
|
+
privilege 'SeDenyRemoteInteractiveLogonRight'
|
91
|
+
users ['Builtin\Guests', 'NT AUTHORITY\Local Account']
|
92
|
+
action :add
|
93
|
+
end
|
94
|
+
```
|
95
|
+
|
96
|
+
**Provide only the Builtin Guests and Administrator Groups with the SeCreatePageFile Privilege**:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
windows_user_privilege 'Create Pagefile' do
|
100
|
+
privilege 'SeCreatePagefilePrivilege'
|
101
|
+
users ['BUILTIN\Guests', 'BUILTIN\Administrators']
|
102
|
+
action :set
|
103
|
+
end
|
104
|
+
```
|
105
|
+
|
106
|
+
**Remove the SeCreatePageFile Privilege from the Builtin Guests Group**:
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
windows_user_privilege 'Create Pagefile' do
|
110
|
+
privilege 'SeCreatePagefilePrivilege'
|
111
|
+
users ['BUILTIN\Guests']
|
112
|
+
action :remove
|
113
|
+
end
|
114
|
+
```
|
115
|
+
DOC
|
116
|
+
|
75
117
|
property :principal, String,
|
76
118
|
description: "An optional property to add the user to the given privilege. Use only with add and remove action.",
|
77
119
|
name_property: true
|
data/lib/chef/version.rb
CHANGED
@@ -0,0 +1,232 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
require "spec_helper"
|
19
|
+
|
20
|
+
# Deploy relies heavily on symlinks, so it doesn't work on windows.
|
21
|
+
describe Chef::Resource::Launchd, :macos_only, requires_root: true do
|
22
|
+
include RecipeDSLHelper
|
23
|
+
|
24
|
+
before(:each) do
|
25
|
+
shell_out("launchctl unload -wF /Library/LaunchDaemons/io.chef.testing.fake.plist")
|
26
|
+
FileUtils.rm_f "/Library/LaunchDaemons/io.chef.testing.fake.plist"
|
27
|
+
end
|
28
|
+
|
29
|
+
after(:each) do
|
30
|
+
shell_out("launchctl unload -wF /Library/LaunchDaemons/io.chef.testing.fake.plist")
|
31
|
+
FileUtils.rm_f "/Library/LaunchDaemons/io.chef.testing.fake.plist"
|
32
|
+
end
|
33
|
+
|
34
|
+
context ":enable" do
|
35
|
+
it "enables a service" do
|
36
|
+
launchd "io.chef.testing.fake" do
|
37
|
+
program_arguments [
|
38
|
+
"/bin/sleep",
|
39
|
+
"60",
|
40
|
+
]
|
41
|
+
run_at_load true
|
42
|
+
type "daemon"
|
43
|
+
action :enable
|
44
|
+
end.should_be_updated
|
45
|
+
expect(File.exist?("/Library/LaunchDaemons/io.chef.testing.fake.plist")).to be true
|
46
|
+
expect(shell_out!("launchctl list io.chef.testing.fake").stdout).to match('"PID" = \d+')
|
47
|
+
expect(shell_out!("launchctl list io.chef.testing.fake").stdout).not_to match('"PID" = 0')
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should be idempotent" do
|
51
|
+
launchd "io.chef.testing.fake" do
|
52
|
+
program_arguments [
|
53
|
+
"/bin/sleep",
|
54
|
+
"60",
|
55
|
+
]
|
56
|
+
run_at_load true
|
57
|
+
type "daemon"
|
58
|
+
action :enable
|
59
|
+
end.should_be_updated
|
60
|
+
launchd "io.chef.testing.fake" do
|
61
|
+
program_arguments [
|
62
|
+
"/bin/sleep",
|
63
|
+
"60",
|
64
|
+
]
|
65
|
+
run_at_load true
|
66
|
+
type "daemon"
|
67
|
+
action :enable
|
68
|
+
end.should_not_be_updated
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context ":create" do
|
73
|
+
it "creates a service" do
|
74
|
+
launchd "io.chef.testing.fake" do
|
75
|
+
program_arguments [
|
76
|
+
"/bin/sleep",
|
77
|
+
"60",
|
78
|
+
]
|
79
|
+
run_at_load true
|
80
|
+
type "daemon"
|
81
|
+
action :create
|
82
|
+
end.should_be_updated
|
83
|
+
expect(File.exist?("/Library/LaunchDaemons/io.chef.testing.fake.plist")).to be true
|
84
|
+
expect(shell_out("launchctl list io.chef.testing.fake").exitstatus).not_to eql(0)
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should be idempotent" do
|
88
|
+
launchd "io.chef.testing.fake" do
|
89
|
+
program_arguments [
|
90
|
+
"/bin/sleep",
|
91
|
+
"60",
|
92
|
+
]
|
93
|
+
run_at_load true
|
94
|
+
type "daemon"
|
95
|
+
action :create
|
96
|
+
end.should_be_updated
|
97
|
+
launchd "io.chef.testing.fake" do
|
98
|
+
program_arguments [
|
99
|
+
"/bin/sleep",
|
100
|
+
"60",
|
101
|
+
]
|
102
|
+
run_at_load true
|
103
|
+
type "daemon"
|
104
|
+
action :create
|
105
|
+
end.should_not_be_updated
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
context ":create_if_missing" do
|
110
|
+
it "creates a service if it is missing" do
|
111
|
+
launchd "io.chef.testing.fake" do
|
112
|
+
program_arguments [
|
113
|
+
"/bin/sleep",
|
114
|
+
"60",
|
115
|
+
]
|
116
|
+
run_at_load true
|
117
|
+
type "daemon"
|
118
|
+
action :create_if_missing
|
119
|
+
end.should_be_updated
|
120
|
+
expect(File.exist?("/Library/LaunchDaemons/io.chef.testing.fake.plist")).to be true
|
121
|
+
expect(shell_out("launchctl list io.chef.testing.fake").exitstatus).not_to eql(0)
|
122
|
+
end
|
123
|
+
it "is idempotent" do
|
124
|
+
launchd "io.chef.testing.fake" do
|
125
|
+
program_arguments [
|
126
|
+
"/bin/sleep",
|
127
|
+
"60",
|
128
|
+
]
|
129
|
+
run_at_load true
|
130
|
+
type "daemon"
|
131
|
+
action :create_if_missing
|
132
|
+
end.should_be_updated
|
133
|
+
launchd "io.chef.testing.fake" do
|
134
|
+
program_arguments [
|
135
|
+
"/bin/sleep",
|
136
|
+
"60",
|
137
|
+
]
|
138
|
+
run_at_load true
|
139
|
+
type "daemon"
|
140
|
+
action :create_if_missing
|
141
|
+
end.should_not_be_updated
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context ":delete" do
|
146
|
+
it "deletes a service" do
|
147
|
+
launchd "io.chef.testing.fake" do
|
148
|
+
program_arguments [
|
149
|
+
"/bin/sleep",
|
150
|
+
"60",
|
151
|
+
]
|
152
|
+
run_at_load true
|
153
|
+
type "daemon"
|
154
|
+
action :enable
|
155
|
+
end
|
156
|
+
launchd "io.chef.testing.fake" do
|
157
|
+
type "daemon"
|
158
|
+
action :delete
|
159
|
+
end.should_be_updated
|
160
|
+
expect(File.exist?("/Library/LaunchDaemons/io.chef.testing.fake.plist")).to be false
|
161
|
+
expect(shell_out("launchctl list io.chef.testing.fake").exitstatus).not_to eql(0)
|
162
|
+
end
|
163
|
+
it "is idempotent" do
|
164
|
+
launchd "io.chef.testing.fake" do
|
165
|
+
program_arguments [
|
166
|
+
"/bin/sleep",
|
167
|
+
"60",
|
168
|
+
]
|
169
|
+
run_at_load true
|
170
|
+
type "daemon"
|
171
|
+
action :enable
|
172
|
+
end
|
173
|
+
launchd "io.chef.testing.fake" do
|
174
|
+
type "daemon"
|
175
|
+
action :delete
|
176
|
+
end.should_be_updated
|
177
|
+
launchd "io.chef.testing.fake" do
|
178
|
+
type "daemon"
|
179
|
+
action :delete
|
180
|
+
end.should_not_be_updated
|
181
|
+
end
|
182
|
+
it "works if the file does not exist" do
|
183
|
+
launchd "io.chef.testing.fake" do
|
184
|
+
type "daemon"
|
185
|
+
action :delete
|
186
|
+
end.should_not_be_updated
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
context ":disable" do
|
191
|
+
it "deletes a service" do
|
192
|
+
launchd "io.chef.testing.fake" do
|
193
|
+
program_arguments [
|
194
|
+
"/bin/sleep",
|
195
|
+
"1",
|
196
|
+
]
|
197
|
+
type "daemon"
|
198
|
+
action :enable
|
199
|
+
end
|
200
|
+
launchd "io.chef.testing.fake" do
|
201
|
+
type "daemon"
|
202
|
+
action :disable
|
203
|
+
end.should_be_updated
|
204
|
+
expect(File.exist?("/Library/LaunchDaemons/io.chef.testing.fake.plist")).to be true
|
205
|
+
expect(shell_out("launchctl list io.chef.testing.fake").exitstatus).not_to eql(0)
|
206
|
+
end
|
207
|
+
it "is idempotent" do
|
208
|
+
launchd "io.chef.testing.fake" do
|
209
|
+
program_arguments [
|
210
|
+
"/bin/sleep",
|
211
|
+
"1",
|
212
|
+
]
|
213
|
+
type "daemon"
|
214
|
+
action :enable
|
215
|
+
end
|
216
|
+
launchd "io.chef.testing.fake" do
|
217
|
+
type "daemon"
|
218
|
+
action :disable
|
219
|
+
end.should_be_updated
|
220
|
+
launchd "io.chef.testing.fake" do
|
221
|
+
type "daemon"
|
222
|
+
action :disable
|
223
|
+
end.should_not_be_updated
|
224
|
+
end
|
225
|
+
it "should work if the plist does not exist" do
|
226
|
+
launchd "io.chef.testing.fake" do
|
227
|
+
type "daemon"
|
228
|
+
action :disable
|
229
|
+
end.should_not_be_updated
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
@@ -194,48 +194,6 @@ describe Chef::Provider::Launchd do
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
-
describe "with an :enable action" do
|
198
|
-
describe "and the file has been updated" do
|
199
|
-
before(:each) do
|
200
|
-
allow(provider).to receive(
|
201
|
-
:manage_plist
|
202
|
-
).with(:create).and_return(true)
|
203
|
-
allow(provider).to receive(
|
204
|
-
:manage_service
|
205
|
-
).with(:restart).and_return(true)
|
206
|
-
end
|
207
|
-
|
208
|
-
it "should call manage_service with a :restart action" do
|
209
|
-
expect(provider.manage_service(:restart)).to be_truthy
|
210
|
-
end
|
211
|
-
|
212
|
-
it "works with action enable" do
|
213
|
-
expect(run_resource_setup_for_action(:enable)).to be_truthy
|
214
|
-
provider.action_enable
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
218
|
-
describe "and the file has not been updated" do
|
219
|
-
before(:each) do
|
220
|
-
allow(provider).to receive(
|
221
|
-
:manage_plist
|
222
|
-
).with(:create).and_return(nil)
|
223
|
-
allow(provider).to receive(
|
224
|
-
:manage_service
|
225
|
-
).with(:enable).and_return(true)
|
226
|
-
end
|
227
|
-
|
228
|
-
it "should call manage_service with a :enable action" do
|
229
|
-
expect(provider.manage_service(:enable)).to be_truthy
|
230
|
-
end
|
231
|
-
|
232
|
-
it "works with action enable" do
|
233
|
-
expect(run_resource_setup_for_action(:enable)).to be_truthy
|
234
|
-
provider.action_enable
|
235
|
-
end
|
236
|
-
end
|
237
|
-
end
|
238
|
-
|
239
197
|
describe "with an :delete action" do
|
240
198
|
describe "and the ld file is present" do
|
241
199
|
before(:each) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.0
|
4
|
+
version: 16.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 16.0
|
19
|
+
version: 16.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 16.0
|
26
|
+
version: 16.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: chef-utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 16.0
|
33
|
+
version: 16.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 16.0
|
40
|
+
version: 16.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: train-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1917,6 +1917,7 @@ files:
|
|
1917
1917
|
- spec/functional/resource/group_spec.rb
|
1918
1918
|
- spec/functional/resource/ifconfig_spec.rb
|
1919
1919
|
- spec/functional/resource/insserv_spec.rb
|
1920
|
+
- spec/functional/resource/launchd_spec.rb
|
1920
1921
|
- spec/functional/resource/link_spec.rb
|
1921
1922
|
- spec/functional/resource/locale_spec.rb
|
1922
1923
|
- spec/functional/resource/mount_spec.rb
|