chef 14.7.17 → 14.8.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chef/mixin/which.rb +3 -1
  3. data/lib/chef/provider/apt_repository.rb +1 -1
  4. data/lib/chef/provider/execute.rb +1 -1
  5. data/lib/chef/provider/osx_profile.rb +1 -1
  6. data/lib/chef/provider/package/apt.rb +15 -3
  7. data/lib/chef/provider/package/cab.rb +6 -2
  8. data/lib/chef/provider/package/chocolatey.rb +1 -1
  9. data/lib/chef/provider/package/dnf/python_helper.rb +2 -1
  10. data/lib/chef/provider/package/openbsd.rb +1 -1
  11. data/lib/chef/provider/package/rubygems.rb +38 -16
  12. data/lib/chef/resource/apt_package.rb +1 -1
  13. data/lib/chef/resource/apt_preference.rb +1 -1
  14. data/lib/chef/resource/apt_repository.rb +1 -1
  15. data/lib/chef/resource/chocolatey_config.rb +1 -1
  16. data/lib/chef/resource/chocolatey_source.rb +1 -1
  17. data/lib/chef/resource/cron.rb +27 -8
  18. data/lib/chef/resource/cron_access.rb +1 -1
  19. data/lib/chef/resource/cron_d.rb +8 -8
  20. data/lib/chef/resource/directory.rb +1 -1
  21. data/lib/chef/resource/dmg_package.rb +9 -9
  22. data/lib/chef/resource/execute.rb +2 -2
  23. data/lib/chef/resource/homebrew_cask.rb +1 -1
  24. data/lib/chef/resource/homebrew_tap.rb +1 -1
  25. data/lib/chef/resource/hostname.rb +2 -2
  26. data/lib/chef/resource/kernel_module.rb +1 -1
  27. data/lib/chef/resource/link.rb +1 -1
  28. data/lib/chef/resource/ohai_hint.rb +1 -1
  29. data/lib/chef/resource/package.rb +1 -1
  30. data/lib/chef/resource/scm.rb +1 -1
  31. data/lib/chef/resource/swap_file.rb +1 -1
  32. data/lib/chef/resource/sysctl.rb +1 -1
  33. data/lib/chef/resource/systemd_unit.rb +1 -1
  34. data/lib/chef/resource/template.rb +11 -3
  35. data/lib/chef/resource/windows_ad_join.rb +1 -1
  36. data/lib/chef/resource/windows_auto_run.rb +1 -1
  37. data/lib/chef/resource/windows_certificate.rb +2 -1
  38. data/lib/chef/resource/windows_feature.rb +6 -6
  39. data/lib/chef/resource/windows_feature_dism.rb +13 -17
  40. data/lib/chef/resource/windows_feature_powershell.rb +1 -1
  41. data/lib/chef/resource/windows_share.rb +9 -3
  42. data/lib/chef/resource/windows_task.rb +230 -231
  43. data/lib/chef/resource/windows_workgroup.rb +32 -23
  44. data/lib/chef/resource/yum_repository.rb +1 -1
  45. data/lib/chef/version.rb +1 -1
  46. data/spec/functional/resource/msu_package_spec.rb +14 -0
  47. data/spec/integration/knife/raw_spec.rb +11 -7
  48. data/spec/integration/knife/redirection_spec.rb +6 -4
  49. data/spec/support/shared/integration/app_server_support.rb +2 -2
  50. data/spec/unit/provider/apt_repository_spec.rb +3 -3
  51. data/spec/unit/provider/package/apt_spec.rb +81 -4
  52. data/spec/unit/provider/package/rubygems_spec.rb +47 -9
  53. data/spec/unit/resource/windows_certificate.rb +30 -0
  54. data/spec/unit/resource/windows_feature.rb +4 -0
  55. data/spec/unit/resource/windows_workgroup_spec.rb +27 -0
  56. metadata +4 -4
@@ -28,6 +28,36 @@ describe Chef::Resource::WindowsCertificate do
28
28
  expect(resource.source).to eql("foobar")
29
29
  end
30
30
 
31
+ it "the store_name property defaults to 'MY'" do
32
+ expect(resource.store_name).to eql("MY")
33
+ end
34
+
35
+ it 'the store_name property accepts "TRUSTEDPUBLISHER", "TrustedPublisher", "CLIENTAUTHISSUER", "REMOTE DESKTOP", "ROOT", "TRUSTEDDEVICES", "WEBHOSTING", "CA", "AUTHROOT", "TRUSTEDPEOPLE", "MY", "SMARTCARDROOT", "TRUST", or "DISALLOWED"' do
36
+ expect { resource.store_name("TRUSTEDPUBLISHER") }.not_to raise_error
37
+ expect { resource.store_name("TrustedPublisher") }.not_to raise_error
38
+ expect { resource.store_name("CLIENTAUTHISSUER") }.not_to raise_error
39
+ expect { resource.store_name("REMOTE DESKTOP") }.not_to raise_error
40
+ expect { resource.store_name("ROOT") }.not_to raise_error
41
+ expect { resource.store_name("TRUSTEDDEVICES") }.not_to raise_error
42
+ expect { resource.store_name("WEBHOSTING") }.not_to raise_error
43
+ expect { resource.store_name("CA") }.not_to raise_error
44
+ expect { resource.store_name("AUTHROOT") }.not_to raise_error
45
+ expect { resource.store_name("TRUSTEDPEOPLE") }.not_to raise_error
46
+ expect { resource.store_name("MY") }.not_to raise_error
47
+ expect { resource.store_name("SMARTCARDROOT") }.not_to raise_error
48
+ expect { resource.store_name("TRUST") }.not_to raise_error
49
+ expect { resource.store_name("DISALLOWED") }.not_to raise_error
50
+ end
51
+
52
+ it "the resource is marked sensitive if pfx_password is specified" do
53
+ resource.pfx_password("1234")
54
+ expect(resource.sensitive).to be true
55
+ end
56
+
57
+ it "the user_store property defaults to false" do
58
+ expect(resource.user_store).to be false
59
+ end
60
+
31
61
  it "sets the default action as :create" do
32
62
  expect(resource.action).to eql([:create])
33
63
  end
@@ -50,6 +50,10 @@ describe Chef::Resource::WindowsFeature do
50
50
  expect(resource.timeout).to eql(600)
51
51
  end
52
52
 
53
+ it "install_method property defaults to :windows_feature_dism" do
54
+ expect(resource.install_method).to eql(:windows_feature_dism)
55
+ end
56
+
53
57
  it "install_method accepts :windows_feature_dism, :windows_feature_powershell, and :windows_feature_servermanagercmd" do
54
58
  expect { resource.install_method :windows_feature_dism }.not_to raise_error
55
59
  expect { resource.install_method :windows_feature_powershell }.not_to raise_error
@@ -19,6 +19,7 @@ require "spec_helper"
19
19
 
20
20
  describe Chef::Resource::WindowsWorkgroup do
21
21
  let(:resource) { Chef::Resource::WindowsWorkgroup.new("example") }
22
+ let(:provider) { resource.provider_for_action(:join) }
22
23
 
23
24
  it "sets resource name as :windows_workgroup" do
24
25
  expect(resource.resource_name).to eql(:windows_workgroup)
@@ -28,6 +29,16 @@ describe Chef::Resource::WindowsWorkgroup do
28
29
  expect(resource.workgroup_name).to eql("example")
29
30
  end
30
31
 
32
+ it "converts the legacy :immediate reboot property to :reboot_now" do
33
+ resource.reboot(:immediate)
34
+ expect(resource.reboot).to eql(:reboot_now)
35
+ end
36
+
37
+ it "converts the legacy :delayed reboot property to :request_reboot" do
38
+ resource.reboot(:delayed)
39
+ expect(resource.reboot).to eql(:request_reboot)
40
+ end
41
+
31
42
  it "sets the default action as :join" do
32
43
  expect(resource.action).to eql([:join])
33
44
  end
@@ -44,4 +55,20 @@ describe Chef::Resource::WindowsWorkgroup do
44
55
  expect { resource.reboot :never }.not_to raise_error
45
56
  expect { resource.reboot :nopenope }.to raise_error(ArgumentError)
46
57
  end
58
+
59
+ describe "#join_command" do
60
+ context "if password property is not specified" do
61
+ it "contructs a command without credentials" do
62
+ expect(provider.join_command).to eql("Add-Computer -WorkgroupName example -Force")
63
+ end
64
+ end
65
+
66
+ context "if password property is specified" do
67
+ it "contructs a command without credentials" do
68
+ resource.password("1234")
69
+ resource.user("admin")
70
+ expect(provider.join_command).to eql("$pswd = ConvertTo-SecureString '1234' -AsPlainText -Force;$credential = New-Object System.Management.Automation.PSCredential (\"admin\",$pswd);Add-Computer -WorkgroupName example -Credential $credential -Force")
71
+ end
72
+ end
73
+ end
47
74
  end
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: 14.7.17
4
+ version: 14.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-07 00:00:00.000000000 Z
11
+ date: 2018-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 14.7.17
19
+ version: 14.8.12
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: 14.7.17
26
+ version: 14.8.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-cli
29
29
  requirement: !ruby/object:Gem::Requirement