summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.expeditor/config.yml7
-rw-r--r--.expeditor/release.omnibus.yml10
-rw-r--r--.expeditor/verify.pipeline.yml72
-rw-r--r--.gitignore4
-rw-r--r--.rubocop.yml8
-rw-r--r--CHANGELOG.md294
-rw-r--r--Dockerfile4
-rw-r--r--Gemfile20
-rw-r--r--Gemfile.lock217
-rw-r--r--README.md2
-rw-r--r--RELEASE_NOTES.md1486
-rw-r--r--Rakefile37
-rw-r--r--VERSION2
-rw-r--r--azure-pipelines.yml12
-rwxr-xr-xbin/knife2
-rw-r--r--chef-bin/.rspec2
-rw-r--r--chef-bin/Gemfile4
-rw-r--r--chef-bin/Rakefile2
-rwxr-xr-xchef-bin/bin/chef-apply2
-rwxr-xr-xchef-bin/bin/chef-client2
-rwxr-xr-xchef-bin/bin/chef-resource-inspector4
-rwxr-xr-xchef-bin/bin/chef-service-manager10
-rwxr-xr-xchef-bin/bin/chef-shell2
-rwxr-xr-xchef-bin/bin/chef-solo2
-rwxr-xr-xchef-bin/bin/chef-windows-service2
-rw-r--r--chef-bin/lib/chef-bin/version.rb2
-rw-r--r--chef-config/Gemfile6
-rw-r--r--chef-config/chef-config.gemspec18
-rw-r--r--chef-config/lib/chef-config/config.rb70
-rw-r--r--chef-config/lib/chef-config/dist.rb33
-rw-r--r--chef-config/lib/chef-config/mixin/credentials.rb15
-rw-r--r--chef-config/lib/chef-config/mixin/dot_d.rb1
-rw-r--r--chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb10
-rw-r--r--chef-config/lib/chef-config/mixin/train_transport.rb141
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--chef-config/lib/chef-config/workstation_config_loader.rb14
-rw-r--r--chef-config/spec/unit/config_spec.rb8
-rw-r--r--chef-config/spec/unit/fips_spec.rb2
-rw-r--r--chef-config/spec/unit/workstation_config_loader_spec.rb2
-rw-r--r--chef-universal-mingw32.gemspec2
-rw-r--r--chef-utils/Gemfile3
-rw-r--r--chef-utils/README.md6
-rw-r--r--chef-utils/Rakefile1
-rw-r--r--chef-utils/chef-utils.gemspec10
-rw-r--r--chef-utils/lib/chef-utils.rb1
-rw-r--r--chef-utils/lib/chef-utils/dist.rb98
-rw-r--r--chef-utils/lib/chef-utils/dsl/architecture.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/cloud.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/default_paths.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/introspection.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/os.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/path_sanity.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform.rb14
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform_family.rb3
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform_version.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/service.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/train_helpers.rb28
-rw-r--r--chef-utils/lib/chef-utils/dsl/virtualization.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/which.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/windows.rb1
-rw-r--r--chef-utils/lib/chef-utils/internal.rb1
-rw-r--r--chef-utils/lib/chef-utils/mash.rb1
-rw-r--r--chef-utils/lib/chef-utils/version.rb3
-rw-r--r--chef-utils/lib/chef-utils/version_string.rb3
-rw-r--r--chef-utils/spec/spec_helper.rb1
-rw-r--r--chef-utils/spec/unit/dsl/architecture_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/cloud_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/dsl_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/introspection_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/os_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/path_sanity_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/platform_family_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/platform_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/service_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/virtualization_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/which_spec.rb3
-rw-r--r--chef-utils/spec/unit/dsl/windows_spec.rb1
-rw-r--r--chef-utils/spec/unit/mash_spec.rb1
-rw-r--r--chef.gemspec9
-rw-r--r--cspell.json14
-rw-r--r--distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dllbin0 -> 171008 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/Chef.PowerShell.dllbin0 -> 6144 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/Ijwhost.dllbin0 -> 319880 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/Newtonsoft.Json.dll (renamed from distro/ruby_bin_folder/Newtonsoft.Json.dll)bin664576 -> 664576 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/concrt140.dllbin0 -> 309128 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dllbin0 -> 499072 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/msvcp140.dllbin0 -> 585096 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/msvcp140_1.dllbin0 -> 23928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/msvcp140_2.dllbin0 -> 186248 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dllbin0 -> 41336 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dllbin0 -> 20360 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dllbin0 -> 98304 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dllbin0 -> 5632 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdbbin0 -> 11716 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json9
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dllbin0 -> 319880 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dllbin0 -> 406016 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dllbin0 -> 357752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dllbin0 -> 993160 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dllbin0 -> 5437320 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dllbin0 -> 2398080 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.amd64.dllbin0 -> 1495800 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dllbin0 -> 17920 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dllbin0 -> 142336 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dllbin0 -> 114688 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json2576
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dllbin0 -> 220552 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dllbin0 -> 572288 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dllbin0 -> 808840 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dllbin0 -> 336264 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dllbin0 -> 182664 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dllbin0 -> 154504 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dllbin0 -> 228744 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dllbin0 -> 1194888 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dllbin0 -> 17288 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dllbin0 -> 286600 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dllbin0 -> 143744 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dllbin0 -> 22920 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dllbin0 -> 20872 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dllbin0 -> 84352 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dllbin0 -> 52104 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dllbin0 -> 224768 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dllbin0 -> 47616 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dllbin0 -> 693680 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dllbin0 -> 101256 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dllbin0 -> 14208 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dllbin0 -> 183176 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dllbin0 -> 191368 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dllbin0 -> 665992 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dllbin0 -> 99200 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dllbin0 -> 93056 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dllbin0 -> 287112 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dllbin0 -> 175496 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dllbin0 -> 16256 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dllbin0 -> 36744 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dllbin0 -> 62856 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dllbin0 -> 701824 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dllbin0 -> 16776 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dllbin0 -> 381832 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dllbin0 -> 18816 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dllbin0 -> 152968 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dllbin0 -> 23944 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dllbin0 -> 2889088 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dllbin0 -> 25992 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dllbin0 -> 185736 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dllbin0 -> 130440 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dllbin0 -> 30600 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dllbin0 -> 271240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dllbin0 -> 34696 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dllbin0 -> 58760 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dllbin0 -> 126344 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dllbin0 -> 369544 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dllbin0 -> 437128 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dllbin0 -> 124296 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dllbin0 -> 20352 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dllbin0 -> 193416 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dllbin0 -> 71560 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dllbin0 -> 36744 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dllbin0 -> 245640 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dllbin0 -> 89992 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dllbin0 -> 40328 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dllbin0 -> 70536 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dllbin0 -> 220032 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dllbin0 -> 80776 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dllbin0 -> 64896 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dllbin0 -> 135560 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dllbin0 -> 5272968 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dllbin0 -> 1291648 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dllbin0 -> 188296 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dllbin0 -> 419208 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dllbin0 -> 7389576 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.dllbin0 -> 294784 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dllbin0 -> 213384 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dllbin0 -> 51080 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dllbin0 -> 1821056 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dllbin0 -> 634760 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dllbin0 -> 544648 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dllbin0 -> 85384 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dllbin0 -> 148864 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dllbin0 -> 75144 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dllbin0 -> 211336 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dllbin0 -> 344960 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dllbin0 -> 678792 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dllbin0 -> 34696 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dllbin0 -> 546696 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dllbin0 -> 161160 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dllbin0 -> 59784 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dllbin0 -> 27528 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dllbin0 -> 62344 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dllbin0 -> 151936 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dllbin0 -> 16776 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dllbin0 -> 89992 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dllbin0 -> 9389960 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dllbin0 -> 2068360 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dllbin0 -> 242568 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dllbin0 -> 397704 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dllbin0 -> 8422792 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dllbin0 -> 70536 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dllbin0 -> 1064840 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dllbin0 -> 32136 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dllbin0 -> 14208 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dllbin0 -> 43400 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dllbin0 -> 19848 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dllbin0 -> 18816 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dllbin0 -> 17288 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dllbin0 -> 28040 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dllbin0 -> 48520 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dllbin0 -> 201096 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dllbin0 -> 317832 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dllbin0 -> 27016 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dllbin0 -> 16256 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dllbin0 -> 42368 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dllbin0 -> 212360 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dllbin0 -> 92040 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dllbin0 -> 743816 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dllbin0 -> 453504 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dllbin0 -> 183176 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dllbin0 -> 93064 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dllbin0 -> 34696 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dllbin0 -> 275840 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dllbin0 -> 112512 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dllbin0 -> 33152 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dllbin0 -> 450944 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dllbin0 -> 98184 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dllbin0 -> 146824 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dllbin0 -> 14208 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dllbin0 -> 17800 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dllbin0 -> 16264 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dllbin0 -> 61832 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dllbin0 -> 864136 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dllbin0 -> 92552 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dllbin0 -> 876936 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dllbin0 -> 508808 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dllbin0 -> 43400 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dllbin0 -> 115584 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dllbin0 -> 473992 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dllbin0 -> 107904 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dllbin0 -> 77704 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dllbin0 -> 345992 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dllbin0 -> 50568 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dllbin0 -> 42376 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dllbin0 -> 21896 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dllbin0 -> 16776 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dllbin0 -> 17280 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dllbin0 -> 24456 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dllbin0 -> 54664 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dllbin0 -> 12440 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dllbin0 -> 15512 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dllbin0 -> 12440 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dllbin0 -> 12952 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dllbin0 -> 14488 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dllbin0 -> 11920 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dllbin0 -> 12952 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dllbin0 -> 14488 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dllbin0 -> 11416 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dllbin0 -> 12440 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dllbin0 -> 13768 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dllbin0 -> 12432 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dllbin0 -> 12952 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dllbin0 -> 12440 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dllbin0 -> 12952 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dllbin0 -> 15816 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dllbin0 -> 13768 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dllbin0 -> 12952 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dllbin0 -> 12464 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dllbin0 -> 21144 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dllbin0 -> 20120 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dllbin0 -> 64664 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dllbin0 -> 12976 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dllbin0 -> 16536 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dllbin0 -> 17864 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dllbin0 -> 18376 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dllbin0 -> 14280 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dllbin0 -> 747912 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dllbin0 -> 262536 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dllbin0 -> 1324424 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dllbin0 -> 5155720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exebin0 -> 54728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 329608 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dllbin0 -> 37760 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dllbin0 -> 116104 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 350080 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 342904 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dllbin0 -> 38776 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 350080 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dllbin0 -> 499072 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dllbin0 -> 506248 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 349064 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 384392 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dllbin0 -> 41856 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 353672 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dllbin0 -> 39816 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mi.dllbin0 -> 123904 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/miutils.dllbin0 -> 239616 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dllbin0 -> 1047928 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dllbin0 -> 1048456 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dllbin0 -> 1082240 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dllbin0 -> 57216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dllbin0 -> 142216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dllbin0 -> 114048 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 353672 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 337280 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dllbin0 -> 38792 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dllbin0 -> 159616 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 462728 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dllbin0 -> 46984 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 334216 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dllbin0 -> 38264 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dllbin0 -> 1035720 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 297864 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dllbin0 -> 36232 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 298888 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dllbin0 -> 36224 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/vccorlib140.dllbin0 -> 330120 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/vcruntime140.dllbin0 -> 94088 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/vcruntime140_1.dllbin0 -> 36744 bytes
-rw-r--r--distro/ruby_bin_folder/Chef.PowerShell.Wrapper.dllbin123904 -> 0 bytes
-rw-r--r--distro/ruby_bin_folder/Chef.PowerShell.dllbin6656 -> 0 bytes
-rw-r--r--distro/ruby_bin_folder/msvcp140.dllbin652384 -> 0 bytes
-rw-r--r--distro/ruby_bin_folder/vcruntime140.dllbin106120 -> 0 bytes
-rw-r--r--distro/ruby_bin_folder/x86/Chef.PowerShell.dllbin0 -> 6656 bytes
-rw-r--r--distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dllbin0 -> 145920 bytes
-rw-r--r--distro/ruby_bin_folder/x86/Ijwhost.dllbin0 -> 244616 bytes
-rw-r--r--distro/ruby_bin_folder/x86/Newtonsoft.Json.dllbin0 -> 664576 bytes
-rw-r--r--distro/ruby_bin_folder/x86/concrt140.dllbin0 -> 244088 bytes
-rw-r--r--distro/ruby_bin_folder/x86/host/fxr/5.0.0/hostfxr.dllbin0 -> 389512 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140.dllbin0 -> 450952 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_1.dllbin0 -> 21376 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_2.dllbin0 -> 166776 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dllbin0 -> 39296 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dllbin0 -> 18808 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/API-MS-Win-core-xstate-l2-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dllbin0 -> 83456 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dllbin0 -> 6144 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdbbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json9
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dllbin0 -> 244616 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dllbin0 -> 406016 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dllbin0 -> 357752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dllbin0 -> 900488 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dllbin0 -> 5437320 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dllbin0 -> 2398080 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.x86.dllbin0 -> 1188080 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dllbin0 -> 14336 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dllbin0 -> 140288 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dllbin0 -> 114688 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json2579
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dllbin0 -> 220552 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dllbin0 -> 572288 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dllbin0 -> 808840 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dllbin0 -> 336264 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dllbin0 -> 182664 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dllbin0 -> 154504 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dllbin0 -> 228744 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dllbin0 -> 1112448 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dllbin0 -> 17288 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dllbin0 -> 286600 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dllbin0 -> 143744 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dllbin0 -> 21896 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dllbin0 -> 20872 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dllbin0 -> 77192 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dllbin0 -> 52104 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dllbin0 -> 224768 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dllbin0 -> 47616 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dllbin0 -> 693680 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dllbin0 -> 100744 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dllbin0 -> 183176 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dllbin0 -> 172936 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dllbin0 -> 580488 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dllbin0 -> 86920 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dllbin0 -> 82816 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dllbin0 -> 254344 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dllbin0 -> 158600 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dllbin0 -> 16264 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dllbin0 -> 34184 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dllbin0 -> 57224 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dllbin0 -> 625544 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dllbin0 -> 16776 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dllbin0 -> 381832 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dllbin0 -> 18824 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Console.dllbin0 -> 138624 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Core.dllbin0 -> 23936 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dllbin0 -> 2617216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.dllbin0 -> 25992 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dllbin0 -> 165768 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dllbin0 -> 130440 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dllbin0 -> 28552 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dllbin0 -> 242568 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dllbin0 -> 32136 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dllbin0 -> 52104 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dllbin0 -> 107912 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dllbin0 -> 369544 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dllbin0 -> 437128 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dllbin0 -> 114560 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dllbin0 -> 20360 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dllbin0 -> 170888 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dllbin0 -> 64904 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dllbin0 -> 33160 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dllbin0 -> 222600 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dllbin0 -> 81800 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dllbin0 -> 37768 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dllbin0 -> 64904 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dllbin0 -> 194952 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dllbin0 -> 72072 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dllbin0 -> 60808 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dllbin0 -> 15232 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dllbin0 -> 122760 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dllbin0 -> 4622216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dllbin0 -> 1119112 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dllbin0 -> 172936 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dllbin0 -> 371592 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dllbin0 -> 7389576 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.dllbin0 -> 294784 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dllbin0 -> 195976 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dllbin0 -> 46984 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dllbin0 -> 1606536 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dllbin0 -> 557960 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dllbin0 -> 479112 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dllbin0 -> 77704 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dllbin0 -> 132992 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dllbin0 -> 67456 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dllbin0 -> 189824 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dllbin0 -> 307080 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dllbin0 -> 591752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dllbin0 -> 32648 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dllbin0 -> 483208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dllbin0 -> 140680 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dllbin0 -> 54664 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dllbin0 -> 25480 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dllbin0 -> 57224 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dllbin0 -> 134016 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.dllbin0 -> 16768 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dllbin0 -> 81800 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dllbin0 -> 8576392 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dllbin0 -> 1859968 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dllbin0 -> 230792 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dllbin0 -> 350088 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dllbin0 -> 7571336 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dllbin0 -> 63880 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dllbin0 -> 982408 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dllbin0 -> 30088 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dllbin0 -> 14200 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dllbin0 -> 40832 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dllbin0 -> 18824 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dllbin0 -> 18312 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dllbin0 -> 17288 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dllbin0 -> 25992 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dllbin0 -> 45960 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dllbin0 -> 191880 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dllbin0 -> 290184 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dllbin0 -> 25992 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dllbin0 -> 16264 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dllbin0 -> 42368 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dllbin0 -> 191360 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dllbin0 -> 83336 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dllbin0 -> 616320 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dllbin0 -> 383880 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dllbin0 -> 163720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dllbin0 -> 84872 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dllbin0 -> 33672 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dllbin0 -> 275840 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dllbin0 -> 101256 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dllbin0 -> 33152 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dllbin0 -> 395144 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dllbin0 -> 98184 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dllbin0 -> 132488 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.dllbin0 -> 17800 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dllbin0 -> 16264 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dllbin0 -> 61832 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dllbin0 -> 849800 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dllbin0 -> 86920 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dllbin0 -> 795528 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dllbin0 -> 467336 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dllbin0 -> 43400 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dllbin0 -> 105864 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dllbin0 -> 419712 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dllbin0 -> 99200 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dllbin0 -> 14712 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dllbin0 -> 14216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dllbin0 -> 73088 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dllbin0 -> 307080 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dllbin0 -> 15744 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dllbin0 -> 47496 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.dllbin0 -> 14720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dllbin0 -> 42376 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dllbin0 -> 21896 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dllbin0 -> 16264 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dllbin0 -> 14728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dllbin0 -> 15240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dllbin0 -> 17288 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dllbin0 -> 24456 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.dllbin0 -> 54656 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dllbin0 -> 15752 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dllbin0 -> 11928 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dllbin0 -> 11200 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dllbin0 -> 15000 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dllbin0 -> 11440 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dllbin0 -> 13768 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dllbin0 -> 12432 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dllbin0 -> 13760 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dllbin0 -> 10688 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dllbin0 -> 11416 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dllbin0 -> 13488 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dllbin0 -> 11920 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dllbin0 -> 12440 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dllbin0 -> 11712 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dllbin0 -> 11208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dllbin0 -> 15304 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dllbin0 -> 11720 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dllbin0 -> 13248 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dllbin0 -> 11712 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dllbin0 -> 21960 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dllbin0 -> 19400 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dllbin0 -> 66200 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dllbin0 -> 12232 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dllbin0 -> 15816 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dllbin0 -> 17352 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dllbin0 -> 18072 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dllbin0 -> 13768 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dllbin0 -> 11712 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dllbin0 -> 719240 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dllbin0 -> 262536 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrjit.dllbin0 -> 1119112 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/coreclr.dllbin0 -> 4224904 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/createdump.exebin0 -> 43976 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 329608 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dllbin0 -> 37760 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dllbin0 -> 106888 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 350080 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 342904 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dllbin0 -> 38776 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 350080 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dllbin0 -> 389512 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dllbin0 -> 391048 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 349064 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 384392 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dllbin0 -> 41856 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 353672 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dllbin0 -> 39816 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mi.dllbin0 -> 102400 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/miutils.dllbin0 -> 190464 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dllbin0 -> 988536 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_x86_x86_5.0.20.51904.dllbin0 -> 989056 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dllbin0 -> 988032 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dllbin0 -> 57224 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dllbin0 -> 142208 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/netstandard.dllbin0 -> 114056 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 353672 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dllbin0 -> 39304 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 337280 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dllbin0 -> 38792 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dllbin0 -> 127360 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 462728 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dllbin0 -> 46984 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 334216 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dllbin0 -> 38264 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dllbin0 -> 1170880 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 297864 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dllbin0 -> 36232 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dllbin0 -> 298888 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dllbin0 -> 36224 bytes
-rw-r--r--distro/ruby_bin_folder/x86/vccorlib140.dllbin0 -> 267656 bytes
-rw-r--r--distro/ruby_bin_folder/x86/vcruntime140.dllbin0 -> 76152 bytes
-rw-r--r--distro/templates/powershell/chef/chef.psm1.erb36
-rw-r--r--docs/dev/design_documents/client_release_cadence.md12
-rw-r--r--docs/dev/design_documents/data_collector.md5
-rw-r--r--docs/dev/how_to/bumping_the_major_version.md25
-rw-r--r--ext/win32-eventlog/Rakefile4
-rw-r--r--ext/win32-eventlog/chef-log.man.erb8
-rw-r--r--habitat/tests/spec.ps12
-rw-r--r--habitat/tests/test.pester.ps117
-rwxr-xr-xhabitat/tests/test.sh2
-rw-r--r--kitchen-tests/Gemfile5
-rw-r--r--kitchen-tests/cookbooks/end_to_end/metadata.rb3
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb11
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/_ifconfig.rb15
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/linux.rb9
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/macos.rb13
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb37
-rw-r--r--kitchen-tests/kitchen.yml24
-rw-r--r--kitchen-tests/test/integration/end-to-end/_chef_client_config.rb11
-rw-r--r--lib/chef/application.rb25
-rw-r--r--lib/chef/application/apply.rb19
-rw-r--r--lib/chef/application/base.rb51
-rw-r--r--lib/chef/application/client.rb21
-rw-r--r--lib/chef/application/exit_code.rb8
-rw-r--r--lib/chef/application/knife.rb33
-rw-r--r--lib/chef/application/solo.rb3
-rw-r--r--lib/chef/application/windows_service.rb28
-rw-r--r--lib/chef/application/windows_service_manager.rb12
-rw-r--r--lib/chef/chef_fs/chef_fs_data_store.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/cookbook_data_handler.rb2
-rw-r--r--lib/chef/chef_fs/file_pattern.rb2
-rw-r--r--lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb2
-rw-r--r--lib/chef/chef_fs/knife.rb4
-rw-r--r--lib/chef/chef_fs/parallelizer.rb1
-rw-r--r--lib/chef/client.rb59
-rw-r--r--lib/chef/compliance/default_attributes.rb93
-rw-r--r--lib/chef/compliance/fetcher/automate.rb69
-rw-r--r--lib/chef/compliance/fetcher/chef_server.rb134
-rw-r--r--lib/chef/compliance/reporter/automate.rb201
-rw-r--r--lib/chef/compliance/reporter/chef_server_automate.rb94
-rw-r--r--lib/chef/compliance/reporter/compliance_enforcer.rb20
-rw-r--r--lib/chef/compliance/reporter/json_file.rb19
-rw-r--r--lib/chef/compliance/runner.rb266
-rw-r--r--lib/chef/cookbook/gem_installer.rb2
-rw-r--r--lib/chef/cookbook/synchronizer.rb4
-rw-r--r--lib/chef/cookbook_manifest.rb3
-rw-r--r--lib/chef/cookbook_site_streaming_uploader.rb24
-rw-r--r--lib/chef/cookbook_uploader.rb2
-rw-r--r--lib/chef/cookbook_version.rb7
-rw-r--r--lib/chef/data_collector.rb13
-rw-r--r--lib/chef/data_collector/config_validation.rb35
-rw-r--r--lib/chef/data_collector/run_end_message.rb4
-rw-r--r--lib/chef/data_collector/run_start_message.rb2
-rw-r--r--lib/chef/deprecated.rb2
-rw-r--r--lib/chef/deprecation/warnings.rb4
-rw-r--r--lib/chef/digester.rb4
-rw-r--r--lib/chef/dist.rb68
-rw-r--r--lib/chef/dsl/chef_vault.rb2
-rw-r--r--lib/chef/dsl/data_query.rb4
-rw-r--r--lib/chef/dsl/platform_introspection.rb2
-rw-r--r--lib/chef/encrypted_data_bag_item.rb7
-rw-r--r--lib/chef/encrypted_data_bag_item/assertions.rb2
-rw-r--r--lib/chef/encrypted_data_bag_item/decryptor.rb6
-rw-r--r--lib/chef/encrypted_data_bag_item/encryptor.rb6
-rw-r--r--lib/chef/environment.rb6
-rw-r--r--lib/chef/event_loggers/windows_eventlog.rb4
-rw-r--r--lib/chef/exceptions.rb14
-rw-r--r--lib/chef/file_access_control/windows.rb11
-rw-r--r--lib/chef/file_content_management/tempfile.rb2
-rw-r--r--lib/chef/formatters/doc.rb13
-rw-r--r--lib/chef/formatters/error_inspectors/api_error_formatting.rb11
-rw-r--r--lib/chef/formatters/error_inspectors/compile_error_inspector.rb4
-rw-r--r--lib/chef/formatters/error_inspectors/node_load_error_inspector.rb6
-rw-r--r--lib/chef/formatters/error_inspectors/registration_error_inspector.rb18
-rw-r--r--lib/chef/formatters/error_inspectors/resource_failure_inspector.rb12
-rw-r--r--lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb6
-rw-r--r--lib/chef/formatters/indentable_output_stream.rb4
-rw-r--r--lib/chef/formatters/minimal.rb9
-rw-r--r--lib/chef/guard_interpreter/resource_guard_interpreter.rb67
-rw-r--r--lib/chef/http.rb20
-rw-r--r--lib/chef/http/auth_credentials.rb6
-rw-r--r--lib/chef/http/authenticator.rb2
-rw-r--r--lib/chef/http/basic_client.rb6
-rw-r--r--lib/chef/http/http_request.rb12
-rw-r--r--lib/chef/http/socketless_chef_zero_client.rb7
-rw-r--r--lib/chef/http/ssl_policies.rb49
-rw-r--r--lib/chef/json_compat.rb11
-rw-r--r--lib/chef/key.rb2
-rw-r--r--lib/chef/knife.rb8
-rw-r--r--lib/chef/knife/bootstrap.rb33
-rw-r--r--lib/chef/knife/bootstrap/chef_vault_handler.rb2
-rw-r--r--lib/chef/knife/bootstrap/templates/chef-full.erb6
-rw-r--r--lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb18
-rw-r--r--lib/chef/knife/bootstrap/train_connector.rb2
-rw-r--r--lib/chef/knife/client_create.rb6
-rw-r--r--lib/chef/knife/config_show.rb2
-rw-r--r--lib/chef/knife/configure.rb4
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb4
-rw-r--r--lib/chef/knife/core/cookbook_scm_repo.rb2
-rw-r--r--lib/chef/knife/core/gem_glob_loader.rb2
-rw-r--r--lib/chef/knife/core/object_loader.rb2
-rw-r--r--lib/chef/knife/core/ui.rb7
-rw-r--r--lib/chef/knife/core/windows_bootstrap_context.rb35
-rw-r--r--lib/chef/knife/exec.rb4
-rw-r--r--lib/chef/knife/node_policy_set.rb4
-rw-r--r--lib/chef/knife/node_run_list_add.rb2
-rw-r--r--lib/chef/knife/node_run_list_remove.rb2
-rw-r--r--lib/chef/knife/node_run_list_set.rb2
-rw-r--r--lib/chef/knife/node_show.rb4
-rw-r--r--lib/chef/knife/role_env_run_list_add.rb2
-rw-r--r--lib/chef/knife/role_env_run_list_set.rb2
-rw-r--r--lib/chef/knife/role_run_list_add.rb2
-rw-r--r--lib/chef/knife/role_run_list_set.rb2
-rw-r--r--lib/chef/knife/search.rb1
-rw-r--r--lib/chef/knife/serve.rb6
-rw-r--r--lib/chef/knife/ssh.rb8
-rw-r--r--lib/chef/knife/ssl_check.rb6
-rw-r--r--lib/chef/knife/status.rb4
-rw-r--r--lib/chef/knife/tag_create.rb2
-rw-r--r--lib/chef/knife/tag_delete.rb2
-rw-r--r--lib/chef/knife/user_create.rb4
-rw-r--r--lib/chef/knife/yaml_convert.rb2
-rw-r--r--lib/chef/local_mode.rb4
-rw-r--r--lib/chef/log/syslog.rb4
-rw-r--r--lib/chef/log/winevt.rb4
-rw-r--r--lib/chef/mixin/convert_to_class_name.rb56
-rw-r--r--lib/chef/mixin/deep_merge.rb12
-rw-r--r--lib/chef/mixin/openssl_helper.rb7
-rw-r--r--lib/chef/mixin/powershell_exec.rb34
-rw-r--r--lib/chef/mixin/powershell_out.rb17
-rw-r--r--lib/chef/mixin/properties.rb2
-rw-r--r--lib/chef/mixin/template.rb6
-rw-r--r--lib/chef/mixin/unformatter.rb2
-rw-r--r--lib/chef/mixin/uris.rb6
-rw-r--r--lib/chef/mixin/versioned_api.rb3
-rw-r--r--lib/chef/monkey_patches/net_http.rb22
-rw-r--r--lib/chef/node/attribute_collections.rb8
-rw-r--r--lib/chef/node/mixin/immutablize_hash.rb2
-rw-r--r--lib/chef/node_map.rb8
-rw-r--r--lib/chef/platform/query_helpers.rb8
-rw-r--r--lib/chef/policy_builder/dynamic.rb2
-rw-r--r--lib/chef/policy_builder/policyfile.rb4
-rw-r--r--lib/chef/powershell.rb14
-rw-r--r--lib/chef/property.rb2
-rw-r--r--lib/chef/provider.rb2
-rw-r--r--lib/chef/provider/cron.rb15
-rw-r--r--lib/chef/provider/dsc_resource.rb36
-rw-r--r--lib/chef/provider/dsc_script.rb36
-rw-r--r--lib/chef/provider/file.rb4
-rw-r--r--lib/chef/provider/git.rb10
-rw-r--r--lib/chef/provider/group.rb20
-rw-r--r--lib/chef/provider/group/windows.rb13
-rw-r--r--lib/chef/provider/ifconfig.rb18
-rw-r--r--lib/chef/provider/ifconfig/debian.rb60
-rw-r--r--lib/chef/provider/ifconfig/redhat.rb72
-rw-r--r--lib/chef/provider/launchd.rb16
-rw-r--r--lib/chef/provider/link.rb9
-rw-r--r--lib/chef/provider/mount.rb19
-rw-r--r--lib/chef/provider/mount/linux.rb4
-rw-r--r--lib/chef/provider/mount/mount.rb84
-rw-r--r--lib/chef/provider/package.rb3
-rw-r--r--lib/chef/provider/package/apt.rb2
-rw-r--r--lib/chef/provider/package/chocolatey.rb12
-rw-r--r--lib/chef/provider/package/dpkg.rb15
-rw-r--r--lib/chef/provider/package/freebsd/base.rb5
-rw-r--r--lib/chef/provider/package/freebsd/pkgng.rb2
-rw-r--r--lib/chef/provider/package/homebrew.rb2
-rw-r--r--lib/chef/provider/package/ips.rb2
-rw-r--r--lib/chef/provider/package/powershell.rb5
-rw-r--r--lib/chef/provider/package/rubygems.rb41
-rw-r--r--lib/chef/provider/package/snap.rb5
-rw-r--r--lib/chef/provider/package/solaris.rb2
-rw-r--r--lib/chef/provider/package/windows.rb4
-rw-r--r--lib/chef/provider/package/windows/registry_uninstall_entry.rb4
-rw-r--r--lib/chef/provider/package/yum/rpm_utils.rb2
-rw-r--r--lib/chef/provider/package/zypper.rb171
-rw-r--r--lib/chef/provider/powershell_script.rb13
-rw-r--r--lib/chef/provider/registry_key.rb7
-rw-r--r--lib/chef/provider/remote_file/content.rb3
-rw-r--r--lib/chef/provider/remote_file/ftp.rb10
-rw-r--r--lib/chef/provider/remote_file/sftp.rb10
-rw-r--r--lib/chef/provider/route.rb12
-rw-r--r--lib/chef/provider/service/debian.rb3
-rw-r--r--lib/chef/provider/service/macosx.rb4
-rw-r--r--lib/chef/provider/service/redhat.rb2
-rw-r--r--lib/chef/provider/template_finder.rb12
-rw-r--r--lib/chef/provider/user.rb26
-rw-r--r--lib/chef/provider/user/aix.rb2
-rw-r--r--lib/chef/provider/user/dscl.rb10
-rw-r--r--lib/chef/provider/user/mac.rb22
-rw-r--r--lib/chef/provider/user/solaris.rb2
-rw-r--r--lib/chef/provider/user/windows.rb13
-rw-r--r--lib/chef/provider/windows_env.rb210
-rw-r--r--lib/chef/provider/windows_path.rb61
-rw-r--r--lib/chef/provider/windows_task.rb632
-rw-r--r--lib/chef/provider/zypper_repository.rb4
-rw-r--r--lib/chef/provider_resolver.rb2
-rw-r--r--lib/chef/providers.rb3
-rw-r--r--lib/chef/pwsh.rb71
-rw-r--r--lib/chef/recipe.rb4
-rw-r--r--lib/chef/resource.rb4
-rw-r--r--lib/chef/resource/apt_repository.rb11
-rw-r--r--lib/chef/resource/bash.rb120
-rw-r--r--lib/chef/resource/batch.rb2
-rw-r--r--lib/chef/resource/bff_package.rb22
-rw-r--r--lib/chef/resource/breakpoint.rb61
-rw-r--r--lib/chef/resource/build_essential.rb13
-rw-r--r--lib/chef/resource/cab_package.rb29
-rw-r--r--lib/chef/resource/chef_client_config.rb313
-rw-r--r--lib/chef/resource/chef_client_cron.rb52
-rw-r--r--lib/chef/resource/chef_client_launchd.rb72
-rw-r--r--lib/chef/resource/chef_client_scheduled_task.rb40
-rw-r--r--lib/chef/resource/chef_client_systemd_timer.rb47
-rw-r--r--lib/chef/resource/chef_client_trusted_certificate.rb6
-rw-r--r--lib/chef/resource/chef_gem.rb24
-rw-r--r--lib/chef/resource/chef_handler.rb153
-rw-r--r--lib/chef/resource/chef_sleep.rb6
-rw-r--r--lib/chef/resource/chef_vault_secret.rb2
-rw-r--r--lib/chef/resource/cookbook_file.rb4
-rw-r--r--lib/chef/resource/cron/_cron_shared.rb1
-rw-r--r--lib/chef/resource/cron/cron_d.rb5
-rw-r--r--lib/chef/resource/csh.rb4
-rw-r--r--lib/chef/resource/dnf_package.rb4
-rw-r--r--lib/chef/resource/dsc_resource.rb1
-rw-r--r--lib/chef/resource/dsc_script.rb11
-rw-r--r--lib/chef/resource/execute.rb18
-rw-r--r--lib/chef/resource/file.rb10
-rw-r--r--lib/chef/resource/gem_package.rb14
-rw-r--r--lib/chef/resource/homebrew_package.rb6
-rw-r--r--lib/chef/resource/homebrew_update.rb15
-rw-r--r--lib/chef/resource/hostname.rb14
-rw-r--r--lib/chef/resource/http_request.rb2
-rw-r--r--lib/chef/resource/ifconfig.rb57
-rw-r--r--lib/chef/resource/kernel_module.rb2
-rw-r--r--lib/chef/resource/ksh.rb6
-rw-r--r--lib/chef/resource/launchd.rb30
-rw-r--r--lib/chef/resource/locale.rb6
-rw-r--r--lib/chef/resource/lwrp_base.rb8
-rw-r--r--lib/chef/resource/macos_userdefaults.rb6
-rw-r--r--lib/chef/resource/mdadm.rb4
-rw-r--r--lib/chef/resource/mount.rb10
-rw-r--r--lib/chef/resource/notify_group.rb1
-rw-r--r--lib/chef/resource/ohai.rb49
-rw-r--r--lib/chef/resource/ohai_hint.rb33
-rw-r--r--lib/chef/resource/openssl_dhparam.rb32
-rw-r--r--lib/chef/resource/openssl_ec_private_key.rb9
-rw-r--r--lib/chef/resource/openssl_ec_public_key.rb4
-rw-r--r--lib/chef/resource/openssl_rsa_private_key.rb9
-rw-r--r--lib/chef/resource/openssl_x509_certificate.rb28
-rw-r--r--lib/chef/resource/openssl_x509_crl.rb29
-rw-r--r--lib/chef/resource/openssl_x509_request.rb30
-rw-r--r--lib/chef/resource/osx_profile.rb90
-rw-r--r--lib/chef/resource/perl.rb4
-rw-r--r--lib/chef/resource/plist.rb10
-rw-r--r--lib/chef/resource/powershell_package_source.rb47
-rw-r--r--lib/chef/resource/powershell_script.rb25
-rw-r--r--lib/chef/resource/python.rb4
-rw-r--r--lib/chef/resource/reboot.rb4
-rw-r--r--lib/chef/resource/registry_key.rb95
-rw-r--r--lib/chef/resource/remote_directory.rb2
-rw-r--r--lib/chef/resource/remote_file.rb6
-rw-r--r--lib/chef/resource/rhsm_register.rb32
-rw-r--r--lib/chef/resource/route.rb2
-rw-r--r--lib/chef/resource/ruby.rb6
-rw-r--r--lib/chef/resource/ruby_block.rb4
-rw-r--r--lib/chef/resource/scm/_scm.rb3
-rw-r--r--lib/chef/resource/scm/git.rb83
-rw-r--r--lib/chef/resource/scm/subversion.rb16
-rw-r--r--lib/chef/resource/script.rb4
-rw-r--r--lib/chef/resource/service.rb6
-rw-r--r--lib/chef/resource/solaris_package.rb2
-rw-r--r--lib/chef/resource/ssh_known_hosts_entry.rb4
-rw-r--r--lib/chef/resource/sudo.rb2
-rw-r--r--lib/chef/resource/support/client.erb64
-rw-r--r--lib/chef/resource/support/cron.d.erb2
-rw-r--r--lib/chef/resource/support/cron_access.erb2
-rw-r--r--lib/chef/resource/support/sudoer.erb2
-rw-r--r--lib/chef/resource/support/ulimit.erb2
-rw-r--r--lib/chef/resource/sysctl.rb6
-rw-r--r--lib/chef/resource/systemd_unit.rb47
-rw-r--r--lib/chef/resource/template.rb8
-rw-r--r--lib/chef/resource/windows_ad_join.rb31
-rw-r--r--lib/chef/resource/windows_audit_policy.rb50
-rw-r--r--lib/chef/resource/windows_certificate.rb30
-rw-r--r--lib/chef/resource/windows_dfs_server.rb11
-rw-r--r--lib/chef/resource/windows_env.rb173
-rw-r--r--lib/chef/resource/windows_feature.rb2
-rw-r--r--lib/chef/resource/windows_firewall_profile.rb59
-rw-r--r--lib/chef/resource/windows_firewall_rule.rb20
-rw-r--r--lib/chef/resource/windows_font.rb2
-rw-r--r--lib/chef/resource/windows_package.rb5
-rw-r--r--lib/chef/resource/windows_path.rb38
-rw-r--r--lib/chef/resource/windows_printer.rb8
-rw-r--r--lib/chef/resource/windows_printer_port.rb10
-rw-r--r--lib/chef/resource/windows_security_policy.rb10
-rw-r--r--lib/chef/resource/windows_service.rb108
-rw-r--r--lib/chef/resource/windows_share.rb36
-rw-r--r--lib/chef/resource/windows_task.rb657
-rw-r--r--lib/chef/resource/windows_user_privilege.rb107
-rw-r--r--lib/chef/resource/windows_workgroup.rb16
-rw-r--r--lib/chef/resource/yum_package.rb4
-rw-r--r--lib/chef/resource/yum_repository.rb2
-rw-r--r--lib/chef/resource_collection/resource_set.rb8
-rw-r--r--lib/chef/resource_inspector.rb152
-rw-r--r--lib/chef/resource_reporter.rb2
-rw-r--r--lib/chef/resources.rb1
-rw-r--r--lib/chef/run_context.rb4
-rw-r--r--lib/chef/run_context/cookbook_compiler.rb2
-rw-r--r--lib/chef/run_lock.rb6
-rw-r--r--lib/chef/search/query.rb11
-rw-r--r--lib/chef/server_api.rb4
-rw-r--r--lib/chef/shell.rb57
-rw-r--r--lib/chef/shell/ext.rb24
-rw-r--r--lib/chef/shell/shell_session.rb4
-rw-r--r--lib/chef/train_transport.rb109
-rw-r--r--lib/chef/util/backup.rb2
-rw-r--r--lib/chef/util/diff.rb6
-rw-r--r--lib/chef/util/dsc/configuration_generator.rb63
-rw-r--r--lib/chef/util/dsc/lcm_output_parser.rb11
-rw-r--r--lib/chef/util/dsc/local_configuration_manager.rb33
-rw-r--r--lib/chef/util/dsc/resource_store.rb16
-rw-r--r--lib/chef/util/powershell/cmdlet.rb173
-rw-r--r--lib/chef/util/powershell/cmdlet_result.rb61
-rw-r--r--lib/chef/util/powershell/ps_credential.rb32
-rw-r--r--lib/chef/util/threaded_job_queue.rb2
-rw-r--r--lib/chef/version.rb2
-rw-r--r--lib/chef/win32/api/file.rb4
-rw-r--r--lib/chef/win32/file.rb2
-rw-r--r--lib/chef/win32/registry.rb3
-rw-r--r--lib/chef/win32/security/sid.rb2
-rw-r--r--lib/chef/win32/unicode.rb2
-rw-r--r--omnibus/Gemfile.lock126
-rw-r--r--omnibus/config/projects/chef.rb3
-rw-r--r--omnibus/config/software/more-ruby-cleanup.rb6
-rw-r--r--omnibus/files/openssl-customization/windows/ssl_env_hack.rb2
-rw-r--r--omnibus/omnibus-test.ps115
-rw-r--r--omnibus/omnibus-test.sh2
-rw-r--r--omnibus/omnibus.rb7
-rw-r--r--omnibus_overrides.rb12
-rw-r--r--spec/data/shef-config.rb2
-rw-r--r--spec/data/ssl/binary/chef-rspec-der.certbin0 -> 1174 bytes
-rw-r--r--spec/data/ssl/binary/chef-rspec-der.keybin0 -> 1191 bytes
-rw-r--r--spec/data/trusted_certs_empty/.gitkeep0
-rw-r--r--spec/data/trusted_certs_empty/README.md1
-rw-r--r--spec/functional/event_loggers/windows_eventlog_spec.rb11
-rw-r--r--spec/functional/mixin/powershell_out_spec.rb14
-rwxr-xr-xspec/functional/resource/aix_service_spec.rb4
-rwxr-xr-xspec/functional/resource/aixinit_service_spec.rb2
-rw-r--r--spec/functional/resource/apt_package_spec.rb10
-rw-r--r--spec/functional/resource/chocolatey_package_spec.rb6
-rw-r--r--spec/functional/resource/cron_spec.rb6
-rw-r--r--spec/functional/resource/dsc_script_spec.rb15
-rw-r--r--spec/functional/resource/insserv_spec.rb2
-rw-r--r--spec/functional/resource/mount_spec.rb12
-rw-r--r--spec/functional/resource/powershell_package_source_spec.rb107
-rw-r--r--spec/functional/resource/powershell_script_spec.rb71
-rw-r--r--spec/functional/resource/windows_certificate_spec.rb16
-rw-r--r--spec/functional/resource/windows_firewall_rule_spec.rb93
-rw-r--r--spec/functional/resource/windows_package_spec.rb46
-rw-r--r--spec/functional/resource/windows_share_spec.rb103
-rw-r--r--spec/functional/resource/windows_task_spec.rb31
-rw-r--r--spec/functional/resource/zypper_package_spec.rb11
-rw-r--r--spec/functional/util/powershell/cmdlet_spec.rb111
-rw-r--r--spec/functional/version_spec.rb6
-rw-r--r--spec/integration/client/client_spec.rb11
-rw-r--r--spec/integration/client/exit_code_spec.rb5
-rw-r--r--spec/integration/client/ipv6_spec.rb2
-rw-r--r--spec/integration/compliance/compliance_spec.rb81
-rw-r--r--spec/integration/knife/client_key_create_spec.rb2
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb2
-rw-r--r--spec/integration/knife/node_create_spec.rb2
-rw-r--r--spec/integration/knife/node_environment_set_spec.rb2
-rw-r--r--spec/integration/knife/node_run_list_add_spec.rb8
-rw-r--r--spec/integration/knife/node_run_list_remove_spec.rb2
-rw-r--r--spec/integration/knife/node_run_list_set_spec.rb2
-rw-r--r--spec/integration/knife/node_show_spec.rb2
-rw-r--r--spec/integration/ohai/ohai_spec.rb61
-rw-r--r--spec/integration/recipes/notifies_spec.rb2
-rw-r--r--spec/integration/recipes/provider_choice.rb4
-rw-r--r--spec/integration/recipes/recipe_dsl_spec.rb1
-rw-r--r--spec/integration/recipes/remote_directory.rb2
-rw-r--r--spec/integration/solo/solo_spec.rb10
-rw-r--r--spec/scripts/ssl-serve.rb47
-rw-r--r--spec/spec_helper.rb7
-rw-r--r--spec/stress/win32/file_spec.rb2
-rw-r--r--spec/support/chef_helpers.rb4
-rw-r--r--spec/support/lib/chef/resource/cat.rb2
-rw-r--r--spec/support/lib/chef/resource/one_two_three_four.rb2
-rw-r--r--spec/support/matchers/leak.rb4
-rw-r--r--spec/support/mock/constant.rb52
-rw-r--r--spec/support/mock/platform.rb40
-rw-r--r--spec/support/platform_helpers.rb32
-rw-r--r--spec/support/shared/functional/securable_resource.rb135
-rw-r--r--spec/support/shared/functional/win32_service.rb2
-rw-r--r--spec/support/shared/unit/application_dot_d.rb8
-rw-r--r--spec/support/shared/unit/knife_shared.rb2
-rw-r--r--spec/support/shared/unit/script_resource.rb8
-rw-r--r--spec/support/shared/unit/windows_script_resource.rb2
-rw-r--r--spec/tiny_server.rb1
-rw-r--r--spec/unit/chef_fs/config_spec.rb2
-rw-r--r--spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb2
-rw-r--r--spec/unit/chef_fs/path_util_spec.rb2
-rw-r--r--spec/unit/client_spec.rb17
-rw-r--r--spec/unit/compliance/fetcher/automate_spec.rb134
-rw-r--r--spec/unit/compliance/fetcher/chef_server_spec.rb93
-rw-r--r--spec/unit/compliance/reporter/automate_spec.rb427
-rw-r--r--spec/unit/compliance/reporter/chef_server_automate_spec.rb177
-rw-r--r--spec/unit/compliance/reporter/compliance_enforcer_spec.rb48
-rw-r--r--spec/unit/compliance/runner_spec.rb168
-rw-r--r--spec/unit/cookbook/synchronizer_spec.rb4
-rw-r--r--spec/unit/cookbook_spec.rb4
-rw-r--r--spec/unit/data_collector/config_validation_spec.rb208
-rw-r--r--spec/unit/data_collector_spec.rb117
-rw-r--r--spec/unit/dsl/declare_resource_spec.rb2
-rw-r--r--spec/unit/file_access_control_spec.rb2
-rw-r--r--spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb22
-rw-r--r--spec/unit/http/ssl_policies_spec.rb175
-rw-r--r--spec/unit/knife/bootstrap_spec.rb28
-rw-r--r--spec/unit/knife/client_create_spec.rb4
-rw-r--r--spec/unit/knife/configure_client_spec.rb10
-rw-r--r--spec/unit/knife/configure_spec.rb6
-rw-r--r--spec/unit/knife/cookbook_delete_spec.rb4
-rw-r--r--spec/unit/knife/cookbook_download_spec.rb4
-rw-r--r--spec/unit/knife/cookbook_list_spec.rb4
-rw-r--r--spec/unit/knife/cookbook_metadata_spec.rb6
-rw-r--r--spec/unit/knife/core/node_editor_spec.rb2
-rw-r--r--spec/unit/knife/environment_compare_spec.rb6
-rw-r--r--spec/unit/knife/supermarket_download_spec.rb16
-rw-r--r--spec/unit/knife/supermarket_list_spec.rb6
-rw-r--r--spec/unit/knife/supermarket_search_spec.rb2
-rw-r--r--spec/unit/knife/tag_create_spec.rb2
-rw-r--r--spec/unit/knife/tag_delete_spec.rb2
-rw-r--r--spec/unit/knife/user_create_spec.rb2
-rw-r--r--spec/unit/lwrp_spec.rb6
-rw-r--r--spec/unit/mixin/deep_merge_spec.rb15
-rw-r--r--spec/unit/mixin/openssl_helper_spec.rb9
-rw-r--r--spec/unit/mixin/powershell_exec_spec.rb45
-rw-r--r--spec/unit/mixin/powershell_out_spec.rb14
-rw-r--r--spec/unit/mixin/securable_spec.rb4
-rw-r--r--spec/unit/mixin/which.rb2
-rw-r--r--spec/unit/monkey_patches/uri_spec.rb34
-rw-r--r--spec/unit/node/immutable_collections_spec.rb4
-rw-r--r--spec/unit/platform/query_helpers_spec.rb23
-rw-r--r--spec/unit/provider/dsc_resource_spec.rb37
-rw-r--r--spec/unit/provider/dsc_script_spec.rb2
-rw-r--r--spec/unit/provider/group/windows_spec.rb6
-rw-r--r--spec/unit/provider/group_spec.rb2
-rw-r--r--spec/unit/provider/mount/linux_spec.rb10
-rw-r--r--spec/unit/provider/mount/mount_spec.rb31
-rw-r--r--spec/unit/provider/mount/solaris_spec.rb2
-rw-r--r--spec/unit/provider/mount/windows_spec.rb1
-rw-r--r--spec/unit/provider/mount_spec.rb31
-rw-r--r--spec/unit/provider/package/chocolatey_spec.rb5
-rw-r--r--spec/unit/provider/package/powershell_spec.rb182
-rw-r--r--spec/unit/provider/package/zypper_spec.rb25
-rw-r--r--spec/unit/provider/package_spec.rb4
-rw-r--r--spec/unit/provider/powershell_script_spec.rb11
-rw-r--r--spec/unit/provider/route_spec.rb2
-rw-r--r--spec/unit/provider/subversion_spec.rb3
-rw-r--r--spec/unit/provider/systemd_unit_spec.rb2
-rw-r--r--spec/unit/provider/user_spec.rb8
-rw-r--r--spec/unit/provider/windows_env_spec.rb52
-rw-r--r--spec/unit/provider/windows_path_spec.rb17
-rw-r--r--spec/unit/provider/windows_task_spec.rb13
-rw-r--r--spec/unit/provider_resolver_spec.rb885
-rw-r--r--spec/unit/recipe_spec.rb2
-rw-r--r--spec/unit/resource/breakpoint_spec.rb2
-rw-r--r--spec/unit/resource/build_essential_spec.rb12
-rw-r--r--spec/unit/resource/chef_client_config_spec.rb137
-rw-r--r--spec/unit/resource/chef_client_systemd_timer_spec.rb37
-rw-r--r--spec/unit/resource/data/InstallHistory_with_CLT.plist92
-rw-r--r--spec/unit/resource/data/InstallHistory_without_CLT.plist38
-rw-r--r--spec/unit/resource/ifconfig_spec.rb12
-rw-r--r--spec/unit/resource/mount_spec.rb23
-rw-r--r--spec/unit/resource/osx_profile_spec.rb68
-rw-r--r--spec/unit/resource/powershell_package_source_spec.rb40
-rw-r--r--spec/unit/resource/powershell_script_spec.rb78
-rw-r--r--spec/unit/resource/rhsm_register_spec.rb74
-rw-r--r--spec/unit/resource/service_spec.rb4
-rw-r--r--spec/unit/resource/solaris_package_spec.rb18
-rw-r--r--spec/unit/resource/windows_certificate_spec.rb12
-rw-r--r--spec/unit/resource/windows_uac_spec.rb2
-rw-r--r--spec/unit/resource/windows_user_privilege_spec.rb55
-rw-r--r--spec/unit/resource_inspector_spec.rb6
-rw-r--r--spec/unit/runner_spec.rb3
-rw-r--r--spec/unit/shell_spec.rb4
-rw-r--r--spec/unit/train_transport_spec.rb27
-rw-r--r--spec/unit/util/dsc/configuration_generator_spec.rb79
-rw-r--r--spec/unit/util/dsc/local_configuration_manager_spec.rb62
-rw-r--r--spec/unit/util/powershell/cmdlet_spec.rb106
-rw-r--r--tasks/announce.rb51
-rwxr-xr-xtasks/bin/run_external_test2
-rwxr-xr-xtasks/docs.rb55
-rw-r--r--tasks/rspec.rb4
-rw-r--r--tasks/templates/release.md.erb34
1184 files changed, 15457 insertions, 6577 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index b2f0d22c68..f91b6462e1 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -1,8 +1,5 @@
# Documentation available at https://expeditor.chef.io/docs/getting-started/
---
-# the name we use for this project when interacting with expeditor chatbot
-project:
- alias: chef-16
# The name of the product keys for this product (from mixlib-install)
product_key:
@@ -50,11 +47,11 @@ github:
# for building.
release_branch:
- master:
+ version_constraint: 17*
+ - chef-16:
version_constraint: 16*
- chef-15:
version_constraint: 15*
- - chef-14:
- version_constraint: 14*
changelog:
rollup_header: Changes not yet released to stable
diff --git a/.expeditor/release.omnibus.yml b/.expeditor/release.omnibus.yml
index 0d8a21dd3c..502380e4df 100644
--- a/.expeditor/release.omnibus.yml
+++ b/.expeditor/release.omnibus.yml
@@ -29,6 +29,7 @@ builder-to-testers-map:
- el-7-ppc64le
el-7-s390x:
- el-7-s390x
+ - el-8-s390x
el-7-x86_64:
- el-7-x86_64
- el-8-x86_64
@@ -43,15 +44,16 @@ builder-to-testers-map:
- mac_os_x-11.0-x86_64
sles-12-s390x:
- sles-12-s390x
+ - sles-15-s390x
sles-12-x86_64:
- sles-12-x86_64
- sles-15-x86_64
sles-15-aarch64:
- sles-15-aarch64
-# solaris2-5.11-i386:
-# - solaris2-5.11-i386
-# solaris2-5.11-sparc:
-# - solaris2-5.11-sparc
+ solaris2-5.11-i386:
+ - solaris2-5.11-i386
+ solaris2-5.11-sparc:
+ - solaris2-5.11-sparc
ubuntu-18.04-aarch64:
- ubuntu-18.04-aarch64
- ubuntu-20.04-aarch64
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
index 34a2dee47d..272c3ad8af 100644
--- a/.expeditor/verify.pipeline.yml
+++ b/.expeditor/verify.pipeline.yml
@@ -7,7 +7,7 @@ expeditor:
retry:
automatic:
limit: 1
- timeout_in_minutes: 30
+ timeout_in_minutes: 45
steps:
@@ -18,7 +18,7 @@ steps:
- label: "Integration Ubuntu 18.04 :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:integration
expeditor:
executor:
@@ -31,7 +31,7 @@ steps:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- apt-get update -y
- apt-get install -y cron locales # needed for functional tests to pass
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:functional
expeditor:
executor:
@@ -42,7 +42,7 @@ steps:
- label: "Unit Ubuntu 18.04 :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:unit
- bundle exec rake component_specs
expeditor:
@@ -53,7 +53,7 @@ steps:
- label: "Integration Ubuntu 20.04 :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:integration
expeditor:
executor:
@@ -66,7 +66,7 @@ steps:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- apt-get update -y
- apt-get install -y cron locales # needed for functional tests to pass
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:functional
expeditor:
executor:
@@ -77,7 +77,7 @@ steps:
- label: "Unit Ubuntu 20.04 :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:unit
- bundle exec rake component_specs
expeditor:
@@ -88,7 +88,7 @@ steps:
- label: "Integration CentOS 7 :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:integration
expeditor:
executor:
@@ -100,7 +100,7 @@ steps:
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- yum install -y crontabs e2fsprogs util-linux
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:functional
expeditor:
executor:
@@ -111,7 +111,7 @@ steps:
- label: "Unit CentOS 7 :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:unit
- bundle exec rake component_specs
expeditor:
@@ -123,7 +123,7 @@ steps:
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- zypper install -y cron insserv-compat
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:integration
expeditor:
executor:
@@ -135,7 +135,7 @@ steps:
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- zypper install -y cronie insserv-compat
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:functional
expeditor:
executor:
@@ -147,7 +147,7 @@ steps:
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- zypper install -y cron insserv-compat
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:unit
- bundle exec rake component_specs
expeditor:
@@ -158,7 +158,7 @@ steps:
- label: "Integration Fedora :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:integration
expeditor:
executor:
@@ -170,7 +170,7 @@ steps:
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- yum install -y crontabs e2fsprogs util-linux
- - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - cd /workdir; bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:functional
expeditor:
executor:
@@ -184,7 +184,7 @@ steps:
- label: "Unit Fedora :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake spec:unit
- bundle exec rake component_specs
expeditor:
@@ -245,7 +245,7 @@ steps:
- label: "Chefstyle :ruby: 2.6"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen ruby_prof
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package ruby_prof
- bundle exec rake style
expeditor:
executor:
@@ -255,7 +255,7 @@ steps:
- label: "Integration :ruby: 2.6"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:integration
expeditor:
executor:
@@ -268,7 +268,7 @@ steps:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- apt-get update -y
- apt-get install -y cron locales net-tools # needed for functional tests to pass
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:functional
expeditor:
executor:
@@ -279,7 +279,7 @@ steps:
- label: "Unit :ruby: 2.6"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec:unit
- bundle exec rake component_specs
expeditor:
@@ -294,7 +294,7 @@ steps:
- label: "chef-sugar gem :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec tasks/bin/run_external_test chef/chef-sugar master rake
expeditor:
executor:
@@ -304,7 +304,7 @@ steps:
- label: "chef-zero gem :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec tasks/bin/run_external_test chef/chef-zero master rake pedant
expeditor:
executor:
@@ -317,7 +317,7 @@ steps:
- label: "cheffish gem :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec tasks/bin/run_external_test chef/cheffish master rake spec
expeditor:
executor:
@@ -327,7 +327,7 @@ steps:
- label: "chefspec gem :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec tasks/bin/run_external_test chefspec/chefspec master rake
expeditor:
executor:
@@ -337,7 +337,7 @@ steps:
- label: "knife-windows gem :ruby: 2.7"
commands:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec tasks/bin/run_external_test chef/knife-windows master rake spec
expeditor:
executor:
@@ -349,7 +349,7 @@ steps:
- /workdir/scripts/bk_tests/bk_container_prep.sh
- apt-get update -y
- apt-get install -y graphviz
- - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package docgen
+ - bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec tasks/bin/run_external_test berkshelf/berkshelf master rake
expeditor:
executor:
@@ -436,11 +436,11 @@ steps:
privileged: true
single-use: true
-- label: "Kitchen: Debian 8"
+- label: "Kitchen: Ubuntu 20.10"
commands:
- scripts/bk_tests/bk_linux_exec.sh
- cd kitchen-tests
- - /opt/omnibus-toolchain/bin/bundle exec kitchen test end-to-end-debian-8
+ - /opt/omnibus-toolchain/bin/bundle exec kitchen test end-to-end-ubuntu-2010
artifact_paths:
- $PWD/.kitchen/logs/kitchen.log
env:
@@ -541,6 +541,21 @@ steps:
privileged: true
single-use: true
+- label: "Kitchen: Oracle Linux 8"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - /opt/omnibus-toolchain/bin/bundle exec kitchen test end-to-end-oraclelinux-8
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
- label: "Kitchen: Fedora latest"
commands:
- scripts/bk_tests/bk_linux_exec.sh
@@ -605,6 +620,7 @@ steps:
- label: ":habicat: Windows plan"
commands:
- ./scripts/ci/verify-plan.ps1
+ timeout_in_minutes: 60
expeditor:
executor:
windows:
diff --git a/.gitignore b/.gitignore
index d63295d803..fdf31a58e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,10 +86,10 @@ ext/win32-eventlog/chef-log.man
distro/powershell/chef/chef.psm1
# tool logs
-ext/win32-eventlog/mkmf.log
+mkmf.log
# ignore byebug command history file.
.byebug_history
# our custom dictionary pulled from https://github.com/chef/chef_dictionary/
-chef_dictionary.txt \ No newline at end of file
+chef_dictionary.txt
diff --git a/.rubocop.yml b/.rubocop.yml
index b587000ad4..0270949244 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -30,3 +30,11 @@ Lint/IneffectiveAccessModifier:
Enabled: false
Lint/ShadowedException:
Enabled: false
+
+# set additional paths
+Chef/Ruby/UnlessDefinedRequire:
+ Include:
+ - 'lib/**/*'
+ - 'chef-bin/**/*'
+ - 'chef-config/lib/**/*'
+ - 'chef-utils/lib/**/*'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index affbff714b..b4f92296bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,51 +1,283 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
-<!-- latest_release 16.5.26 -->
-## [v16.5.26](https://github.com/chef/chef/tree/v16.5.26) (2020-09-01)
+<!-- latest_release 17.0.0 -->
+## [v17.0.0](https://github.com/chef/chef/tree/v17.0.0) (2020-12-19)
#### Merged Pull Requests
-- Remove duplicate requires in the Provider class [#10369](https://github.com/chef/chef/pull/10369) ([tas50](https://github.com/tas50))
+- Bump Chef Infra to 17 [#10760](https://github.com/chef/chef/pull/10760) ([tas50](https://github.com/tas50))
<!-- latest_release -->
-<!-- release_rollup since=16.4.41 -->
+<!-- release_rollup since=16.8.14 -->
### Changes not yet released to stable
#### Merged Pull Requests
-- Remove duplicate requires in the Provider class [#10369](https://github.com/chef/chef/pull/10369) ([tas50](https://github.com/tas50)) <!-- 16.5.26 -->
-- More updates to the chef_client_* resources [#10362](https://github.com/chef/chef/pull/10362) ([tas50](https://github.com/tas50)) <!-- 16.5.25 -->
-- Fixed mount Resource for bind mounts is not idempotent. [#10171](https://github.com/chef/chef/pull/10171) ([antima-gupta](https://github.com/antima-gupta)) <!-- 16.5.24 -->
-- Update InSpec to 4.22.22 [#10363](https://github.com/chef/chef/pull/10363) ([tas50](https://github.com/tas50)) <!-- 16.5.23 -->
-- chef_client_launchd: reorder properties and fix log permissions [#10361](https://github.com/chef/chef/pull/10361) ([tas50](https://github.com/tas50)) <!-- 16.5.22 -->
-- Improve input handling and validation in chef_client_launchd [#10357](https://github.com/chef/chef/pull/10357) ([tas50](https://github.com/tas50)) <!-- 16.5.21 -->
-- Add back nice functionality to chef_client_cron [#10358](https://github.com/chef/chef/pull/10358) ([tas50](https://github.com/tas50)) <!-- 16.5.20 -->
-- Validate nice values in the launchd resource [#10359](https://github.com/chef/chef/pull/10359) ([tas50](https://github.com/tas50)) <!-- 16.5.19 -->
-- more config specs cleanup &amp; remove deprecated from knife config list [#10351](https://github.com/chef/chef/pull/10351) ([vsingh-msys](https://github.com/vsingh-msys)) <!-- 16.5.18 -->
-- Update Ohai to 16.4.13 [#10353](https://github.com/chef/chef/pull/10353) ([tas50](https://github.com/tas50)) <!-- 16.5.17 -->
-- Fix habitat test script [#10350](https://github.com/chef/chef/pull/10350) ([phiggins](https://github.com/phiggins)) <!-- 16.5.16 -->
-- Add initial take at chef_client_launchd [#10348](https://github.com/chef/chef/pull/10348) ([tas50](https://github.com/tas50)) <!-- 16.5.15 -->
-- Bump deps and resolve new Chefstyle warnings [#10349](https://github.com/chef/chef/pull/10349) ([tas50](https://github.com/tas50)) <!-- 16.5.14 -->
-- Fix some CI failures [#10347](https://github.com/chef/chef/pull/10347) ([phiggins](https://github.com/phiggins)) <!-- 16.5.13 -->
-- Fix dll copying in Gemfile to remove Dir.pwd [#10325](https://github.com/chef/chef/pull/10325) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 16.5.12 -->
-- knife config list-profiles UI with tty-table [#10341](https://github.com/chef/chef/pull/10341) ([vsingh-msys](https://github.com/vsingh-msys)) <!-- 16.5.11 -->
-- make &#39;knife config&#39; options shorter/easier [#10346](https://github.com/chef/chef/pull/10346) ([vsingh-msys](https://github.com/vsingh-msys)) <!-- 16.5.10 -->
-- Add macOS 11.0 (Big Sur) packages [#10332](https://github.com/chef/chef/pull/10332) ([tas50](https://github.com/tas50)) <!-- 16.5.9 -->
-- separate omnibus rspec path from options [#10343](https://github.com/chef/chef/pull/10343) ([mwrock](https://github.com/mwrock)) <!-- 16.5.8 -->
-- Start building S390x packages again [#10338](https://github.com/chef/chef/pull/10338) ([btm](https://github.com/btm)) <!-- 16.5.7 -->
-- Avoid knife ssh freeze on windows [#9482](https://github.com/chef/chef/pull/9482) ([dheerajd-msys](https://github.com/dheerajd-msys)) <!-- 16.5.6 -->
-- fix chocolatey and x86 windows omnibus builds [#10339](https://github.com/chef/chef/pull/10339) ([mwrock](https://github.com/mwrock)) <!-- 16.5.5 -->
-- Bump all deps to the latest for the require optimizations [#10337](https://github.com/chef/chef/pull/10337) ([tas50](https://github.com/tas50)) <!-- 16.5.4 -->
-- New exit code to signal chef-client exits due to configuration errors [#10302](https://github.com/chef/chef/pull/10302) ([NaomiReeves](https://github.com/NaomiReeves)) <!-- 16.5.3 -->
-- Simplify macos detection in specs to include big sur [#10335](https://github.com/chef/chef/pull/10335) ([tas50](https://github.com/tas50)) <!-- 16.5.2 -->
-- Add new chef_client_trusted_certificate resource [#10331](https://github.com/chef/chef/pull/10331) ([tas50](https://github.com/tas50)) <!-- 16.5.0 -->
+- Bump Chef Infra to 17 [#10760](https://github.com/chef/chef/pull/10760) ([tas50](https://github.com/tas50)) <!-- 17.0.0 -->
+- Update links to Compliance Phase documentation in log messages. [#10755](https://github.com/chef/chef/pull/10755) ([phiggins](https://github.com/phiggins)) <!-- 16.9.2 -->
+- Fix failures in ssl handler [#10751](https://github.com/chef/chef/pull/10751) ([phiggins](https://github.com/phiggins)) <!-- 16.9.1 -->
+- Cleanup bootstrap&#39;s trusted_certs_dir tests. [#10754](https://github.com/chef/chef/pull/10754) ([phiggins](https://github.com/phiggins)) <!-- 16.9.0 -->
+- Remove old test script. [#10746](https://github.com/chef/chef/pull/10746) ([phiggins](https://github.com/phiggins)) <!-- 16.8.19 -->
+- Update train to 3.4.4 [#10745](https://github.com/chef/chef/pull/10745) ([tas50](https://github.com/tas50)) <!-- 16.8.19 -->
+- locale: Update the locale-gen timeout to 1800s [#10743](https://github.com/chef/chef/pull/10743) ([tas50](https://github.com/tas50)) <!-- 16.8.18 -->
+- Add audit cookbook&#39;s chef_node_attribute_enabled to Compliance Phase. [#10735](https://github.com/chef/chef/pull/10735) ([phiggins](https://github.com/phiggins)) <!-- 16.8.17 -->
+- Improve our automated resource documentation generation [#10739](https://github.com/chef/chef/pull/10739) ([tas50](https://github.com/tas50)) <!-- 16.8.16 -->
+- knife bootstrap: Windows Trusted cert path slashes fix [#10740](https://github.com/chef/chef/pull/10740) ([axelrtgs](https://github.com/axelrtgs)) <!-- 16.8.15 -->
<!-- release_rollup -->
<!-- latest_stable_release -->
+## [v16.8.14](https://github.com/chef/chef/tree/v16.8.14) (2020-12-12)
+
+#### Merged Pull Requests
+- Bump libarchive to 3.5.0 [#10730](https://github.com/chef/chef/pull/10730) ([tas50](https://github.com/tas50))
+- Update openSSL to 1.0.2x [#10732](https://github.com/chef/chef/pull/10732) ([tas50](https://github.com/tas50))
+- Update libiconv to 1.16 [#10731](https://github.com/chef/chef/pull/10731) ([tas50](https://github.com/tas50))
+- Raise error and retry with PTY on sudo password prompt [#10728](https://github.com/chef/chef/pull/10728) ([rveznaver](https://github.com/rveznaver))
+- Fix broken code in compliance runner&#39;s send_report. [#10733](https://github.com/chef/chef/pull/10733) ([phiggins](https://github.com/phiggins))
+<!-- latest_stable_release -->
+
+## [v16.8.9](https://github.com/chef/chef/tree/v16.8.9) (2020-12-11)
+
+#### Merged Pull Requests
+- Resolve new spacing offenses in RuboCop 1.4 [#10691](https://github.com/chef/chef/pull/10691) ([tas50](https://github.com/tas50))
+- Use URI::DEFAULT_PARSER.make_regexp instead of URI.regexp [#10674](https://github.com/chef/chef/pull/10674) ([tas50](https://github.com/tas50))
+- Update the Docker file to use the RHEL 7 package [#10700](https://github.com/chef/chef/pull/10700) ([tas50](https://github.com/tas50))
+- replace usages of Cmdlet class with powershell_exec [#10683](https://github.com/chef/chef/pull/10683) ([mwrock](https://github.com/mwrock))
+- Enable git cache to speed up builds [#10689](https://github.com/chef/chef/pull/10689) ([tas50](https://github.com/tas50))
+- Add back macOS builds to the omnibus pipeline [#10701](https://github.com/chef/chef/pull/10701) ([tas50](https://github.com/tas50))
+- Update changelog with missing updates from previous prs [#10703](https://github.com/chef/chef/pull/10703) ([nkierpiec](https://github.com/nkierpiec))
+- Pin our InSpec version and use Chefstyle from rubygems for now [#10702](https://github.com/chef/chef/pull/10702) ([tas50](https://github.com/tas50))
+- Allow remote_file consider certificates stored under /etc/chef/trusted_certs [#10704](https://github.com/chef/chef/pull/10704) ([kapilchouhan99](https://github.com/kapilchouhan99))
+- Add new Compliance Phase replicating the functionality previously in the audit cookbook [#10547](https://github.com/chef/chef/pull/10547) ([phiggins](https://github.com/phiggins))
+- only test dsc_script on 64 bit and document that it will fail on 32 bit clients [#10708](https://github.com/chef/chef/pull/10708) ([mwrock](https://github.com/mwrock))
+- Switch back to chefstyle from github [#10709](https://github.com/chef/chef/pull/10709) ([tas50](https://github.com/tas50))
+- only run dsc_script functional tests on 64 bit ruby [#10710](https://github.com/chef/chef/pull/10710) ([mwrock](https://github.com/mwrock))
+- Update license-acceptance gem to 2.1.13 [#10714](https://github.com/chef/chef/pull/10714) ([tas50](https://github.com/tas50))
+- Update Train to 3.4.1 [#10716](https://github.com/chef/chef/pull/10716) ([tas50](https://github.com/tas50))
+- only run systemd unit tests on linux [#10718](https://github.com/chef/chef/pull/10718) ([mwrock](https://github.com/mwrock))
+- Fix for deprecation warning in knife ssh [#10717](https://github.com/chef/chef/pull/10717) ([kapilchouhan99](https://github.com/kapilchouhan99))
+- windows_certificate: Add exportable option to pfx certificate [#10711](https://github.com/chef/chef/pull/10711) ([dheerajd-msys](https://github.com/dheerajd-msys))
+- Update all deps to the latest [#10720](https://github.com/chef/chef/pull/10720) ([tas50](https://github.com/tas50))
+- Fix failing tests on Solaris / Enable Solaris builds again [#10719](https://github.com/chef/chef/pull/10719) ([mwrock](https://github.com/mwrock))
+- hostname: Avoid erroring out when hostname is not set on mac [#10724](https://github.com/chef/chef/pull/10724) ([lamont-granquist](https://github.com/lamont-granquist))
+- Update to InSpec 4.24 [#10726](https://github.com/chef/chef/pull/10726) ([tas50](https://github.com/tas50))
+
+## [v16.7.61](https://github.com/chef/chef/tree/v16.7.61) (2020-11-26)
+
+#### Merged Pull Requests
+- Minor updates for documentation generation [#10505](https://github.com/chef/chef/pull/10505) ([tas50](https://github.com/tas50))
+- Update powershell_script description to match docs site. [#10508](https://github.com/chef/chef/pull/10508) ([phiggins](https://github.com/phiggins))
+- More resource documentation improvement [#10509](https://github.com/chef/chef/pull/10509) ([tas50](https://github.com/tas50))
+- Resource documentation updates from review [#10510](https://github.com/chef/chef/pull/10510) ([tas50](https://github.com/tas50))
+- Avoid declaring arrays in loops [#10513](https://github.com/chef/chef/pull/10513) ([tas50](https://github.com/tas50))
+- Update docs generation task to handle Chef 16 required format [#10518](https://github.com/chef/chef/pull/10518) ([tas50](https://github.com/tas50))
+- Avoid a slow hash merge [#10517](https://github.com/chef/chef/pull/10517) ([tas50](https://github.com/tas50))
+- Avoid using complex regexes when we can use include? [#10516](https://github.com/chef/chef/pull/10516) ([tas50](https://github.com/tas50))
+- Fix bad formatting in a deprecation message [#10521](https://github.com/chef/chef/pull/10521) ([tas50](https://github.com/tas50))
+- Remove constantize method from Chef::Mixin::ConvertToClassName [#10522](https://github.com/chef/chef/pull/10522) ([tas50](https://github.com/tas50))
+- Add required_ruby_version to chef-utils and chef-config [#10525](https://github.com/chef/chef/pull/10525) ([tas50](https://github.com/tas50))
+- Added functional test for windows_package with remote_file_attributes. [#10526](https://github.com/chef/chef/pull/10526) ([antima-gupta](https://github.com/antima-gupta))
+- Simplify the ifconfig provides statement on Ubuntu/Debian [#10528](https://github.com/chef/chef/pull/10528) ([tas50](https://github.com/tas50))
+- Refactor ResourceGuardInterpreter [#10494](https://github.com/chef/chef/pull/10494) ([phiggins](https://github.com/phiggins))
+- Move the alias for attribute to property right into the property mixin [#10520](https://github.com/chef/chef/pull/10520) ([tas50](https://github.com/tas50))
+- Add bridge property to ifconfig for RHEL based systems [#10529](https://github.com/chef/chef/pull/10529) ([tas50](https://github.com/tas50))
+- Test ifconfig in Test Kitchen and add examples to the resource [#10530](https://github.com/chef/chef/pull/10530) ([tas50](https://github.com/tas50))
+- Use a native resource in the ifconfig debian provider [#10533](https://github.com/chef/chef/pull/10533) ([tas50](https://github.com/tas50))
+- Update train-core &amp; pull in the faster MSI installs [#10534](https://github.com/chef/chef/pull/10534) ([tas50](https://github.com/tas50))
+- Fix LWRP build cache [#10536](https://github.com/chef/chef/pull/10536) ([tecracer-theinen](https://github.com/tecracer-theinen))
+- Minor gem cleanup for chef-bin/chef-utils/chef-config [#10539](https://github.com/chef/chef/pull/10539) ([tas50](https://github.com/tas50))
+- Remove the announcement rake task + minor task updates [#10540](https://github.com/chef/chef/pull/10540) ([tas50](https://github.com/tas50))
+- Remove the yard doc generation task / group [#10541](https://github.com/chef/chef/pull/10541) ([tas50](https://github.com/tas50))
+- Bump Ohai to 16.7 and cacerts to the latest [#10542](https://github.com/chef/chef/pull/10542) ([tas50](https://github.com/tas50))
+- ensure powershell_package commands are run with tls 1.2 [#10543](https://github.com/chef/chef/pull/10543) ([mwrock](https://github.com/mwrock))
+- Remove coderay and ffi-yajl-bench binstubs [#10544](https://github.com/chef/chef/pull/10544) ([tas50](https://github.com/tas50))
+- Remove unused monkeypatch on net/http. [#10548](https://github.com/chef/chef/pull/10548) ([phiggins](https://github.com/phiggins))
+- Remove an empty before block in a spec [#10550](https://github.com/chef/chef/pull/10550) ([tas50](https://github.com/tas50))
+- Remove references to monkeypatch method. [#10551](https://github.com/chef/chef/pull/10551) ([phiggins](https://github.com/phiggins))
+- Add Test Kitchen testing on Ubuntu 20.10 [#10553](https://github.com/chef/chef/pull/10553) ([tas50](https://github.com/tas50))
+- ifconfig is not compatible with Fedora 33 or later [#10555](https://github.com/chef/chef/pull/10555) ([tas50](https://github.com/tas50))
+- Add back Oracle 8 Test Kitchen testing [#10554](https://github.com/chef/chef/pull/10554) ([tas50](https://github.com/tas50))
+- Final batch of unified_mode providers [#10557](https://github.com/chef/chef/pull/10557) ([lamont-granquist](https://github.com/lamont-granquist))
+- Update InSpec to 4.23.15 [#10559](https://github.com/chef/chef/pull/10559) ([tas50](https://github.com/tas50))
+- Merge repetitive conditionals [#10558](https://github.com/chef/chef/pull/10558) ([tas50](https://github.com/tas50))
+- Mount resources not idempotent with label fixes [#10566](https://github.com/chef/chef/pull/10566) ([antima-gupta](https://github.com/antima-gupta))
+- Simplify a weird conditional in chef-config [#10560](https://github.com/chef/chef/pull/10560) ([tas50](https://github.com/tas50))
+- Improve the package docs generation + resolve rubocop warnings [#10567](https://github.com/chef/chef/pull/10567) ([tas50](https://github.com/tas50))
+- Correctly generate docs yaml files to include package warnings [#10569](https://github.com/chef/chef/pull/10569) ([tas50](https://github.com/tas50))
+- Improve resource documentation [#10570](https://github.com/chef/chef/pull/10570) ([tas50](https://github.com/tas50))
+- Fix some spelling / cookstyle errors in the git examples [#10575](https://github.com/chef/chef/pull/10575) ([tas50](https://github.com/tas50))
+- Remove support for nexentacore and opensolaris which are both a decade EOL [#10573](https://github.com/chef/chef/pull/10573) ([tas50](https://github.com/tas50))
+- Remove rspec_junit_formatter and rspec version pins [#10579](https://github.com/chef/chef/pull/10579) ([phiggins](https://github.com/phiggins))
+- Don&#39;t run rspec with documentation formatter. [#10578](https://github.com/chef/chef/pull/10578) ([phiggins](https://github.com/phiggins))
+- Update Ohai to 16.7.4 and win32-process to 0.9.0 [#10580](https://github.com/chef/chef/pull/10580) ([tas50](https://github.com/tas50))
+- Fix secret options in windows bootstrap [#10577](https://github.com/chef/chef/pull/10577) ([mwrock](https://github.com/mwrock))
+- Remove the provider_resolver specs that are not helpful [#10576](https://github.com/chef/chef/pull/10576) ([tas50](https://github.com/tas50))
+- Remove a few more files from our install artifact [#10581](https://github.com/chef/chef/pull/10581) ([tas50](https://github.com/tas50))
+- Remove the provides :package for solaris_package [#10572](https://github.com/chef/chef/pull/10572) ([tas50](https://github.com/tas50))
+- Fix download errors during knife bootstrap on windows due to lack of TLS 1.2 support [#10574](https://github.com/chef/chef/pull/10574) ([TimothyTitan](https://github.com/TimothyTitan))
+- Avoid a splat operator where we don&#39;t need one [#10583](https://github.com/chef/chef/pull/10583) ([tas50](https://github.com/tas50))
+- Simplify regexes by removing extra character classes [#10584](https://github.com/chef/chef/pull/10584) ([tas50](https://github.com/tas50))
+- Improve Windows resource performance by converting powershell_out usage to powershell_exec [#10545](https://github.com/chef/chef/pull/10545) ([mwrock](https://github.com/mwrock))
+- Update ohai to 16.7.9 and rspec to 3.10 [#10587](https://github.com/chef/chef/pull/10587) ([tas50](https://github.com/tas50))
+- Fix homebrew_update [#10586](https://github.com/chef/chef/pull/10586) ([phiggins](https://github.com/phiggins))
+- Freeze strings in chef-utils [#10590](https://github.com/chef/chef/pull/10590) ([tas50](https://github.com/tas50))
+- Namespace ResourceInspector to avoid conflicts with Inspec&#39;s [#10595](https://github.com/chef/chef/pull/10595) ([phiggins](https://github.com/phiggins))
+- Improve auto generated resource docs [#10596](https://github.com/chef/chef/pull/10596) ([tas50](https://github.com/tas50))
+- Use tr where we don&#39;t need gsub and a regex [#10597](https://github.com/chef/chef/pull/10597) ([tas50](https://github.com/tas50))
+- Remove duplicate Gemfile gems + update ohai to 16.7.13 [#10602](https://github.com/chef/chef/pull/10602) ([tas50](https://github.com/tas50))
+- Use .compact instead of .select/.reject to remove nils [#10601](https://github.com/chef/chef/pull/10601) ([tas50](https://github.com/tas50))
+- Update to the new chefstyle [#10603](https://github.com/chef/chef/pull/10603) ([tas50](https://github.com/tas50))
+- Collapse several duplicate branches down [#10604](https://github.com/chef/chef/pull/10604) ([tas50](https://github.com/tas50))
+- Collapse more duplicate branches [#10605](https://github.com/chef/chef/pull/10605) ([tas50](https://github.com/tas50))
+- Use ||= where we can [#10609](https://github.com/chef/chef/pull/10609) ([tas50](https://github.com/tas50))
+- Don&#39;t uses regexes in splits when we don&#39;t need to [#10610](https://github.com/chef/chef/pull/10610) ([tas50](https://github.com/tas50))
+- Added deprecation warning for enforce_path_sanity [#10613](https://github.com/chef/chef/pull/10613) ([kapilchouhan99](https://github.com/kapilchouhan99))
+- Cleanup Chef::JSONCompat [#10612](https://github.com/chef/chef/pull/10612) ([phiggins](https://github.com/phiggins))
+- chef_client_config: Resolve invalid configuration in client.rb [#10608](https://github.com/chef/chef/pull/10608) ([srb3](https://github.com/srb3))
+- Update Ohai to 16.7.18 and Fauxhai to 8.4 [#10619](https://github.com/chef/chef/pull/10619) ([tas50](https://github.com/tas50))
+- Update the yaml we generate for resource documentation [#10622](https://github.com/chef/chef/pull/10622) ([tas50](https://github.com/tas50))
+- mount: Fixes for findmount output causing idempotency issues [#10614](https://github.com/chef/chef/pull/10614) ([antima-gupta](https://github.com/antima-gupta))
+- Add additional property coerce specs to mount [#10625](https://github.com/chef/chef/pull/10625) ([tas50](https://github.com/tas50))
+- provide a registry_key example that creates a multibyte binary value [#10630](https://github.com/chef/chef/pull/10630) ([mwrock](https://github.com/mwrock))
+- Fix ps specs [#10633](https://github.com/chef/chef/pull/10633) ([mwrock](https://github.com/mwrock))
+- Prevent failures generating docs [#10634](https://github.com/chef/chef/pull/10634) ([tas50](https://github.com/tas50))
+- Change how zypper_package calculates the candidate_version [#10631](https://github.com/chef/chef/pull/10631) ([lamont-granquist](https://github.com/lamont-granquist))
+- knife bootstrap deps require net/ssh [#10638](https://github.com/chef/chef/pull/10638) ([vsingh-msys](https://github.com/vsingh-msys))
+- Update omnibus to remove the chef-sugar dep [#10629](https://github.com/chef/chef/pull/10629) ([tas50](https://github.com/tas50))
+- mount: changes to fix solaris test failure [#10643](https://github.com/chef/chef/pull/10643) ([antima-gupta](https://github.com/antima-gupta))
+- Fix group output and windows support [#10642](https://github.com/chef/chef/pull/10642) ([jaymzh](https://github.com/jaymzh))
+- pull in v0.2.1 of powershell shim that fixes .net resolver [#10644](https://github.com/chef/chef/pull/10644) ([mwrock](https://github.com/mwrock))
+- Fix zypper_package CI failures [#10648](https://github.com/chef/chef/pull/10648) ([lamont-granquist](https://github.com/lamont-granquist))
+- Fix idempotency issues in build_essential on the mac [#10647](https://github.com/chef/chef/pull/10647) ([tas50](https://github.com/tas50))
+- mount: Changes to fix creating multiple entries in fstab [#10472](https://github.com/chef/chef/pull/10472) ([antima-gupta](https://github.com/antima-gupta))
+- Remove pry-remote from the package [#10651](https://github.com/chef/chef/pull/10651) ([tas50](https://github.com/tas50))
+- Update fauxhai, chef-vault, and chefstyle to the latest [#10653](https://github.com/chef/chef/pull/10653) ([tas50](https://github.com/tas50))
+- Update mixlib-shellout to 3.2.2 [#10654](https://github.com/chef/chef/pull/10654) ([tas50](https://github.com/tas50))
+- update pwsh in powershell_exec to 7.1.0 and add comments explaining how to pull in updates [#10652](https://github.com/chef/chef/pull/10652) ([mwrock](https://github.com/mwrock))
+- user: Log what changed when updating a user [#10656](https://github.com/chef/chef/pull/10656) ([jaymzh](https://github.com/jaymzh))
+- Update the docs generation for the new format [#10659](https://github.com/chef/chef/pull/10659) ([tas50](https://github.com/tas50))
+- include password in guard inherited attributes [#10672](https://github.com/chef/chef/pull/10672) ([mwrock](https://github.com/mwrock))
+- Update ohai and win32-service to the latest [#10673](https://github.com/chef/chef/pull/10673) ([tas50](https://github.com/tas50))
+- Avoid ambiguous regexes [#10675](https://github.com/chef/chef/pull/10675) ([tas50](https://github.com/tas50))
+- Mount: Fixes for Mount resource changes broke specs on AIX [#10671](https://github.com/chef/chef/pull/10671) ([antima-gupta](https://github.com/antima-gupta))
+- bump ohai, win32-service, and omnibus deps [#10685](https://github.com/chef/chef/pull/10685) ([tas50](https://github.com/tas50))
+- Update Ohai to 16.7.37 [#10686](https://github.com/chef/chef/pull/10686) ([tas50](https://github.com/tas50))
+- Skip appx packaging on Windows [#10650](https://github.com/chef/chef/pull/10650) ([tas50](https://github.com/tas50))
+- Bump omnibus / omnibus-software to the latest [#10690](https://github.com/chef/chef/pull/10690) ([tas50](https://github.com/tas50))
+- Resolve NameError running mac_user resource [#10692](https://github.com/chef/chef/pull/10692) ([tas50](https://github.com/tas50))
+
+## [v16.6.14](https://github.com/chef/chef/tree/v16.6.14) (2020-10-14)
+
+#### Merged Pull Requests
+- Pull in Ohai 16.6 and train-core/train-winrm updates [#10474](https://github.com/chef/chef/pull/10474) ([tas50](https://github.com/tas50))
+- Update to the windows_audit_policy resource to fix a bug on failure-only auditing [#10473](https://github.com/chef/chef/pull/10473) ([chef-davin](https://github.com/chef-davin))
+- add ruby-3.0 hash methods to immutabilize_hash [#10475](https://github.com/chef/chef/pull/10475) ([lamont-granquist](https://github.com/lamont-granquist))
+- add interpreter arg to powershell_out allowing it to call pwsh.exe [#10478](https://github.com/chef/chef/pull/10478) ([mwrock](https://github.com/mwrock))
+- Update to Ruby 2.7.2 / Rubygems 3.1.4 [#10480](https://github.com/chef/chef/pull/10480) ([tas50](https://github.com/tas50))
+- Remove extra safe navigation [#10482](https://github.com/chef/chef/pull/10482) ([tas50](https://github.com/tas50))
+- add interpreter arg to powershell_exec allowing it to run powershell core [#10476](https://github.com/chef/chef/pull/10476) ([mwrock](https://github.com/mwrock))
+- fix specs on powershell v4 and below [#10484](https://github.com/chef/chef/pull/10484) ([mwrock](https://github.com/mwrock))
+- Update Ohai to 16.6.1 [#10486](https://github.com/chef/chef/pull/10486) ([tas50](https://github.com/tas50))
+- add interpreter to handle pwsh and powershell to powershell_script [#10488](https://github.com/chef/chef/pull/10488) ([mwrock](https://github.com/mwrock))
+- Changing ifconfig provider to reduce blank lines in redhat and debian ifconfigs [#10489](https://github.com/chef/chef/pull/10489) ([jmherbst](https://github.com/jmherbst))
+- Bump Chefstyle &amp; other deps [#10498](https://github.com/chef/chef/pull/10498) ([tas50](https://github.com/tas50))
+- provide powershell_exec functionality on x86 [#10495](https://github.com/chef/chef/pull/10495) ([mwrock](https://github.com/mwrock))
+- chef_client_config resource [#10365](https://github.com/chef/chef/pull/10365) ([tas50](https://github.com/tas50))
+- Update examples and descriptions for better automated documentation [#10500](https://github.com/chef/chef/pull/10500) ([tas50](https://github.com/tas50))
+- Update cacerts, ohai, and winrm to the latest [#10502](https://github.com/chef/chef/pull/10502) ([tas50](https://github.com/tas50))
+- Support for ohai target mode [#10418](https://github.com/chef/chef/pull/10418) ([lamont-granquist](https://github.com/lamont-granquist))
+
+## [v16.5.77](https://github.com/chef/chef/tree/v16.5.77) (2020-09-29)
+
+#### Merged Pull Requests
+- Add missing requires to chef/policy_builder/dynamic [#10446](https://github.com/chef/chef/pull/10446) ([tas50](https://github.com/tas50))
+- Pull in the new tty-table to unlock new license-acceptance [#10450](https://github.com/chef/chef/pull/10450) ([tas50](https://github.com/tas50))
+- Check for full names in Homebrew package info [#10360](https://github.com/chef/chef/pull/10360) ([ed-brex](https://github.com/ed-brex))
+- Remove unused method [#10449](https://github.com/chef/chef/pull/10449) ([007lva](https://github.com/007lva))
+- Fix examples markdown in chef_handler resource. [#10459](https://github.com/chef/chef/pull/10459) ([phiggins](https://github.com/phiggins))
+- Simplify Hash transforms &amp; minor code refactoring [#10447](https://github.com/chef/chef/pull/10447) ([vsingh-msys](https://github.com/vsingh-msys))
+- Update require gating to include chef-utils/chef-config &amp; gate more [#10451](https://github.com/chef/chef/pull/10451) ([tas50](https://github.com/tas50))
+- Use ChefUtils::Dist::Infra::PRODUCT for locale warning instead of &quot;Chef&quot; [#10461](https://github.com/chef/chef/pull/10461) ([ramereth](https://github.com/ramereth))
+- Preparing 16.5 hotfix patch to fix Workstation build issue [#10462](https://github.com/chef/chef/pull/10462) ([tyler-ball](https://github.com/tyler-ball))
+- autoload addressable/uri on :URI inside addressable module [#10464](https://github.com/chef/chef/pull/10464) ([mwrock](https://github.com/mwrock))
+- Remove unnecessary require. [#10465](https://github.com/chef/chef/pull/10465) ([phiggins](https://github.com/phiggins))
+- Use Ruby 2.6 endless Range syntax [#10463](https://github.com/chef/chef/pull/10463) ([007lva](https://github.com/007lva))
+- Bump dependencies to latest + resolve Chefstyle warning [#10468](https://github.com/chef/chef/pull/10468) ([tas50](https://github.com/tas50))
+
+## [v16.5.64](https://github.com/chef/chef/tree/v16.5.64) (2020-09-17)
+
+#### Merged Pull Requests
+- Add new chef_client_trusted_certificate resource [#10331](https://github.com/chef/chef/pull/10331) ([tas50](https://github.com/tas50))
+- Simplify macos detection in specs to include big sur [#10335](https://github.com/chef/chef/pull/10335) ([tas50](https://github.com/tas50))
+- New exit code to signal chef-client exits due to configuration errors [#10302](https://github.com/chef/chef/pull/10302) ([NaomiReeves](https://github.com/NaomiReeves))
+- Bump all deps to the latest for the require optimizations [#10337](https://github.com/chef/chef/pull/10337) ([tas50](https://github.com/tas50))
+- fix chocolatey and x86 windows omnibus builds [#10339](https://github.com/chef/chef/pull/10339) ([mwrock](https://github.com/mwrock))
+- Avoid knife ssh freeze on windows [#9482](https://github.com/chef/chef/pull/9482) ([dheerajd-msys](https://github.com/dheerajd-msys))
+- Start building S390x packages again [#10338](https://github.com/chef/chef/pull/10338) ([btm](https://github.com/btm))
+- separate omnibus rspec path from options [#10343](https://github.com/chef/chef/pull/10343) ([mwrock](https://github.com/mwrock))
+- Add macOS 11.0 (Big Sur) packages [#10332](https://github.com/chef/chef/pull/10332) ([tas50](https://github.com/tas50))
+- make &#39;knife config&#39; options shorter/easier [#10346](https://github.com/chef/chef/pull/10346) ([vsingh-msys](https://github.com/vsingh-msys))
+- knife config list-profiles UI with tty-table [#10341](https://github.com/chef/chef/pull/10341) ([vsingh-msys](https://github.com/vsingh-msys))
+- Fix dll copying in Gemfile to remove Dir.pwd [#10325](https://github.com/chef/chef/pull/10325) ([lamont-granquist](https://github.com/lamont-granquist))
+- Fix some CI failures [#10347](https://github.com/chef/chef/pull/10347) ([phiggins](https://github.com/phiggins))
+- Bump deps and resolve new Chefstyle warnings [#10349](https://github.com/chef/chef/pull/10349) ([tas50](https://github.com/tas50))
+- Add initial take at chef_client_launchd [#10348](https://github.com/chef/chef/pull/10348) ([tas50](https://github.com/tas50))
+- Fix habitat test script [#10350](https://github.com/chef/chef/pull/10350) ([phiggins](https://github.com/phiggins))
+- Update Ohai to 16.4.13 [#10353](https://github.com/chef/chef/pull/10353) ([tas50](https://github.com/tas50))
+- more config specs cleanup &amp; remove deprecated from knife config list [#10351](https://github.com/chef/chef/pull/10351) ([vsingh-msys](https://github.com/vsingh-msys))
+- Validate nice values in the launchd resource [#10359](https://github.com/chef/chef/pull/10359) ([tas50](https://github.com/tas50))
+- Add back nice functionality to chef_client_cron [#10358](https://github.com/chef/chef/pull/10358) ([tas50](https://github.com/tas50))
+- Improve input handling and validation in chef_client_launchd [#10357](https://github.com/chef/chef/pull/10357) ([tas50](https://github.com/tas50))
+- chef_client_launchd: reorder properties and fix log permissions [#10361](https://github.com/chef/chef/pull/10361) ([tas50](https://github.com/tas50))
+- Update InSpec to 4.22.22 [#10363](https://github.com/chef/chef/pull/10363) ([tas50](https://github.com/tas50))
+- Fixed mount Resource for bind mounts is not idempotent. [#10171](https://github.com/chef/chef/pull/10171) ([antima-gupta](https://github.com/antima-gupta))
+- More updates to the chef_client_* resources [#10362](https://github.com/chef/chef/pull/10362) ([tas50](https://github.com/tas50))
+- Remove duplicate requires in the Provider class [#10369](https://github.com/chef/chef/pull/10369) ([tas50](https://github.com/tas50))
+- chef_client_systemd_timer: Add the ability to set CPUQuota on the chef-client unit [#10381](https://github.com/chef/chef/pull/10381) ([tas50](https://github.com/tas50))
+- Update all deps to current [#10385](https://github.com/chef/chef/pull/10385) ([tas50](https://github.com/tas50))
+- Allow removing profiles in osx_profile on Big Sur [#10386](https://github.com/chef/chef/pull/10386) ([tas50](https://github.com/tas50))
+- Fix nil deep_merging [#10382](https://github.com/chef/chef/pull/10382) ([lamont-granquist](https://github.com/lamont-granquist))
+- Add a :reboot_delay property to the windows_ad_join resource [#10388](https://github.com/chef/chef/pull/10388) ([chef-davin](https://github.com/chef-davin))
+- Add --logfile to chef-apply command [#10389](https://github.com/chef/chef/pull/10389) ([tas50](https://github.com/tas50))
+- chef_client_launchd: create a launchd daemon to handle the client restart [#10390](https://github.com/chef/chef/pull/10390) ([tas50](https://github.com/tas50))
+- Resolve RuboCop Style/RedundantInterpolation warnings [#10394](https://github.com/chef/chef/pull/10394) ([tas50](https://github.com/tas50))
+- [data-collector] improved output_locations validation &amp; bug fixes [#10393](https://github.com/chef/chef/pull/10393) ([vsingh-msys](https://github.com/vsingh-msys))
+- Improve cli boot performance by prefering autoload over requires [#10383](https://github.com/chef/chef/pull/10383) ([mwrock](https://github.com/mwrock))
+- rhsm_register: Avoid potentially checking if we need to register twice [#10395](https://github.com/chef/chef/pull/10395) ([tas50](https://github.com/tas50))
+- Use include? to example strings when we don&#39;t need a regex [#10396](https://github.com/chef/chef/pull/10396) ([tas50](https://github.com/tas50))
+- Mock File.expand_path to fix window C:/ dir appended in absolute path [#10398](https://github.com/chef/chef/pull/10398) ([vsingh-msys](https://github.com/vsingh-msys))
+- Update Ohai to 16.5 [#10399](https://github.com/chef/chef/pull/10399) ([tas50](https://github.com/tas50))
+- Update openssl to 1.0.2w [#10402](https://github.com/chef/chef/pull/10402) ([tas50](https://github.com/tas50))
+- Remove a redundant spec loop [#10370](https://github.com/chef/chef/pull/10370) ([tas50](https://github.com/tas50))
+- Add Patents link to chef infra &amp; solo client [#10400](https://github.com/chef/chef/pull/10400) ([vsingh-msys](https://github.com/vsingh-msys))
+- autoload license_acceptance/acceptor in knife loading [#10405](https://github.com/chef/chef/pull/10405) ([mwrock](https://github.com/mwrock))
+- Enable s390x RHEL8 and SLES15 platforms [#10376](https://github.com/chef/chef/pull/10376) ([jaymalasinha](https://github.com/jaymalasinha))
+- Allow for license-acceptance 2.0 gem [#10406](https://github.com/chef/chef/pull/10406) ([tas50](https://github.com/tas50))
+- Allow cpu_quota values &gt; 100 [#10408](https://github.com/chef/chef/pull/10408) ([tas50](https://github.com/tas50))
+- Use __dir__ instead of getting the dir of __FILE__ [#10401](https://github.com/chef/chef/pull/10401) ([tas50](https://github.com/tas50))
+- Add an ohai timing test to find busted DNS on CI testers [#10371](https://github.com/chef/chef/pull/10371) ([lamont-granquist](https://github.com/lamont-granquist))
+- Update the windows_firewall_profile resource to fix NoMethodError [#10412](https://github.com/chef/chef/pull/10412) ([chef-davin](https://github.com/chef-davin))
+- Remove debug puts from snap_package [#10409](https://github.com/chef/chef/pull/10409) ([tas50](https://github.com/tas50))
+- Add system_name property to rhsm_register resource [#10413](https://github.com/chef/chef/pull/10413) ([jasonwbarnett](https://github.com/jasonwbarnett))
+- Update sysctl resource description to match reality [#10416](https://github.com/chef/chef/pull/10416) ([tas50](https://github.com/tas50))
+- allow the use of SIDs in windows securable resources [#10423](https://github.com/chef/chef/pull/10423) ([mwrock](https://github.com/mwrock))
+- Update the validation of the privilege property on the windows_user_privilege resource [#10422](https://github.com/chef/chef/pull/10422) ([tas50](https://github.com/tas50))
+- Remove the Ubuntu azure pipeline test [#10434](https://github.com/chef/chef/pull/10434) ([tas50](https://github.com/tas50))
+- Move dist implementation into chef-utils [#9834](https://github.com/chef/chef/pull/9834) ([bobchaos](https://github.com/bobchaos))
+- Add examples to the ohai resource [#10432](https://github.com/chef/chef/pull/10432) ([tas50](https://github.com/tas50))
+- Move TrainTransport to ChefConfig [#10436](https://github.com/chef/chef/pull/10436) ([lamont-granquist](https://github.com/lamont-granquist))
+- More resource documentation improvements [#10435](https://github.com/chef/chef/pull/10435) ([tas50](https://github.com/tas50))
+- Resolve Lint/RedundantRequireStatement &amp; Style/RedundantCondition warnings [#10437](https://github.com/chef/chef/pull/10437) ([tas50](https://github.com/tas50))
+- Speed up a openssl helper specs [#10438](https://github.com/chef/chef/pull/10438) ([tas50](https://github.com/tas50))
+- Resolve Style/RedundantSort warnings [#10439](https://github.com/chef/chef/pull/10439) ([tas50](https://github.com/tas50))
+- Docs fixes from review [#10440](https://github.com/chef/chef/pull/10440) ([tas50](https://github.com/tas50))
+- Update InSpec to the latest [#10443](https://github.com/chef/chef/pull/10443) ([tas50](https://github.com/tas50))
+- Fix idempotency in the osx_profile resource and avoid writing data to disk [#10444](https://github.com/chef/chef/pull/10444) ([tas50](https://github.com/tas50))
+- Update to the latest license_scout gem [#10445](https://github.com/chef/chef/pull/10445) ([tas50](https://github.com/tas50))
+
## [v16.4.41](https://github.com/chef/chef/tree/v16.4.41) (2020-08-19)
#### Merged Pull Requests
- Refactor the timezone resource to properly load the current timezone [#10323](https://github.com/chef/chef/pull/10323) ([tas50](https://github.com/tas50))
- Add missing requires for knife configure command [#10329](https://github.com/chef/chef/pull/10329) ([tas50](https://github.com/tas50))
- Update Ohai to 16.4.11 to resolve Windows IP detection [#10327](https://github.com/chef/chef/pull/10327) ([tas50](https://github.com/tas50))
-<!-- latest_stable_release -->
## [v16.4.38](https://github.com/chef/chef/tree/v16.4.38) (2020-08-18)
diff --git a/Dockerfile b/Dockerfile
index 86359f927e..ae06e5ba0a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,9 +18,9 @@ FROM busybox
LABEL maintainer="Chef Software, Inc. <docker@chef.io>"
ARG CHANNEL=stable
-ARG VERSION=16.4.41
+ARG VERSION=16.8.14
-RUN wget "http://packages.chef.io/files/${CHANNEL}/chef/${VERSION}/el/6/chef-${VERSION}-1.el6.x86_64.rpm" -O /tmp/chef-client.rpm && \
+RUN wget "http://packages.chef.io/files/${CHANNEL}/chef/${VERSION}/el/7/chef-${VERSION}-1.el7.x86_64.rpm" -O /tmp/chef-client.rpm && \
rpm2cpio /tmp/chef-client.rpm | cpio -idmv && \
rm -rf /tmp/chef-client.rpm
diff --git a/Gemfile b/Gemfile
index 101e5df8a2..99e7cf3c6b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,24 +27,16 @@ gem "chef-telemetry", ">=1.0.8" # 1.0.8 removes the http dep
group(:omnibus_package) do
gem "appbundler"
gem "rb-readline"
- gem "inspec-core", "~> 4.18"
- gem "inspec-core-bin", "~> 4.18" # need to provide the binaries for inspec
+ gem "inspec-core-bin", "~> 4.24" # need to provide the binaries for inspec
gem "chef-vault"
- gem "ed25519" # ed25519 ssh key support done here as it's a native gem we can't put in train
- gem "bcrypt_pbkdf", ">= 1.1.0.rc1" # ed25519 ssh key support done here as it's a native gem we can't put in train
end
group(:omnibus_package, :pry) do
gem "pry"
gem "pry-byebug"
- gem "pry-remote"
gem "pry-stack_explorer"
end
-group(:docgen) do
- gem "yard"
-end
-
# Everything except AIX
group(:ruby_prof) do
# ruby-prof 1.3.0 does not compile on our centos6 builders/kitchen testers
@@ -58,10 +50,7 @@ end
group(:development, :test) do
gem "rake"
- gem "rspec-core", "~> 3.5"
- gem "rspec-mocks", "~> 3.5"
- gem "rspec-expectations", "~> 3.5"
- gem "rspec_junit_formatter", "~> 0.2.0"
+ gem "rspec"
gem "webmock"
gem "fauxhai-ng" # for chef-utils gem
end
@@ -81,13 +70,16 @@ eval_gemfile("./Gemfile.local") if File.exist?("./Gemfile.local")
# For FFI to call into PowerShell we need the binaries and assemblies located
# in the Ruby bindir.
# The Powershell DLL source lives here: https://github.com/chef/chef-powershell-shim
+# Every merge into that repo triggers a Habitat build and promotion. Running
+# the rake :update_chef_exec_dll task in this (chef/chef) repo will pull down
+# the built packages and copy the binaries to distro/ruby_bin_folder.
#
# We copy (and overwrite) these files every time "bundle <exec|install>" is
# executed, just in case they have changed.
if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
instance_eval do
ruby_exe_dir = RbConfig::CONFIG["bindir"]
- assemblies = Dir.glob(File.expand_path("distro/ruby_bin_folder", __dir__) + "/*.dll")
+ assemblies = Dir.glob(File.expand_path("distro/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}", __dir__) + "**/*")
FileUtils.cp_r assemblies, ruby_exe_dir, verbose: false unless ENV["_BUNDLER_WINDOWS_DLLS_COPIED"]
ENV["_BUNDLER_WINDOWS_DLLS_COPIED"] = "1"
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 57e7aebaf5..51f4908e5d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,19 +1,19 @@
GIT
remote: https://github.com/chef/chefstyle.git
- revision: b6597339b3b670c50329af0a44017c91eb468477
+ revision: 4beb76511e5e3e414bb88942c75f107eb56a9aa1
branch: master
specs:
- chefstyle (1.3.1)
- rubocop (= 0.89.1)
+ chefstyle (1.5.7)
+ rubocop (= 1.5.2)
GIT
remote: https://github.com/chef/ohai.git
- revision: 565c0510b126c82d94262d18c6e6932cf35981ee
+ revision: e1b27c497fb3409d7dab49fbf115c8b0a70c1403
branch: master
specs:
- ohai (16.4.13)
- chef-config (>= 12.8, < 17)
- chef-utils (>= 16.0, < 17)
+ ohai (17.0.0)
+ chef-config (>= 12.8, < 18)
+ chef-utils (>= 16.0, < 18)
ffi (~> 1.9)
ffi-yajl (~> 2.2)
ipaddress
@@ -22,17 +22,18 @@ GIT
mixlib-log (>= 2.0.1, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
plist (~> 3.1)
+ train-core
wmi-lite (~> 1.0)
PATH
remote: .
specs:
- chef (16.5.26)
+ chef (17.0.0)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
bundler (>= 1.10)
- chef-config (= 16.5.26)
- chef-utils (= 16.5.26)
+ chef-config (= 17.0.0)
+ chef-utils (= 17.0.0)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -43,16 +44,17 @@ PATH
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 3)
iniparse (~> 1.4)
- license-acceptance (~> 1.0, >= 1.0.5)
+ inspec-core (~> 4.23)
+ license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
mixlib-log (>= 2.0.3, < 4.0)
mixlib-shellout (>= 3.1.1, < 4.0)
net-sftp (>= 2.1.2, < 4.0)
- net-ssh (>= 4.2, < 7)
+ net-ssh (>= 5.1, < 7)
net-ssh-multi (~> 1.2, >= 1.2.1)
- ohai (~> 16.0)
+ ohai (~> 17.0)
pastel
plist (~> 3.2)
proxifier (~> 1.0)
@@ -61,14 +63,14 @@ PATH
train-winrm (>= 0.2.5)
tty-prompt (~> 0.21)
tty-screen (~> 0.6)
- tty-table (~> 0.11.0)
+ tty-table (~> 0.11)
uuidtools (~> 2.1.5)
- chef (16.5.26-universal-mingw32)
+ chef (17.0.0-universal-mingw32)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
bundler (>= 1.10)
- chef-config (= 16.5.26)
- chef-utils (= 16.5.26)
+ chef-config (= 17.0.0)
+ chef-utils (= 17.0.0)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -79,17 +81,18 @@ PATH
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 3)
iniparse (~> 1.4)
+ inspec-core (~> 4.23)
iso8601 (>= 0.12.1, < 0.14)
- license-acceptance (~> 1.0, >= 1.0.5)
+ license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
mixlib-log (>= 2.0.3, < 4.0)
mixlib-shellout (>= 3.1.1, < 4.0)
net-sftp (>= 2.1.2, < 4.0)
- net-ssh (>= 4.2, < 7)
+ net-ssh (>= 5.1, < 7)
net-ssh-multi (~> 1.2, >= 1.2.1)
- ohai (~> 16.0)
+ ohai (~> 17.0)
pastel
plist (~> 3.2)
proxifier (~> 1.0)
@@ -98,7 +101,7 @@ PATH
train-winrm (>= 0.2.5)
tty-prompt (~> 0.21)
tty-screen (~> 0.6)
- tty-table (~> 0.11.0)
+ tty-table (~> 0.11)
uuidtools (~> 2.1.5)
win32-api (~> 1.5.3)
win32-certstore (~> 0.3)
@@ -106,7 +109,7 @@ PATH
win32-eventlog (= 0.6.3)
win32-mmap (~> 0.4.1)
win32-mutex (~> 0.4.2)
- win32-process (~> 0.8.2)
+ win32-process (~> 0.9)
win32-service (>= 2.1.5, < 3.0)
win32-taskscheduler (~> 2.0)
wmi-lite (~> 1.0)
@@ -114,15 +117,15 @@ PATH
PATH
remote: chef-bin
specs:
- chef-bin (16.5.26)
- chef (= 16.5.26)
+ chef-bin (17.0.0)
+ chef (= 17.0.0)
PATH
remote: chef-config
specs:
- chef-config (16.5.26)
+ chef-config (17.0.0)
addressable
- chef-utils (= 16.5.26)
+ chef-utils (= 17.0.0)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
@@ -131,7 +134,7 @@ PATH
PATH
remote: chef-utils
specs:
- chef-utils (16.5.26)
+ chef-utils (17.0.0)
GEM
remote: https://rubygems.org/
@@ -153,66 +156,60 @@ GEM
chef-config
concurrent-ruby (~> 1.0)
ffi-yajl (~> 2.2)
- chef-vault (4.0.11)
- chef-zero (15.0.2)
+ chef-vault (4.1.0)
+ chef-zero (15.0.3)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
rack (~> 2.0, >= 2.0.6)
uuidtools (~> 2.1)
- cheffish (16.0.8)
+ cheffish (16.0.12)
chef-zero (>= 14.0)
net-ssh
coderay (1.1.3)
concurrent-ruby (1.1.7)
- crack (0.4.3)
- safe_yaml (~> 1.0.0)
+ crack (0.4.4)
debug_inspector (0.0.3)
diff-lcs (1.3)
- ecma-re-validator (0.2.1)
- regexp_parser (~> 1.2)
ed25519 (1.2.4)
- equatable (0.6.1)
- erubi (1.9.0)
+ erubi (1.10.0)
erubis (2.7.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
- fauxhai-ng (8.3.1)
+ fauxhai-ng (8.6.0)
net-ssh
ffi (1.13.1)
ffi (1.13.1-x64-mingw32)
ffi (1.13.1-x86-mingw32)
ffi-libarchive (1.0.4)
ffi (~> 1.0)
- ffi-win32-extensions (1.0.3)
+ ffi-win32-extensions (1.0.4)
ffi
ffi-yajl (2.3.4)
libyajl2 (~> 1.2)
fuzzyurl (0.9.0)
- gssapi (1.3.0)
+ gssapi (1.3.1)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
- hana (1.3.6)
hashdiff (1.0.1)
hashie (3.6.0)
highline (2.0.3)
httpclient (2.8.3)
iniparse (1.5.0)
- inspec-core (4.22.22)
+ inspec-core (4.24.8)
addressable (~> 2.4)
chef-telemetry (~> 1.0)
- faraday (>= 0.9.0)
+ faraday (>= 0.9.0, < 1.1)
hashie (~> 3.4)
- json_schemer (>= 0.2.1, < 0.2.12)
- license-acceptance (>= 0.2.13, < 2.0)
+ license-acceptance (>= 0.2.13, < 3.0)
method_source (>= 0.8, < 2.0)
mixlib-log (~> 3.0)
multipart-post (~> 2.0)
parallel (~> 1.9)
parslet (~> 1.5)
pry (~> 0.13)
- rspec (~> 3.9)
+ rspec (~> 3.9.0)
rspec-its (~> 1.2)
rubyzip (~> 1.2, >= 1.2.2)
semverse (~> 3.0)
@@ -222,22 +219,17 @@ GEM
train-core (~> 3.0)
tty-prompt (~> 0.17)
tty-table (~> 0.10)
- inspec-core-bin (4.22.22)
- inspec-core (= 4.22.22)
+ inspec-core-bin (4.24.8)
+ inspec-core (= 4.24.8)
ipaddress (0.8.3)
iso8601 (0.13.0)
- json (2.3.1)
- json_schemer (0.2.11)
- ecma-re-validator (~> 0.2)
- hana (~> 1.3)
- regexp_parser (~> 1.5)
- uri_template (~> 0.7)
+ json (2.4.1)
libyajl2 (1.2.0)
- license-acceptance (1.0.19)
+ license-acceptance (2.1.13)
pastel (~> 0.7)
- tomlrb (~> 1.2)
- tty-box (~> 0.3)
- tty-prompt (~> 0.18)
+ tomlrb (>= 1.2, < 3.0)
+ tty-box (~> 0.6)
+ tty-prompt (~> 0.20)
little-plugger (1.1.4)
logging (2.3.0)
little-plugger (~> 1.1)
@@ -252,15 +244,15 @@ GEM
mixlib-config (3.0.9)
tomlrb
mixlib-log (3.0.9)
- mixlib-shellout (3.1.4)
+ mixlib-shellout (3.2.2)
chef-utils
- mixlib-shellout (3.1.4-universal-mingw32)
+ mixlib-shellout (3.2.2-universal-mingw32)
chef-utils
- win32-process (~> 0.8.2)
+ ffi-win32-extensions (~> 1.0.3)
+ win32-process (~> 0.9)
wmi-lite (~> 1.0)
multi_json (1.15.0)
multipart-post (2.1.1)
- necromancer (0.5.1)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-sftp (3.0.0)
@@ -272,12 +264,11 @@ GEM
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
nori (2.6.0)
- parallel (1.19.2)
- parser (2.7.1.4)
+ parallel (1.20.1)
+ parser (2.7.2.0)
ast (~> 2.4.1)
parslet (1.8.2)
- pastel (0.7.4)
- equatable (~> 0.6)
+ pastel (0.8.0)
tty-color (~> 0.5)
plist (3.5.0)
proxifier (1.0.3)
@@ -287,26 +278,23 @@ GEM
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
- pry-remote (0.1.8)
- pry (~> 0.9)
- slop (~> 3.0)
pry-stack_explorer (0.5.1)
binding_of_caller (~> 0.7)
pry (~> 0.13)
- public_suffix (4.0.5)
+ public_suffix (4.0.6)
rack (2.2.3)
rainbow (3.0.0)
rake (13.0.1)
rb-readline (0.5.5)
- regexp_parser (1.7.1)
+ regexp_parser (2.0.0)
rexml (3.2.4)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
- rspec-core (3.9.2)
+ rspec-core (3.9.3)
rspec-support (~> 3.9.3)
- rspec-expectations (3.9.2)
+ rspec-expectations (3.9.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-its (1.3.0)
@@ -315,32 +303,27 @@ GEM
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
- rspec-support (3.9.3)
- rspec_junit_formatter (0.2.3)
- builder (< 4)
- rspec-core (>= 2, < 4, != 2.12.0)
- rubocop (0.89.1)
+ rspec-support (3.9.4)
+ rubocop (1.5.2)
parallel (~> 1.10)
- parser (>= 2.7.1.1)
+ parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
- regexp_parser (>= 1.7)
+ regexp_parser (>= 1.8, < 3.0)
rexml
- rubocop-ast (>= 0.3.0, < 1.0)
+ rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
- rubocop-ast (0.3.0)
- parser (>= 2.7.1.4)
+ rubocop-ast (1.3.0)
+ parser (>= 2.7.1.5)
ruby-prof (1.2.0)
ruby-progressbar (1.10.1)
ruby-shadow (2.5.0)
rubyntlm (0.6.2)
rubyzip (1.3.0)
- safe_yaml (1.0.5)
semverse (3.0.0)
- slop (3.6.0)
sslshake (1.3.1)
- strings (0.1.8)
- strings-ansi (~> 0.1)
+ strings (0.2.0)
+ strings-ansi (~> 0.2)
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
@@ -348,42 +331,39 @@ GEM
syslog-logger (1.6.8)
thor (1.0.1)
tomlrb (1.2.9)
- train-core (3.3.16)
+ train-core (3.4.4)
addressable (~> 2.5)
ffi (!= 1.13.0)
json (>= 1.8, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
net-scp (>= 1.2, < 4.0)
net-ssh (>= 2.9, < 7.0)
- train-winrm (0.2.6)
+ train-winrm (0.2.11)
winrm (~> 2.0)
+ winrm-elevated (~> 1.2.2)
winrm-fs (~> 1.0)
- tty-box (0.5.0)
- pastel (~> 0.7.2)
- strings (~> 0.1.6)
+ tty-box (0.6.0)
+ pastel (~> 0.8)
+ strings (~> 0.2.0)
tty-cursor (~> 0.7)
- tty-color (0.5.2)
+ tty-color (0.6.0)
tty-cursor (0.7.1)
- tty-prompt (0.21.0)
- necromancer (~> 0.5.0)
- pastel (~> 0.7.0)
- tty-reader (~> 0.7.0)
- tty-reader (0.7.0)
+ tty-prompt (0.23.0)
+ pastel (~> 0.8)
+ tty-reader (~> 0.8)
+ tty-reader (0.9.0)
tty-cursor (~> 0.7)
- tty-screen (~> 0.7)
- wisper (~> 2.0.0)
+ tty-screen (~> 0.8)
+ wisper (~> 2.0)
tty-screen (0.8.1)
- tty-table (0.11.0)
- equatable (~> 0.6)
- necromancer (~> 0.5)
- pastel (~> 0.7.2)
- strings (~> 0.1.5)
- tty-screen (~> 0.7)
+ tty-table (0.12.0)
+ pastel (~> 0.8)
+ strings (~> 0.2.0)
+ tty-screen (~> 0.8)
unicode-display_width (1.7.0)
unicode_utils (1.4.0)
- uri_template (0.7.0)
uuidtools (2.1.5)
- webmock (3.8.3)
+ webmock (3.11.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -401,15 +381,15 @@ GEM
ffi
win32-mutex (0.4.3)
win32-ipc (>= 0.6.0)
- win32-process (0.8.3)
+ win32-process (0.9.0)
ffi (>= 1.0.0)
- win32-service (2.1.6)
+ win32-service (2.2.0)
ffi
ffi-win32-extensions
win32-taskscheduler (2.0.4)
ffi
structured_warnings
- winrm (2.3.4)
+ winrm (2.3.5)
builder (>= 2.1.2)
erubi (~> 1.8)
gssapi (~> 1.2)
@@ -418,6 +398,10 @@ GEM
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
+ winrm-elevated (1.2.3)
+ erubi (~> 1.8)
+ winrm (~> 2.0)
+ winrm-fs (~> 1.0)
winrm-fs (1.3.3)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
@@ -425,7 +409,6 @@ GEM
winrm (~> 2.0)
wisper (2.0.1)
wmi-lite (1.0.5)
- yard (0.9.25)
PLATFORMS
ruby
@@ -434,7 +417,6 @@ PLATFORMS
DEPENDENCIES
appbundler
- bcrypt_pbkdf (>= 1.1.0.rc1)
chef!
chef-bin!
chef-config!
@@ -443,25 +425,18 @@ DEPENDENCIES
chef-vault
cheffish (>= 14)
chefstyle!
- ed25519
fauxhai-ng
- inspec-core (~> 4.18)
- inspec-core-bin (~> 4.18)
+ inspec-core-bin (~> 4.24)
ohai!
pry
pry-byebug
- pry-remote
pry-stack_explorer
rake
rb-readline
- rspec-core (~> 3.5)
- rspec-expectations (~> 3.5)
- rspec-mocks (~> 3.5)
- rspec_junit_formatter (~> 0.2.0)
+ rspec
ruby-prof (< 1.3.0)
ruby-shadow
webmock
- yard
BUNDLED WITH
2.1.4
diff --git a/README.md b/README.md
index 6686b49ba4..6c3373a2af 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[![Code Climate](https://codeclimate.com/github/chef/chef.svg)](https://codeclimate.com/github/chef/chef)
[![Build Status](https://badge.buildkite.com/c82093430ceec7d27af05febb9dcafe3aa331fff9d74c0ab9d.svg?branch=master)](https://buildkite.com/chef-oss/chef-chef-master-verify)
[![Gem Version](https://badge.fury.io/rb/chef.svg)](https://badge.fury.io/rb/chef)
-[![](https://img.shields.io/badge/Release%20Policy-Cadence%20Release-brightgreen.svg)](https://github.com/chef/chef/blob/v15.2.21/docs/dev/design_documents/client_release_cadence.md)
+[![](https://img.shields.io/badge/Release%20Policy-Cadence%20Release-brightgreen.svg)](https://github.com/chef/chef/blob/master/docs/dev/design_documents/client_release_cadence.md)
**Umbrella Project**: [Chef Infra](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-infra.md)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 61e4e7d4c2..a8e1b732eb 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,5 +1,393 @@
This file holds "in progress" release notes for the current release under development and is intended for consumption by the Chef Documentation team. Please see <https://docs.chef.io/release_notes/> for the official Chef release notes.
+# What's New in 16.8.14
+
+- Updated openSSL to 1.0.2x to resolve [CVE-2020-1971](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1971).
+- Updated libarchive to 3.5.0, which powers the `archive_file` resource. This new release resolves extraction failures and better handles symlinks in archives.
+- `knife ssh` with the `--sudo` flag will no longer silently fail. Thanks for the fix [@rveznaver](https://github.com/rveznaver)!
+- Resolve failures running the Compliance Phase introduced in the 16.8.9 release. Thanks for reporting this issue [@axelrtgs](https://github.com/axelrtgs)!
+
+# What's New in 16.8
+
+## Chef InSpec 4.24
+
+Chef InSpec has been updated to 4.24.8 including the following improvements:
+
+- An unset `HOME environment variable will not cause execution failures
+- You can use wildcards in `platform-name` and `release` in InSpec profiles
+- The support for arrays in the `WMI` resource, so it can return multiple objects
+- The `package` resource on Windows properly escapes package names
+- The `grub_conf` resource succeeds even if without a `menuentry` in the grub config
+- Loaded plugins won't try to re-load themselves
+
+## Updated Resources
+
+### dsc_resource / dsc_script
+
+The `dsc_resource` and `dsc_script` resources have been updated to use the `powershell_exec` helper for significantly improved performance executing the PowerShell commands.
+
+### hostname
+
+The `hostname` resource has been updated to prevent failures when the default system hostname is set on macOS hosts.
+
+### remote_file
+
+The `remote_file` resource has been updated to use certificates located in Chef Infra Client's `trusted_certificates` directory. Thanks for reporting this issue [@carguel](https://github.com/carguel/)!
+
+### windows_certificate
+
+The `windows_certificate` has been updated with a new `exportable` property that marks PFX files as exportable in the certificate store.
+
+## Ohai Improvements
+
+- A new optional `Grub2` plugin can be enabled to expose GRUB2 environment variables.
+- Linode cloud detection has been improved.
+
+## Platform Packages
+
+We are once again building packages for Solaris on Sparc and x86 platforms.
+
+# What's New in 16.7
+
+## Performance Enhancements
+
+In Chef Infra Client 16.7, we've put a particular focus on optimizing the performance of the client. We've created several dozen minor optimizations that increase performance and reduce overall memory usage across all platforms. On Windows, our work has been particularly pronounced as we've improved resource execution and Chef Infra Client installation. Chef Infra Client install times on Windows are now up to 3x faster than previous releases. Resources that use PowerShell to make changes now execute significantly faster. This improvement will be the most noticeable in Chef Infra Client runs that don't make actual system changes (no-op runs), where determining the current system state was previously resource-intensive.
+
+## Windows Bootstrap Improvements
+
+We've improved how Windows nodes are bootstrapped when using the `knife bootstrap` command. The `knife bootstrap` `--secret` flag is now respected on Windows hosts, allowing for the proper setup of nodes to use encrypted data bags. Thanks for reporting this issue [@AMC-7](https://github.com/AMC-7)! Additionally, during the bootstrap we now force connections to use TLS 1.2, preventing failures on Windows 2012-2016. Thanks for this improvement [@TimothyTitan](https://github.com/TimothyTitan)!
+
+## Chef Vault 4.1
+
+We've updated the release of `chef-vault` bundled with Chef Infra Client to 4.1. Chef Vault 4.1 properly handles escape strings in secrets and greatly improves performance for users with large numbers of secrets. Thanks for the performance work [@Annih](https://github.com/Annih)!
+
+## Updated Resources
+
+### build_essential
+
+The `build_essential` resource has been updated to resolve idempotency issues and greatly improve performance on macOS hosts.
+
+### chef_client_config
+
+The `chef_client_config` resource has been updated to no longer produce invalid `client.rb` content.
+
+### group
+
+The `group` resource has been improved to provide log output of changes being made and on Windows now properly translates group SIDs to names in order to operate idempotently.
+
+Thanks for these improvements [@jaymzh](https://github.com/jaymzh)!
+
+### homebrew_update
+
+The `homebrew_update` has been updated to resolve failures that would occur when running the resource.
+
+### ifconfig
+
+The `ifconfig` resource has been updated to better support Linux distributions that are derivatives of either Ubuntu or Debian. Support for setting the `BRIDGE` property on RHEL-based systems has also been added.
+
+### mount
+
+The `mount` resource has been updated to resolve several issues:
+
+- Idempotency failures when using labels on Linux hosts.
+- Idempotency failures when using network paths that end with a slash.
+- fstab entries being reordered instead of performing in-place updates.
+
+Thanks for reporting these issues [@limitusus](https://github.com/limitusus), [@axelrtgs](https://github.com/axelrtgs), and [@scarpe01](https://github.com/scarpe01)!
+
+### powershell_package
+
+The `powershell_package` resource has been updated to better force connections to use TLS 1.2 when communicating with the PowerShell Gallery on Windows Server 2012-2016. Connections must be forced to use TLS 1.2 as the system default cipher suite because Windows 2012-2016 did not include TLS 1.2.
+
+### powershell_script
+
+The `powershell_script` resource has been updated to not fail when using a `not_if` or `only_if` guard when specifying the `user` property. Thanks for reporting this issue [@Blorpy](https://github.com/Blorpy)
+
+### user
+
+The `user` resource has been improved to provide log output of changes being made.
+
+Thanks for this improvement [@jaymzh](https://github.com/jaymzh)!
+
+### zypper_package
+
+The `zypper_package` resource has been refactored to improve idempotency when specifying a version of the package to either install or downgrade.
+
+## Ohai Improvements
+
+- The `Joyent` plugin has been removed as the Joyent public cloud was shutdown 11/2019
+- `pop_os` is now detected as having the `platform_family` of `debian`. Thanks for this improvement [@chasebolt](https://github.com/chasebolt)!
+- Recent `openindiana` releases are now properly detected.
+- The `Hostnamectl` plugin properly detects hostnames that contain a colon. Thanks for reporting this [@ziggythehamster](https://github.com/ziggythehamster)!
+- The `Zpool` plugin now properly detects ZFS zpools that include `nvme` or `xvd` drives. Thanks for reporting this [@ziggythehamster](https://github.com/ziggythehamster)!
+- The `Zpool` plugin now properly detects ZFS zpools that use disk labels/guids instead of traditional drive designations.
+- Performance of system configuration gathering on AIX systems has been improved
+- The `Virtualization` plugin on AIX systems now gathers a state `state` per WPAR and properly gathers LPAR names that include spaces
+
+# What's New in 16.6
+
+## pwsh Support
+
+We've updated multiple parts of the Chef Infra Client to fully support Microsoft's `pwsh` (commonly known as PowerShell Core) in addition to our previous support for `PowerShell`.
+
+### powershell_script resource
+
+The `powershell_script` resource includes a new `interpreter` property that accepts either `powershell` or `pwsh`.
+
+```ruby
+powershell_script 'check version table' do
+ code '$PSVersionTable'
+ interpreter 'pwsh'
+end
+```
+
+### powershell_out / powershell_exec helpers
+
+The `powershell_out` and `powershell_exec` helpers for use in custom resources have been updated to support `pwsh` with a new argument that accepts either `:pwsh` or `:powershell`.
+
+```ruby
+powershell_exec('$PSVersionTable', :pwsh)
+```
+
+## Enhanced 32-bit Windows Support
+
+The `powershell_exec` helper now supports the 32-bit version of Windows. This ensures many of the newer PowerShell based resources in Chef Infra Client will function as expected on 32-bit systems.
+
+## New Resources
+
+### chef_client_config
+
+The `chef_client_config` resource allows you to manage Chef Infra Client's `client.rb` file without the need for the `chef-client` cookbook.
+
+#### Example
+
+```ruby
+chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+end
+```
+
+#### chef-client Cookbook Future
+
+With the inclusion of the `chef_client_config` resource in Chef Infra Client 16.6, it is now possible to fully manage the Chef Infra Client without the need for the `chef-client` cookbook. We highly recommend using the `chef_client_config`, `chef_client_trusted_certificate`, and `chef_client_*` service resources to manage your clients instead of the `chef-client` cookbook. In the future we will mark that cookbook as deprecated, at which time it will no longer receive updates.
+
+Here's a sample of fully managing Linux hosts with the built-in resources:
+
+```ruby
+chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+end
+
+chef_client_trusted_certificate "chef.example.dmz" do
+ certificate <<~CERT
+ -----BEGIN CERTIFICATE-----
+ MIIDeTCCAmGgAwIBAgIJAPziuikCTox4MA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV
+ BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp
+ c2NvMQ8wDQYDVQQKDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTAeFw0x
+ OTEwMDkyMzQxNTJaFw0yMTEwMDgyMzQxNTJaMGIxCzAJBgNVBAYTAlVTMRMwEQYD
+ VQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQK
+ DAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEB
+ BQADggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2
+ PmzAS2BMTOqytMAPgLaw+XLJhgL5XEFdEyt/ccRLvOmULlA3pmccYYz2QULFRtMW
+ hyefdOsKnRFSJiFzbIRMeVXk0WvoBj1IFVKtsyjbqv9u/2CVSndrOfEk0TG23U3A
+ xPxTuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqve
+ ww9HdFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SY
+ QCeFxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaMyMDAwCQYDVR0T
+ BAIwADAjBgNVHREEHDAaggwqLmJhZHNzbC5jb22CCmJhZHNzbC5jb20wDQYJKoZI
+ hvcNAQELBQADggEBAGlwCdbPxflZfYOaukZGCaxYK6gpincX4Lla4Ui2WdeQxE95
+ w7fChXvP3YkE3UYUE7mupZ0eg4ZILr/A0e7JQDsgIu/SRTUE0domCKgPZ8v99k3A
+ vka4LpLK51jHJJK7EFgo3ca2nldd97GM0MU41xHFk8qaK1tWJkfrrfcGwDJ4GQPI
+ iLlm6i0yHq1Qg1RypAXJy5dTlRXlCLd8ufWhhiwW0W75Va5AEnJuqpQrKwl3KQVe
+ wGj67WWRgLfSr+4QG1mNvCZb2CkjZWmxkGPuoP40/y7Yu5OFqxP5tAjj4YixCYTW
+ EVA0pmzIzgBg+JIe3PdRy27T0asgQW/F4TY61Yk=
+ -----END CERTIFICATE-----
+ CERT
+end
+
+chef_client_systemd_timer "Run chef-client as a systemd timer" do
+ interval "1hr"
+ cpu_quota 50
+end
+```
+
+## Target Mode Improvements
+
+Chef Infra Client 16 introduced an experimental Target Mode feature for executing resources remotely against hosts that do not have a Chef Infra Client or even Ruby installed. For Chef Infra Client 16.6 we've improved this functionality by converting the majority of the Ohai plugins to run remotely. This means when using Target Mode you'll have the majority of Ohai data as if the Chef Infra Client was installed on the node. Keep in mind this data collection can be time consuming over high latency network connections, and cloud plugins which fetch metadata cannot currently be run remotely. Ohai also now includes a `--target` option for remote data gathering, which accepts a Train URI: `ohai --target ssh://foobar.example.org/`. We still consider Target Mode to be an experimental feature, and we'd love your feedback on what works and what doesn't in your environment. A super huge thanks for the countless hours of work put in by [tecRacer](https://www.tecracer.de/), [@tecracer-theinen](https://github.com/tecracer-theinen), and [burtlo](https://github.com/burtlo) to make this a reality.
+
+## Updated Resources
+
+### ifconfig
+
+The `ifconfig` resource has been updated to no longer add empty blank lines to the configuration files. Thanks for this improvement [@jmherbst](https://github.com/jmherbst/)!
+
+### windows_audit_policy
+
+The `windows_audit_policy` resource has been updated to fix a bug on failure-only auditing.
+
+## Ohai Improvements
+
+### Passwd Plugin For Windows
+
+The optional Ohai `Passwd` plugin now supports Windows hosts in addition to Unix-like systems. To collect user/group data on Windows hosts you can use the `ohai_optional_plugins` property in the new `chef_client_config` resource to enable this plugin.
+
+```ruby
+chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+ ohai_optional_plugins [:Passwd]
+end
+```
+
+Thanks for adding Windows support to this plugin [@jaymzh](https://github.com/jaymzh)!
+
+### Improved Azure Detection
+
+The `Azure` plugin has been improved to better detect Windows hosts running on Azure. The plugin will now look for DHCP with the domain of `reddog.microsoft.com`. Thanks for this improvement [@jasonwbarnett](https://github.com/jasonwbarnett/)!
+
+### EC2 IAM Role Data
+
+Ohai now collects IAM Role data on EC2 hosts including the role name and info. To address potential security concerns the data we collect is sanitized to ensure we don't report security credentials to the Chef Infra Server. Thanks for this improvement [@kcbraunschweig](https://github.com/kcbraunschweig)!
+
+## Security
+
+Ruby has been updated to 2.7.2, which includes a fix for [CVE-2020-25613](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25613).
+
+# Whats New in 16.5.77
+
+* Added missing requires to prevent errors when loading `chef/policy_builder/dynamic`.
+* The `homebrew_package` resource will now check for the full and short package names. Both `homebrew_package 'homebrew/core/vim'` and `homebrew_package 'vim'` styles should now work correctly.
+* Resolved errors that occurred in cookbooks requiring `addressable/uri`.
+* Improved the license acceptance flow to give helpful information if the user passes an invalid value in the environment variable or command line argument.
+* Updated Chef InSpec to 4.23.11 in order to resolve issues when running the new `junit2` reporter.
+* Additional performance improvements to reduce the startup time of the `chef-client` and `knife` commands.
+* `knife vault` commands now output proper JSON or YAML when using the `-f json` or `-f yaml` flags.
+
+# What's New in 16.5
+
+## Performance Improvements
+
+We continue to reduce the size of the Chef Infra Client install and optimize the performance of the client. With Chef Infra Client 16.5 we've greatly reduced the startup time of the `chef-client` process. Startup times on macOS, Linux, and Windows hosts are now approximately 2x faster than the 16.4 release.
+
+## CLI Improvements
+
+* The client license acceptance logic has been improved to provide helpful error messages when an incorrect value is passed and to accept license values in any text case.
+* A new `chef-client` process exit code of 43 has been added to signal that an invalid configuration was specified. Thanks [@NaomiReeves](https://github.com/NaomiReeves)!
+* The `knife ssh` command no longer hangs when connecting to Windows nodes over SSH.
+* The `knife config` commands have been renamed to make them shorter and table output has been improved:
+ * knife config get-profile -> knife config use
+ * knife config use-profile [NAME] -> knife config use [NAME]
+ * knife config list-profiles -> knife config list
+ * knife config get -> knife config show
+
+## Chef InSpec 4.23.4
+
+Chef InSpec has been updated from 4.22.1 to 4.23.4. This new release includes the following improvements:
+
+* A new mechanism marks inputs as sensitive: true and replaces their values with `***`.
+* Use the `--no-diff` CLI option to suppress diff output for textual tests.
+* Control the order of controls in output, but not execution order, with the `--sort_results_by=none|control|file|random` CLI option.
+* Disable caching of inputs with a cache_inputs: true setting.
+
+## New Resources
+
+### chef_client_launchd
+
+The `chef_client_launchd` resource allows you to configure Chef Infra Client to run as a global launchd daemon on macOS hosts. This resource mirrors the configuration of other `chef_client_*` resources and allows for simple out-of-the-box configuration of the daemon, while also providing advanced tunables. If you've used the `chef-client` cookbook in the past, you'll notice a number of improvements in the new resource including configuration update handling, splay times support, nice level support, and an out-of-the-box configuration of low IO priority execution. In order to handle restarting the Chef Infra Client launchd daemon when configuration changes occur, the resource also installs a new `com.chef.restarter` daemon. This daemon watches for daemon configuration changes and gracefully handles the restart to ensure the client process continues to run.
+
+```ruby
+chef_client_launchd 'Setup the Chef Infra Client to run every 30 minutes' do
+ interval 30
+ action :enable
+end
+```
+
+### chef_client_trusted_certificate
+
+The `chef_client_trusted_certificate` resource allows you to add a certificate to Chef Infra Client's trusted certificate directory. The resource handles platform-specific locations and creates the trusted certificates directory if it doesn't already exist. Once a certificate is added, it will be used by the client itself to communicate with the Chef Infra Server and by resources such as `remote_file`.
+
+```ruby
+chef_client_trusted_certificate 'self-signed.badssl.com' do
+ certificate <<~CERT
+ -----BEGIN CERTIFICATE-----
+ MIIDeTCCAmGgAwIBAgIJAPziuikCTox4MA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV
+ BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp
+ c2NvMQ8wDQYDVQQKDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTAeFw0x
+ OTEwMDkyMzQxNTJaFw0yMTEwMDgyMzQxNTJaMGIxCzAJBgNVBAYTAlVTMRMwEQYD
+ VQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQK
+ DAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEB
+ BQADggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2
+ PmzAS2BMTOqytMAPgLaw+XLJhgL5XEFdEyt/ccRLvOmULlA3pmccYYz2QULFRtMW
+ hyefdOsKnRFSJiFzbIRMeVXk0WvoBj1IFVKtsyjbqv9u/2CVSndrOfEk0TG23U3A
+ xPxTuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqve
+ ww9HdFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SY
+ QCeFxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaMyMDAwCQYDVR0T
+ BAIwADAjBgNVHREEHDAaggwqLmJhZHNzbC5jb22CCmJhZHNzbC5jb20wDQYJKoZI
+ hvcNAQELBQADggEBAGlwCdbPxflZfYOaukZGCaxYK6gpincX4Lla4Ui2WdeQxE95
+ w7fChXvP3YkE3UYUE7mupZ0eg4ZILr/A0e7JQDsgIu/SRTUE0domCKgPZ8v99k3A
+ vka4LpLK51jHJJK7EFgo3ca2nldd97GM0MU41xHFk8qaK1tWJkfrrfcGwDJ4GQPI
+ iLlm6i0yHq1Qg1RypAXJy5dTlRXlCLd8ufWhhiwW0W75Va5AEnJuqpQrKwl3KQVe
+ wGj67WWRgLfSr+4QG1mNvCZb2CkjZWmxkGPuoP40/y7Yu5OFqxP5tAjj4YixCYTW
+ EVA0pmzIzgBg+JIe3PdRy27T0asgQW/F4TY61Yk=
+ -----END CERTIFICATE-----
+ CERT
+end
+```
+
+## Resource Updates
+
+### chef_client_cron
+
+The `chef_client_cron` resource has been updated with a new `nice` property that allows you to set the nice level for the `chef-client` process. Nice level changes only apply to the `chef-client` process and not any subprocesses like `ohai` or system utility calls. If you need to ensure that the `chef-client` process does not negatively impact system performance, we highly recommend instead using the `cpu_quota` property in the `chef_client_systemd_timer` resource which applies to all child processes.
+
+### chef_client_systemd_timer
+
+The `chef_client_systemd_timer` resource has been updated with a new `cpu_quota` property that allows you to control the systemd `CPUQuota` value for the `chef-client` process. This allows you to ensure `chef-client` execution doesn't adversely impact performance on your systems.
+
+### launchd
+
+The `launchd` resource has been updated to better validate inputs to the `nice` property so we can make sure these are acceptable nice values.
+
+### mount
+
+The `mount` resource on Linux has new improved idempotency in some scenarios by switching to `findmnt` to determine the current state of the system. Thanks for reporting this issue [@pollosp](https://github.com/pollosp)!
+
+### osx_profile
+
+The `osx_profile` resource will now allow you to remove profiles from macOS 11 (Big Sur) systems. Due to security changes in macOS 11, it is no longer possible to locally install profiles, but this will allow you to cleanup existing profiles left over after an upgrade from an earlier macOS release. The resource has been updated to resolve a regression introduced in Chef Infra Client 16.4 that caused the resource to attempt to update profiles on each converge. Thanks for reporting these issues [@chilcote](https://github.com/chilcote)!
+
+### rhsm_register
+
+The `rhsm_register` resource has been updated to reduce the load on the RedHat Satellite server when checking if a system is already registered. Thanks for reporting this issue [@donwlewis](https://github.com/donwlewis)! A new `system_name` property has also been added to allow you to register a name other than the system's hostname. Thanks for this improvement [@jasonwbarnett](https://github.com/jasonwbarnett/)!
+
+### windows_ad_join
+
+The `windows_ad_join` resource has been updated with a new `reboot_delay` property which allows you to control the delay time before restarting systems.
+
+### windows_firewall_profile
+
+The `windows_firewall_profile` resource was updated to prevent NilClass errors from loading the firewall state.
+
+### windows_user_privilege
+
+The `windows_user_privilege` resource has been updated to better validate the `privilege` property and to allow the `users` property to accept String values. Thanks for reporting this issue [@jeremyciak](https://github.com/jeremyciak)!
+
+### Windows securable resources
+
+All Windows securable resources now support using SID in addition to user or group name when specifying `owner`, `group`, or `rights` principal. These resources include the `template`, `file`, `remote_file`, `cookbook_file`, `directory`, and `remote_directory` resources. When using a SID, you may use either the standard string representation of a SID (S-R-I-S-S) or one of the [SDDL string constants](https://docs.microsoft.com/en-us/windows/win32/secauthz/sid-strings).
+
+## Ohai Improvements
+
+* Ohai now uses the same underlying code for shelling out to external commands as Chef Infra Client. This may resolve issues from determining the state on some non-English systems.
+* The `Packages` plugin has been updated to gather package installation information on macOS hosts.
+
+## Platform Packages
+
+* We are once again building Chef Infra Client packages for RHEL 7 / SLES 12 on the S390x architecture. In addition to these packages, we've also added S390x packages for RHEL 8 / SLES 15.
+* We now produce packages for Apple's upcoming macOS 11 Big Sur release.
+
+## Security
+
+OpenSSL has been updated to 1.0.2w which includes a fix for [CVE-2020-1968](https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-1968).
+
# What's New in 16.4
## Resource Updates
@@ -48,9 +436,9 @@ We've audited the included dependencies that we ship with Chef Infra Client to r
# What's New in 16.3.45
-- Resolved failures negotiating protocol versions with the Chef Infra Server.
-- Improved log output on Windows systems in the `hostname` resource.
-- Added support to the `archive_file` resource for `pzstd` compressed files.
+* Resolved failures negotiating protocol versions with the Chef Infra Server.
+* Improved log output on Windows systems in the `hostname` resource.
+* Added support to the `archive_file` resource for `pzstd` compressed files.
# What's New in 16.3.38
@@ -58,15 +446,15 @@ We've audited the included dependencies that we ship with Chef Infra Client to r
We took a hard look at many of the terms we've historically used throughout the Chef Infra Client configuration sub-system and came to the realization that we weren't living up to the words of our [Community Code of Conduct](https://community.chef.io/code-of-conduct/). From the code of conduct: "Be careful in the words that you choose. Be kind to others. Practice empathy". Terms such as blacklist and sanity don't meet that bar so we've chosen to rename these configuration options:
-- `automatic_attribute_blacklist` -> `blocked_automatic_attributes`
-- `default_attribute_blacklist` -> `blocked_default_attributes`
-- `normal_attribute_blacklist` -> `blocked_normal_attributes`
-- `override_attribute_blacklist` -> `blocked_override_attributes`
-- `automatic_attribute_whitelist` -> `allowed_automatic_attributes`
-- `default_attribute_whitelist` -> `allowed_default_attributes`
-- `normal_attribute_whitelist` -> ``allowed_normal_attributes``
-- `override_attribute_whitelist` -> `allowed_override_attributes`
-- `enforce_path_sanity` -> `enforce_default_paths`
+* `automatic_attribute_blacklist` -> `blocked_automatic_attributes`
+* `default_attribute_blacklist` -> `blocked_default_attributes`
+* `normal_attribute_blacklist` -> `blocked_normal_attributes`
+* `override_attribute_blacklist` -> `blocked_override_attributes`
+* `automatic_attribute_whitelist` -> `allowed_automatic_attributes`
+* `default_attribute_whitelist` -> `allowed_default_attributes`
+* `normal_attribute_whitelist` -> ``allowed_normal_attributes``
+* `override_attribute_whitelist` -> `allowed_override_attributes`
+* `enforce_path_sanity` -> `enforce_default_paths`
Existing configuration options will continue to function for now, but will raise a deprecation warning and will be removed entirely from a future release of Chef Infra Client.
@@ -74,11 +462,11 @@ Existing configuration options will continue to function for now, but will raise
Chef InSpec has been updated from 4.21.1 to 4.22.1. This new release includes the following improvements:
-- The `=` character is now allowed for command line inputs
-- `apt-cdrom` repositories are now skipped when parsing out the list of apt repositories
-- Faulty profiles are now reported instead of causing a crash
-- Errors are no longer logged to stdout with the `html2` reporter
-- macOS Big Sur is now correctly identified as macOS
+* The `=` character is now allowed for command line inputs
+* `apt-cdrom` repositories are now skipped when parsing out the list of apt repositories
+* Faulty profiles are now reported instead of causing a crash
+* Errors are no longer logged to stdout with the `html2` reporter
+* macOS Big Sur is now correctly identified as macOS
## New Resources
@@ -120,14 +508,14 @@ The `git` resource will no longer fail if syncing a branch that already exists l
The `macos_user_defaults` has received a ground-up refactoring with new actions, additional properties, and better overall reliability:
-- Improved idempotency by properly loading the current state of domains.
-- Improved how we set `dict` and `array` type data.
-- Improved logging to show the existing key/value pair that is changed, and improved the property state data that the resource sends to handlers and/or Chef Automate.
-- Fixed a failure when setting keys or values that included a space.
-- Replaced the existing non-functional `global` property with a new default for the `domain` property. To set a key/value pair on the `NSGlobalDomain` domain, you can either set that value explicitly or just skip the `domain` property entirely and Chef Infra Client will default to `NSGlobalDomain`. The existing property has been marked as deprecated and we will ship a Cookstyle rule to detect cookbooks using this property in the future.
-- Fixed the `type` property to only accept valid inputs. Previously typos or otherwise incorrect values would just be ignored resulting in unexpected behavior. This may cause failures in your codebase if you previously used incorrect values. We will be shipping a Cookstyle rule to detect and correct these values in the future.
-- Added a new `delete` action to allow users to remove a key from a domain.
-- Added a new `host` property that lets you set per-host values. If you set this to `:current` it sets the -currentHost flag.
+* Improved idempotency by properly loading the current state of domains.
+* Improved how we set `dict` and `array` type data.
+* Improved logging to show the existing key/value pair that is changed, and improved the property state data that the resource sends to handlers and/or Chef Automate.
+* Fixed a failure when setting keys or values that included a space.
+* Replaced the existing non-functional `global` property with a new default for the `domain` property. To set a key/value pair on the `NSGlobalDomain` domain, you can either set that value explicitly or just skip the `domain` property entirely and Chef Infra Client will default to `NSGlobalDomain`. The existing property has been marked as deprecated and we will ship a Cookstyle rule to detect cookbooks using this property in the future.
+* Fixed the `type` property to only accept valid inputs. Previously typos or otherwise incorrect values would just be ignored resulting in unexpected behavior. This may cause failures in your codebase if you previously used incorrect values. We will be shipping a Cookstyle rule to detect and correct these values in the future.
+* Added a new `delete` action to allow users to remove a key from a domain.
+* Added a new `host` property that lets you set per-host values. If you set this to `:current` it sets the -currentHost flag.
### windows_dns_record
@@ -143,12 +531,12 @@ The `windows_security_policy` resource has been refactored to improve idempotenc
## Knife Improvements
-- Ctrl-C can now be used to exit knife even when being prompted for input.
-- `knife bootstrap` will now properly error if attempting to bootstrap an AIX system using an account with an expired password.
-- `knife profile` commands will no longer error if an invalid profile was previously set.
-- The `-o` flag for `knife cookbook upload` can now be used on Windows systems.
-- `knife ssh` now once again accepts legacy DSS host keys although we highly recommend upgrading to a more secure key algorithm if possible.
-- Several changes were made to knife to that may prevent intermittent failures running cookbook commands
+* Ctrl-C can now be used to exit knife even when being prompted for input.
+* `knife bootstrap` will now properly error if attempting to bootstrap an AIX system using an account with an expired password.
+* `knife profile` commands will no longer error if an invalid profile was previously set.
+* The `-o` flag for `knife cookbook upload` can now be used on Windows systems.
+* `knife ssh` now once again accepts legacy DSS host keys although we highly recommend upgrading to a more secure key algorithm if possible.
+* Several changes were made to knife to that may prevent intermittent failures running cookbook commands
## Habitat Package Improvements
@@ -156,22 +544,22 @@ Habitat packages for Windows, Linux and Linux2 are now built and tested against
# What's New in 16.2.72
-- Habitat packages for Chef Infra Client 16 are now published with full support for the `powershell_exec` helper now added.
-- Added a new `clear` action to the `windows_user_privilege` resource.
-- Resolved a regression in Chef Infra Client 16.1 and later that caused failures running on FIPS enabled systems.
-- Resolved failures in the `archive_file` resource when running on Windows hosts.
-- Resolved a failure when running `chef-apply` with the `-j` option. Thanks [@komazarari](https://github.com/komazarari).
-- Chef Infra Client running within GitHub Actions is now properly identified as running in a Docker container. Thanks [@jaymzh](http://github.com/jaymzh).
-- SSH connections are now reused, improving the speed of knife bootstrap and remote resources on slow network links. Thanks [@tecracer-theinen](https://github.com/tecracer-theinen).
-- `node['network']['interfaces']` data now correctly identifies IPv6 next hops for IPv4 routes. Thanks [@cooperlees](https://github.com/cooperlees).
-- Updated InSpec from 4.20.10 to 4.21.1.
+* Habitat packages for Chef Infra Client 16 are now published with full support for the `powershell_exec` helper now added.
+* Added a new `clear` action to the `windows_user_privilege` resource.
+* Resolved a regression in Chef Infra Client 16.1 and later that caused failures running on FIPS enabled systems.
+* Resolved failures in the `archive_file` resource when running on Windows hosts.
+* Resolved a failure when running `chef-apply` with the `-j` option. Thanks [@komazarari](https://github.com/komazarari).
+* Chef Infra Client running within GitHub Actions is now properly identified as running in a Docker container. Thanks [@jaymzh](http://github.com/jaymzh).
+* SSH connections are now reused, improving the speed of knife bootstrap and remote resources on slow network links. Thanks [@tecracer-theinen](https://github.com/tecracer-theinen).
+* `node['network']['interfaces']` data now correctly identifies IPv6 next hops for IPv4 routes. Thanks [@cooperlees](https://github.com/cooperlees).
+* Updated InSpec from 4.20.10 to 4.21.1.
# What's New in 16.2.50
-- Correctly identify the new macOS Big Sur (11.0) beta as platform "mac_os_x".
-- Fix `knife config use-profile` to fail if an invalid profile is provided.
-- Fix failures running the `windows_security_policy` resource.
-- Update InSpec from 4.20.6 to 4.20.10.
+* Correctly identify the new macOS Big Sur (11.0) beta as platform "mac_os_x".
+* Fix `knife config use-profile` to fail if an invalid profile is provided.
+* Fix failures running the `windows_security_policy` resource.
+* Update InSpec from 4.20.6 to 4.20.10.
# What's New in 16.2.44
@@ -210,11 +598,11 @@ We've introduced several Cookstyle rules to detect both custom resources and leg
Chef InSpec has been updated from 4.18.114 to 4.2.0.6. This new release includes the following improvements:
-- Develop your own Chef InSpec Reporter plugins to control how Chef InSpec will report result data.
-- The `inspec archive` command packs your profile into a `tar.gz` file that includes the profile in JSON form as the inspec.json file.
-- Certain substrings within a `.toml` file no longer cause unexpected crashes.
-- Accurate InSpec CLI input parsing for numeric values and structured data, which were previously treated as strings. Numeric values are cast to an `integer` or `float` and `YAML` or `JSON` structures are converted to a hash or an array.
-- Suppress deprecation warnings on inspec exec with the `--silence-deprecations` option.
+* Develop your own Chef InSpec Reporter plugins to control how Chef InSpec will report result data.
+* The `inspec archive` command packs your profile into a `tar.gz` file that includes the profile in JSON form as the inspec.json file.
+* Certain substrings within a `.toml` file no longer cause unexpected crashes.
+* Accurate InSpec CLI input parsing for numeric values and structured data, which were previously treated as strings. Numeric values are cast to an `integer` or `float` and `YAML` or `JSON` structures are converted to a hash or an array.
+* Suppress deprecation warnings on inspec exec with the `--silence-deprecations` option.
## New Resources
@@ -285,24 +673,24 @@ The `zypper_repository` resource has been updated to work with the newer release
## Knife bootstrap updates
-- Knife bootstrap will now warn when bootstrapping a system using a validation key. Users should instead use `validatorless bootstrapping` with `knife bootstrap` which generates node and client keys using the client key of the user bootstrapping the node. This method is far more secure as an org-wide validation key does not not need to be distributed or rotated. Users can switch to `validatorless bootstrapping` by removing any `validation_key` entries in their `config.rb (knife.rb)` file.
-- Resolved an error bootstrapping Linux nodes from Windows hosts
-- Improved information messages during the bootstrap process
+* Knife bootstrap will now warn when bootstrapping a system using a validation key. Users should instead use `validatorless bootstrapping` with `knife bootstrap` which generates node and client keys using the client key of the user bootstrapping the node. This method is far more secure as an org-wide validation key does not not need to be distributed or rotated. Users can switch to `validatorless bootstrapping` by removing any `validation_key` entries in their `config.rb (knife.rb)` file.
+* Resolved an error bootstrapping Linux nodes from Windows hosts
+* Improved information messages during the bootstrap process
## Platform Packages
-- Debian 8 packages are no longer being produced as Debian 8 is now end-of-life.
-- We now produce Windows 8 packages
+* Debian 8 packages are no longer being produced as Debian 8 is now end-of-life.
+* We now produce Windows 8 packages
# What's New in 16.1.16
This release resolves high-priority bugs in the 16.1 release of Chef Infra Client:
-- Resolved a critical performance regression in the Rubygems release within Ruby 2.7, which was discovered by a Chef engineer.
-- Resolved several Ruby 2.7 deprecation warnings.
-- Added `armv6l` and `armv7l` architectures to the `arm?` and `armhf?` helpers
-- Resolved failures in the Windows bootstrap script
-- Resolved incorrect paths when bootstrapping Windows nodes
+* Resolved a critical performance regression in the Rubygems release within Ruby 2.7, which was discovered by a Chef engineer.
+* Resolved several Ruby 2.7 deprecation warnings.
+* Added `armv6l` and `armv7l` architectures to the `arm?` and `armhf?` helpers
+* Resolved failures in the Windows bootstrap script
+* Resolved incorrect paths when bootstrapping Windows nodes
## Security Updates
@@ -330,31 +718,31 @@ Chef Infra Client packages are now produced for Debian 10 on the aarch64 archite
## Bug Fixes
-- Resolved a regression in the `launchd` resource that prevented it from converging.
-- The `:disable` action in the `launchd` resource no longer fails if the plist was not found.
-- Several Ruby 2.7 deprecation warnings have been resolved.
+* Resolved a regression in the `launchd` resource that prevented it from converging.
+* The `:disable` action in the `launchd` resource no longer fails if the plist was not found.
+* Several Ruby 2.7 deprecation warnings have been resolved.
# What's New in 16.0.287
The Chef Infra Client 16.0.287 release includes important bug fixes for the Chef Infra Client 16 release:
-- Fixes the failure to install Windows packages on the 2nd convergence of the Chef Infra Client.
-- Resolves several failures in the `launchd` resource.
-- Removes an extra `.java` file on Windows installations that would cause a failure in the IIS 8.5 Server Security Technical Implementation Guide audit.
-- Updates the `windows_printer` resource so that the driver property will only be required when using the `:create` action.
-- Fixes the incorrectly spelled `knife user invite recind` command to be `knife user invite rescind`. <!-- cspell:disable-line !-->
-- Update Chef InSpec to 4.8.111 with several minor improvements.
+* Fixes the failure to install Windows packages on the 2nd convergence of the Chef Infra Client.
+* Resolves several failures in the `launchd` resource.
+* Removes an extra `.java` file on Windows installations that would cause a failure in the IIS 8.5 Server Security Technical Implementation Guide audit.
+* Updates the `windows_printer` resource so that the driver property will only be required when using the `:create` action.
+* Fixes the incorrectly spelled `knife user invite recind` command to be `knife user invite rescind`. <!-* cspell:disable-line !-->
+* Update Chef InSpec to 4.8.111 with several minor improvements.
# What's New in 16.0.275
The Chef Infra Client 16.0.275 release includes important regression fixes for the Chef Infra Client 16 release:
-- Resolved failures when using the `windows_package` resource. Thanks for reporting this issue [@cookiecurse](https://github.com/cookiecurse).
-- Resolved log warnings when running `execute` resources.
-- The appropriate `cron` or `cron_d` resource call is now called when using the `:delete` action in chef_client_cron. Thanks for reporting this issue [jimwise](https://github.com/jimwise).
-- The `chef_client_cron` resource now creates the log directory with `750` permissions not `640`. Thanks for this fix [DhaneshRaghavan](https://github.com/DhaneshRaghavan).
-- The `knife yaml convert` command now correctly converts symbol values.
-- The `sysctl`, `apt_preference`, and `cron_d` remove actions no longer fail with missing property warnings.
+* Resolved failures when using the `windows_package` resource. Thanks for reporting this issue [@cookiecurse](https://github.com/cookiecurse).
+* Resolved log warnings when running `execute` resources.
+* The appropriate `cron` or `cron_d` resource call is now called when using the `:delete` action in chef_client_cron. Thanks for reporting this issue [jimwise](https://github.com/jimwise).
+* The `chef_client_cron` resource now creates the log directory with `750` permissions not `640`. Thanks for this fix [DhaneshRaghavan](https://github.com/DhaneshRaghavan).
+* The `knife yaml convert` command now correctly converts symbol values.
+* The `sysctl`, `apt_preference`, and `cron_d` remove actions no longer fail with missing property warnings.
# What's New in 16.0
@@ -445,7 +833,7 @@ depends 'windows', '>> 1.0'
### Logging Improvements May Cause Behavior Changes
-We've made low level changes to how logging behaves in Chef Infra Client that resolves many complaints we've heard of the years. With these change you'll now see the same logging output when you run `chef-client` on the command line as you will in logs from a daemonized client run. This also corrects often confusing behavior where running `chef-client` on the command line would log to the console, but not to the log file location defined your `client.rb`. In that scenario you'll now see logs in your console and in your log file. We believe this is the expected behavior and will mean that your on-disk log files can always be the source of truth for changes that were made by Chef Infra Client. This may cause unexpected behavior changes for users that relied on using the command line flags to override the `client.rb` log location - in this case logging will be sent to *both* the locations in `client.rb` and on the command line. If you have daemons running that log using the command line options you want to make sure that `client.rb` log location either matches or isn't defined.
+We've made low-level changes to how logging behaves in Chef Infra Client that resolves many complaints we've heard of the years. With these change you'll now see the same logging output when you run `chef-client` on the command line as you will in logs from a daemonized client run. This also corrects often confusing behavior where running `chef-client` on the command line would log to the console, but not to the log file location defined your `client.rb`. In that scenario you'll now see logs in your console and in your log file. We believe this is the expected behavior and will mean that your on-disk log files can always be the source of truth for changes that were made by Chef Infra Client. This may cause unexpected behavior changes for users that relied on using the command line flags to override the `client.rb` log location * in this case logging will be sent to *both* the locations in `client.rb` and on the command line. If you have daemons running that log using the command line options you want to make sure that `client.rb` log location either matches or isn't defined.
### Red Hat / CentOS 6 Systems Require C11 GCC for Some Gem Installations
@@ -473,15 +861,15 @@ We've improved the behavior for those that use custom rubygem sources, particula
The default value of the `clear_sources` property of `gem_package` and `chef_gem` resources has been changed to `nil`. The possible behaviors for clear_sources are now:
-- `true`: Always clear sources.
-- `false`: Never clear sources.
-- `nil`: Clear sources if `source` property is set, but don't clear sources otherwise.
+* `true`: Always clear sources.
+* `false`: Never clear sources.
+* `nil`: Clear sources if `source` property is set, but don't clear sources otherwise.
The default value of the `include_default_source` property of `gem_package` and `chef_gem` resources has been changed to `nil`. The possible behaviors for include_default_source are now:
-- `true`: Always include the default source.
-- `false`: Never include the default source.
-- `nil`: Include the default source if `rubygems_url` `client.rb` value is set or if `source` and `clear_sources` are not set on the resource.
+* `true`: Always include the default source.
+* `false`: Never include the default source.
+* `nil`: Include the default source if `rubygems_url` `client.rb` value is set or if `source` and `clear_sources` are not set on the resource.
The default values of the `rubygems_url` `client.rb` config option has been changed to `nil`. Setting to nil previously had similar behavior to setting `clear_sources` to true, but with some differences. The new behavior is to always use `https://rubygems.org` as the default rubygems repo unless explicitly changed, and whether to use this value is determined by `clear_sources` and `include_default_source`.
@@ -519,15 +907,15 @@ Use the `alternatives` resource to manage symbolic links to specify default comm
We've added new resources to Chef Infra Client for setting the client to run on an interval using native system schedulers. We believe that these native schedulers provide a more flexible and reliable method for running the client than the traditional method of running as a full service. Using the native schedulers reduces hung clients and eases upgrades. This is the first of many steps towards removing the need for the `chef-client` cookbook and allowing Chef Infra Client to configure itself out of the box.
-#### chef_client_cron
+### chef_client_cron
Use the `chef_client_cron` resource to setup the Chef Infra Client to run on a schedule using cron on Linux, Solaris, and AIX systems. See the [chef_client_cron documentation](https://docs.chef.io/resources/chef_client_cron/) for full usage information.
-#### chef_client_systemd_timer
+### chef_client_systemd_timer
Use the `chef_client_systemd_timer` resource to setup the Chef Infra Client to run on a schedule using a systemd timer on systemd based Linux systems (RHEL 7+, Debian 8+, Ubuntu 16.04+ SLES 12+). See the [chef_client_systemd_timer documentation](https://docs.chef.io/resources/chef_client_systemd_timer/) for full usage information.
-#### chef_client_scheduled_task
+### chef_client_scheduled_task
Use the `chef_client_scheduled_task` resource to setup the Chef Infra Client to run on a schedule using Windows Scheduled Tasks. See the [chef_client_scheduled_task documentation](https://docs.chef.io/resources/chef_client_scheduled_task/) for full usage information.
@@ -581,10 +969,10 @@ The `cron` resource has been updated to use the same property validation for cro
The `dnf_package` resource, which provides `package` under the hood on any system shipping with DNF, has been greatly refactored to resolve multiple issues. The version behavior and overall resource capabilities now match that of the `yum_package` resource.
-- The `:lock` action now works on RHEL 8.
-- Fixes to prevent attempting to install the same package during each Chef Infra Client run.
-- Resolved several idempotency issues.
-- Resolved an issue where installing a package with `options '--enablerepo=foo'` would fail.
+* The `:lock` action now works on RHEL 8.
+* Fixes to prevent attempting to install the same package during each Chef Infra Client run.
+* Resolved several idempotency issues.
+* Resolved an issue where installing a package with `options '--enablerepo=foo'` would fail.
### git
@@ -632,11 +1020,11 @@ The `service` resource has been updated to support newer releases of `update-rc.
The `windows_firewall_rule` resource has been greatly improved thanks to work by [@pschaumburg](https://github.com/pschaumburg) and [@tecracer-theinen](https://github.com/tecracer-theinen).
-- New `icmp_type` property, which allows setting the ICMP type when setting up ICMP protocol rules.
-- New `displayname` property, which allows defining the display name of the firewall rule.
-- New `group` property, which allows you to specify that only matching firewall rules of the indicated group association are copied.
-- The `description` property will now update if changed.
-- Fixed setting rules with multiple profiles.
+* New `icmp_type` property, which allows setting the ICMP type when setting up ICMP protocol rules.
+* New `displayname` property, which allows defining the display name of the firewall rule.
+* New `group` property, which allows you to specify that only matching firewall rules of the indicated group association are copied.
+* The `description` property will now update if changed.
+* Fixed setting rules with multiple profiles.
### windows_package
@@ -653,16 +1041,16 @@ We added support for writing recipes in YAML to provide a low-code syntax for si
```yaml
---
resources:
- - type: "package"
+ * type: "package"
name: "httpd"
- - type: "template"
+ * type: "template"
name: "/var/www/html/index.html"
source: "index.html.erb"
- - type: "service"
+ * type: "service"
name: "httpd"
action:
- - enable
- - start
+ * enable
+ * start
```
This implementation is restrictive and does not support arbitrary Ruby code, helper functions, or attributes. However, if the need for additional customization arises, YAML recipes can be automatically converted into the DSL via the `knife yaml convert` command.
@@ -864,42 +1252,42 @@ Windows systems now include a new `DMI` plugin which presents data in a similar
Over the last quarter, we worked to greatly expand the platforms that we support with the addition of Chef Infra Client packages for Ubuntu 20.04 amd64, Amazon Linux 2 x86_64/aarch64, and Debian 10 amd64. With the release of Chef Infra Client 16, we expanded our platform support again with the following new platforms:
-- RHEL 8 aarch64
-- Ubuntu 20.04 aarch64
-- SLES 16 aarch64
+* RHEL 8 aarch64
+* Ubuntu 20.04 aarch64
+* SLES 16 aarch64
## Newly Introduced Deprecations
Several legacy Windows helpers have been deprecated as they will always return true when running on Chef Infra Client's currently supported platforms. The helpers previously detected systems prior to Windows 2012 and systems running Windows Nano, which has been discontinued by Microsoft. These helpers were never documented externally so their usage is most likely minimal. A new Cookstyle rule has been introduced to detect the usage of `older_than_win_2012_or_8?`: [ChefDeprecations/DeprecatedWindowsVersionCheck](https://github.com/chef/cookstyle/blob/master/docs/cops_chefdeprecations.md#chefdeprecationsdeprecatedwindowsversioncheck).
-- Chef::Platform.supports_msi?
-- Chef::Platform.older_than_win_2012_or_8?
-- Chef::Platform.supports_powershell_execution_bypass?
-- Chef::Platform.windows_nano_server?
+* Chef::Platform.supports_msi?
+* Chef::Platform.older_than_win_2012_or_8?
+* Chef::Platform.supports_powershell_execution_bypass?
+* Chef::Platform.windows_nano_server?
# What's New in 15.10
## Improvements
-- The `systemd_unit` resource now respects the `sensitive` property and will no longer output the contents of the unit file to logs if this is set.
-- A new `arm?` helper has been added which can be used in recipes and resources to determine if a system is on the ARM architecture.
+* The `systemd_unit` resource now respects the `sensitive` property and will no longer output the contents of the unit file to logs if this is set.
+* A new `arm?` helper has been added which can be used in recipes and resources to determine if a system is on the ARM architecture.
## Bug Fixes
-- Resolved a bug that prevented users from bootstrapping nodes using knife when specifying the `--use_sudo_password`.
-- Resolved a bug that prevented the `--bootstrap-version` flag from being honored when bootstrapping in knife.
+* Resolved a bug that prevented users from bootstrapping nodes using knife when specifying the `--use_sudo_password`.
+* Resolved a bug that prevented the `--bootstrap-version` flag from being honored when bootstrapping in knife.
## Chef InSpec 4.18.104
-- Resolved a regression that prevented the `service` resource from working correctly on Windows. Thanks [@Axuba](https://github.com/Axuba)
-- Implemented VMware and Hyper-V detection on Linux systems
-- Implemented VMware, Hyper-V, VirtualBox, KVM and Xen detection on Windows systems
-- Added helpers `virtual_system?` and `physical_system?`. Thanks [@tecracer-theinen](https://github.com/tecracer-theinen)
+* Resolved a regression that prevented the `service` resource from working correctly on Windows. Thanks [@Axuba](https://github.com/Axuba)
+* Implemented VMware and Hyper-V detection on Linux systems
+* Implemented VMware, Hyper-V, VirtualBox, KVM and Xen detection on Windows systems
+* Added helpers `virtual_system?` and `physical_system?`. Thanks [@tecracer-theinen](https://github.com/tecracer-theinen)
## Ohai 15.9
-- Improve the resiliency of the `Shard` plugin when `dmidecode` cannot be found on a system. Thanks [@jaymzh](https://github.com/jaymzh)
-- Fixed detection of Openstack guests via DMI data. Thanks [@ramereth](https://github.com/ramereth)
+* Improve the resiliency of the `Shard` plugin when `dmidecode` cannot be found on a system. Thanks [@jaymzh](https://github.com/jaymzh)
+* Fixed detection of Openstack guests via DMI data. Thanks [@ramereth](https://github.com/ramereth)
## Platform Support
@@ -913,11 +1301,11 @@ Chef Infra Client is now tested on Amazon Linux 2 running on x86_64 and aarch64
Chef InSpec has been updated from 4.18.85 to 4.18.100:
-- Resolved several failures in executing resources
-- Fixed `auditd` resource processing of action and list
-- Fixed platform detection when running in Habitat
-- "inspec schema" has been revised to be in the JSON Schema draft 7 format
-- Improved the functionality of the `oracledb_session` resource
+* Resolved several failures in executing resources
+* Fixed `auditd` resource processing of action and list
+* Fixed platform detection when running in Habitat
+* "inspec schema" has been revised to be in the JSON Schema draft 7 format
+* Improved the functionality of the `oracledb_session` resource
## Ohai 15.8
@@ -961,15 +1349,15 @@ Our Windows 10 Chef Infra Client packages now receive an additional layer of tes
Ruby has been updated from 2.6.5 to 2.6.6 to resolve the following CVEs:
-- [CVE-2020-16255](https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/): Unsafe Object Creation Vulnerability in JSON (Additional fix)
-- [CVE-2020-10933](https://www.ruby-lang.org/en/news/2020/03/31/heap-exposure-in-socket-cve-2020-10933/): Heap exposure vulnerability in the socket library
+* [CVE-2020-16255](https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/): Unsafe Object Creation Vulnerability in JSON (Additional fix)
+* [CVE-2020-10933](https://www.ruby-lang.org/en/news/2020/03/31/heap-exposure-in-socket-cve-2020-10933/): Heap exposure vulnerability in the socket library
### libarchive
libarchive has been updated from 3.4.0 to 3.4.2 to resolve multiple security vulnerabilities including the following CVEs:
-- [CVE-2019-19221](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19221): archive_wstring_append_from_mbs in archive_string.c has an out-of-bounds read because of an incorrect mbrtowc or mbtowc call
-- [CVE-2020-9308](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9308): archive_read_support_format_rar5.c in libarchive before 3.4.2 attempts to unpack a RAR5 file with an invalid or corrupted header
+* [CVE-2019-19221](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19221): archive_wstring_append_from_mbs in archive_string.c has an out-of-bounds read because of an incorrect mbrtowc or mbtowc call
+* [CVE-2020-9308](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9308): archive_read_support_format_rar5.c in libarchive before 3.4.2 attempts to unpack a RAR5 file with an invalid or corrupted header
# What's New in 15.8
@@ -1037,37 +1425,37 @@ end
The cloud helpers from chef-sugar have been ported to Chef Infra Client:
-* `cloud?` - if the node is running in any cloud, including internal clouds
-* `ec2?` - if the node is running in ec2
-* `gce?` - if the node is running in gce
-* `rackspace?` - if the node is running in rackspace
-* `eucalyptus?` - if the node is running under eucalyptus
-* `linode?` - if the node is running in linode
-* `openstack?` - if the node is running under openstack
-* `azure?` - if the node is running in azure
-* `digital_ocean?` - if the node is running in digital ocean
-* `softlayer?` - if the node is running in softlayer
+* `cloud?` * if the node is running in any cloud, including internal clouds
+* `ec2?` * if the node is running in ec2
+* `gce?` * if the node is running in gce
+* `rackspace?` * if the node is running in rackspace
+* `eucalyptus?` * if the node is running under eucalyptus
+* `linode?` * if the node is running in linode
+* `openstack?` * if the node is running under openstack
+* `azure?` * if the node is running in azure
+* `digital_ocean?` * if the node is running in digital ocean
+* `softlayer?` * if the node is running in softlayer
### Virtualization Helpers
The virtualization helpers from chef-sugar have been ported to Chef Infra Client and extended with helpers to detect hypervisor hosts, physical, and guest systems.
-* `kvm?` - if the node is a kvm guest
-* `kvm_host?` - if the node is a kvm host
-* `lxc?` - if the node is an lxc guest
-* `lxc_host?` - if the node is an lxc host
-* `parallels?`- if the node is a parallels guest
-* `parallels_host?`- if the node is a parallels host
-* `vbox?` - if the node is a virtualbox guest
-* `vbox_host?` - if the node is a virtualbox host
-* `vmware?` - if the node is a vmware guest
-* `vmware_host?` - if the node is a vmware host
-* `openvz?` - if the node is an openvz guest
-* `openvz_host?` - if the node is an openvz host
-* `guest?` - if the node is detected as any kind of guest
-* `hypervisor?` - if the node is detected as being any kind of hypervisor
-* `physical?` - the node is not running as a guest (may be a hypervisor or may be bare-metal)
-* `vagrant?` - attempts to identify the node as a vagrant guest (this check may be error-prone)
+* `kvm?` * if the node is a kvm guest
+* `kvm_host?` * if the node is a kvm host
+* `lxc?` * if the node is an lxc guest
+* `lxc_host?` * if the node is an lxc host
+* `parallels?`* if the node is a parallels guest
+* `parallels_host?`* if the node is a parallels host
+* `vbox?` * if the node is a virtualbox guest
+* `vbox_host?` * if the node is a virtualbox host
+* `vmware?` * if the node is a vmware guest
+* `vmware_host?` * if the node is a vmware host
+* `openvz?` * if the node is an openvz guest
+* `openvz_host?` * if the node is an openvz host
+* `guest?` * if the node is detected as any kind of guest
+* `hypervisor?` * if the node is detected as being any kind of hypervisor
+* `physical?` * the node is not running as a guest (may be a hypervisor or may be bare-metal)
+* `vagrant?` * attempts to identify the node as a vagrant guest (this check may be error-prone)
### include_recipe? helper
@@ -1128,7 +1516,7 @@ vm.swappiness = 10
## Platform Support
-- Chef Infra Clients packages are now validated for Debian 10.
+* Chef Infra Clients packages are now validated for Debian 10.
## macOS Binary Signing
@@ -1146,10 +1534,10 @@ The `archive_file` resource will now only change ownership on files and director
The `cron` and `cron_d` resources now include a `timeout` property, which allows you to configure actions to perform when a job times out. This property accepts a hash of timeout configuration options:
-- `preserve-status`: `true`/`false` with a default of `false`
-- `foreground`: `true`/`false` with a default of `false`
-- `kill-after`: `Integer` for the timeout in seconds
-- `signal`: `String` or `Integer` to send to the process such as `HUP`
+* `preserve-status`: `true`/`false` with a default of `false`
+* `foreground`: `true`/`false` with a default of `false`
+* `kill-after`: `Integer` for the timeout in seconds
+* `signal`: `String` or `Integer` to send to the process such as `HUP`
### launchd
@@ -1191,16 +1579,16 @@ Returns `true` if the system is a Windows Server Core edition.
## Notable Changes and Fixes
-- `knife upload` and `knife cookbook upload` will now generate a metadata.json file from metadata.rb when uploading a cookbook to the Chef Infra Server.
-- A bug in `knife bootstrap` behavior that caused failures when bootstrapping Windows hosts from non-Windows hosts and vice versa has been resolved.
-- The existing system path is now preserved when bootstrapping Windows nodes. Thanks for this fix, [@Xorima](https://github.com/Xorima/).
-- Ohai now properly returns the drive name on Windows and includes new drive_type fields to allow you to determine the type of attached disk. Thanks for this improvement [@sshock](https://github.com/sshock/).
-- Ohai has been updated to properly return DMI data to Chef Infra Client. Thanks for troubleshooting this, [@zmscwx](https://github.com/zmscwx) and [@Sliim](https://github.com/Sliim).
+* `knife upload` and `knife cookbook upload` will now generate a metadata.json file from metadata.rb when uploading a cookbook to the Chef Infra Server.
+* A bug in `knife bootstrap` behavior that caused failures when bootstrapping Windows hosts from non-Windows hosts and vice versa has been resolved.
+* The existing system path is now preserved when bootstrapping Windows nodes. Thanks for this fix, [@Xorima](https://github.com/Xorima/).
+* Ohai now properly returns the drive name on Windows and includes new drive_type fields to allow you to determine the type of attached disk. Thanks for this improvement [@sshock](https://github.com/sshock/).
+* Ohai has been updated to properly return DMI data to Chef Infra Client. Thanks for troubleshooting this, [@zmscwx](https://github.com/zmscwx) and [@Sliim](https://github.com/Sliim).
## Platform Support
-- Chef Infra Clients packages are no longer produced for Windows 2008 R2 as this release reached its end of life on Jan 14th, 2020.
-- Chef Infra Client packages are no longer produced for RHEL 6 on the s390x platform. Builds will continue to be published for RHEL 7 on the s390x platform.
+* Chef Infra Clients packages are no longer produced for Windows 2008 R2 as this release reached its end of life on Jan 14th, 2020.
+* Chef Infra Client packages are no longer produced for RHEL 6 on the s390x platform. Builds will continue to be published for RHEL 7 on the s390x platform.
## Security Updates
@@ -1270,16 +1658,16 @@ This release of Chef Infra Client ships with several optimizations to our Ruby i
Chef InSpec has been updated from 4.17.17 to 4.18.38. This release includes a large number of bug fixes in addition to some great resource enhancements:
-- Inputs can now be used within a `describe.one` block
-- The `service` resource now includes a `startname` property for Windows and systemd services
-- The `interface` resource now includes a `name` property
-- The `user` resource now better supports Windows with the addition of `passwordage`, `maxbadpasswords`, and `badpasswordattempts` properties
-- The `nginx` resource now includes parsing support for wildcard, dot prefix, and regex
-- The `iis_app_pool` resource now handles empty app pools
-- The `filesystem` resource now supports devices with very long names
-- The `apt` better handles URIs and supports repos with an `arch`
-- The `oracledb_session` has received multiple fixes to make it work better
-- The `npm` resource now works under sudo on Unix and on Windows with a custom PATH
+* Inputs can now be used within a `describe.one` block
+* The `service` resource now includes a `startname` property for Windows and systemd services
+* The `interface` resource now includes a `name` property
+* The `user` resource now better supports Windows with the addition of `passwordage`, `maxbadpasswords`, and `badpasswordattempts` properties
+* The `nginx` resource now includes parsing support for wildcard, dot prefix, and regex
+* The `iis_app_pool` resource now handles empty app pools
+* The `filesystem` resource now supports devices with very long names
+* The `apt` better handles URIs and supports repos with an `arch`
+* The `oracledb_session` has received multiple fixes to make it work better
+* The `npm` resource now works under sudo on Unix and on Windows with a custom PATH
## New Resources
@@ -1328,18 +1716,18 @@ Chef Infra Client will now take into account any `default` values specified in c
Several improvements have been made to the `knife bootstrap` command to make it more reliable and secure:
-- File creation is now wrapped in a umask to avoid potential race conditions
-- `NameError` and `RuntimeError` failures during bootstrap have been resolved
-- `Undefined method 'empty?' for nil:NilClass` during bootstrap have been resolved
-- Single quotes in attributes during bootstrap no longer result in bootstrap failures
-- The bootstrap command no longer appears in PS on the host while bootstrapping is running
+* File creation is now wrapped in a umask to avoid potential race conditions
+* `NameError` and `RuntimeError` failures during bootstrap have been resolved
+* `Undefined method 'empty?' for nil:NilClass` during bootstrap have been resolved
+* Single quotes in attributes during bootstrap no longer result in bootstrap failures
+* The bootstrap command no longer appears in PS on the host while bootstrapping is running
## knife supermarket list Improvements
The `knife supermarket list` command now includes two new options:
-- `--sort-by [recently_updated recently_added most_downloaded most_followed]`: Sort cookbooks returned from the Supermarket API
-- `--owned_by`: Limit returned cookbooks to a particular owner
+* `--sort-by [recently_updated recently_added most_downloaded most_followed]`: Sort cookbooks returned from the Supermarket API
+* `--owned_by`: Limit returned cookbooks to a particular owner
## Updated Resources
@@ -1398,10 +1786,10 @@ The `windows_share` resource is now fully idempotent by better validating the pr
Ruby has been updated from 2.6.4 to 2.6.5 in order to resolve the following CVEs:
-- [CVE-2019-16255](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16255): A code injection vulnerability of Shell#[] and Shell#test
-- [CVE-2019-16254](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16254): HTTP response splitting in WEBrick (Additional fix)
-- [CVE-2019-15845](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15845): A NUL injection vulnerability of File.fnmatch and File.fnmatch?
-- [CVE-2019-16201](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16201): Regular Expression Denial of Service vulnerability of WEBrick's Digest access authentication
+* [CVE-2019-16255](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16255): A code injection vulnerability of Shell#[] and Shell#test
+* [CVE-2019-16254](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16254): HTTP response splitting in WEBrick (Additional fix)
+* [CVE-2019-15845](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15845): A NUL injection vulnerability of File.fnmatch and File.fnmatch?
+* [CVE-2019-16201](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16201): Regular Expression Denial of Service vulnerability of WEBrick's Digest access authentication
# What's New in 15.3
@@ -1449,13 +1837,13 @@ The `archive_file` resource now supports archives in the RAR 5.0 format as well
The `user` resource now supports the creation of users on macOS 10.14 and 10.15 systems. The updated resource now complies with macOS TCC policies by using a user with admin privileges to create and modify users. The following new properties have been added for macOS user creation:
-- `admin` sets a user to be an admin.
+* `admin` sets a user to be an admin.
-- `admin_username` and `admin_password` define the admin user credentials required for toggling SecureToken for a user. The value of 'admin_username' must correspond to a system user that is part of the 'admin' with SecureToken enabled in order to toggle SecureToken.
+* `admin_username` and `admin_password` define the admin user credentials required for toggling SecureToken for a user. The value of 'admin_username' must correspond to a system user that is part of the 'admin' with SecureToken enabled in order to toggle SecureToken.
-- `secure_token` is a boolean property that sets the desired state for SecureToken. FileVault requires a SecureToken for full disk encryption.
+* `secure_token` is a boolean property that sets the desired state for SecureToken. FileVault requires a SecureToken for full disk encryption.
-- `secure_token_password` is the plaintext password required to enable or disable `secure_token` for a user. If no salt is specified we assume the 'password' property corresponds to a plaintext password and will attempt to use it in place of secure_token_password if it is not set.
+* `secure_token_password` is the plaintext password required to enable or disable `secure_token` for a user. If no salt is specified we assume the 'password' property corresponds to a plaintext password and will attempt to use it in place of secure_token_password if it is not set.
#### Password property is now sensitive
@@ -1485,10 +1873,10 @@ Chef Infra Client is now validated against AIX 7.2 with packages now available a
Chef InSpec has been updated from 4.10.4 to 4.16.0 with the following changes:
-- A new `postfix_conf` has been added for inspecting Postfix configuration files.
-- A new `plugins` section has been added to the InSpec configuration file which can be used to pass secrets or other configurations into Chef InSpec plugins.
-- The `service` resource now includes a new `startname` property for determining which user is starting the Windows services.
-- The `groups` resource now properly gathers membership information on macOS hosts.
+* A new `postfix_conf` has been added for inspecting Postfix configuration files.
+* A new `plugins` section has been added to the InSpec configuration file which can be used to pass secrets or other configurations into Chef InSpec plugins.
+* The `service` resource now includes a new `startname` property for determining which user is starting the Windows services.
+* The `groups` resource now properly gathers membership information on macOS hosts.
## Security Updates
@@ -1545,20 +1933,20 @@ Packages will no longer be built for Ubuntu 14.04 as Canonical ended maintenance
## Ohai 15.2
Ohai has been updated to 15.2 with the following changes:
- - Improved detection of Openstack including proper detection of Windows nodes running on Openstack when fetching metadata. Thanks [@jjustice6](https://github.com/jjustice6).
- - A new `other_versions` field has been added to the Packages plugin when the node is using RPM. This allows you to see all installed versions of packages, not just the latest version. Thanks [@jjustice6](https://github.com/jjustice6).
- - The Linux Network plugin has been improved to not mark interfaces down if `stp_state` is marked as down. Thanks [@josephmilla](https://github.com/josephmilla).
- - Arch running on ARM processors is now detected as the `arm` platform. Thanks [@BackSlasher](https://github.com/BackSlasher).
+ * Improved detection of Openstack including proper detection of Windows nodes running on Openstack when fetching metadata. Thanks [@jjustice6](https://github.com/jjustice6).
+ * A new `other_versions` field has been added to the Packages plugin when the node is using RPM. This allows you to see all installed versions of packages, not just the latest version. Thanks [@jjustice6](https://github.com/jjustice6).
+ * The Linux Network plugin has been improved to not mark interfaces down if `stp_state` is marked as down. Thanks [@josephmilla](https://github.com/josephmilla).
+ * Arch running on ARM processors is now detected as the `arm` platform. Thanks [@BackSlasher](https://github.com/BackSlasher).
## Chef InSpec 4.10.4
Chef InSpec has been updated from 4.6.4 to 4.10.4 with the following changes:
-- Fix handling multiple triggers in the `windows_task` resource
-- Fix exceptions when resources are used with incompatible transports
-- Un-deprecate the `be_running` matcher on the `service` resource
-- Add resource `sys_info.manufacturer` and `sys_info.model`
-- Add `ip6tables` resource
+* Fix handling multiple triggers in the `windows_task` resource
+* Fix exceptions when resources are used with incompatible transports
+* Un-deprecate the `be_running` matcher on the `service` resource
+* Add resource `sys_info.manufacturer` and `sys_info.model`
+* Add `ip6tables` resource
## Security Updates
@@ -1600,35 +1988,35 @@ Our experimental Target Mode received a large number of updates in Chef Infra Cl
Ohai has been updated to 15.1 with the following changes:
- - The `Shard` plugin properly uses the machine's `machinename`, `serial`, and `uuid` attributes to generate the shard value. The plugin also no longer throws an exception on macOS hosts. Thanks [@michel-slm](https://github.com/michel-slm) for these fixes.
- - The `Virtualbox` plugin has been enhanced to gather information on running guests, storage, and networks when VirtualBox is installed on a node. Thanks [@freakinhippie](https://github.com/freakinhippie) for this new capability.
- - Ohai no longer fails to gather interface information on Solaris in some rare conditions. Thanks [@devoptimist](https://github.com/devoptimist) for this fix.
+ * The `Shard` plugin properly uses the machine's `machinename`, `serial`, and `uuid` attributes to generate the shard value. The plugin also no longer throws an exception on macOS hosts. Thanks [@michel-slm](https://github.com/michel-slm) for these fixes.
+ * The `Virtualbox` plugin has been enhanced to gather information on running guests, storage, and networks when VirtualBox is installed on a node. Thanks [@freakinhippie](https://github.com/freakinhippie) for this new capability.
+ * Ohai no longer fails to gather interface information on Solaris in some rare conditions. Thanks [@devoptimist](https://github.com/devoptimist) for this fix.
## Chef InSpec 4.6.4
Chef InSpec has been updated from 4.3.2 to 4.6.4 with the following changes:
- - InSpec `Attributes` have now been renamed to `Inputs` to avoid confusion with Chef Infra attributes.
- - A new InSpec plugin type of `Input` has been added for defining new input types. See the [InSpec Plugins documentation](https://github.com/inspec/inspec/blob/master/docs/dev/plugins.md#implementing-input-plugins) for more information on writing these plugins.
- - InSpec no longer prints errors to the stdout when passing `--format json`.
- - When fetching profiles from GitHub, the URL can now include periods.
- - The performance of InSpec startup has been improved.
+ * InSpec `Attributes` have now been renamed to `Inputs` to avoid confusion with Chef Infra attributes.
+ * A new InSpec plugin type of `Input` has been added for defining new input types. See the [InSpec Plugins documentation](https://github.com/inspec/inspec/blob/master/docs/dev/plugins.md#implementing-input-plugins) for more information on writing these plugins.
+ * InSpec no longer prints errors to the stdout when passing `--format json`.
+ * When fetching profiles from GitHub, the URL can now include periods.
+ * The performance of InSpec startup has been improved.
# What's New in 15.0.300
This release includes critical bugfixes for the 15.0 release:
- - Fix `knife bootstrap` over SSH when `requiretty` is configured on the host.
- - Added the `--chef-license` CLI flag to `chef-apply` and `chef-solo` commands.
+ * Fix `knife bootstrap` over SSH when `requiretty` is configured on the host.
+ * Added the `--chef-license` CLI flag to `chef-apply` and `chef-solo` commands.
# What's New in 15.0.298
This release includes critical bugfixes for the 15.0 release:
- - Allow accepting the license on non-interactive Windows sessions
- - Resolve license acceptance failures on Windows 2012 R2
- - Improve some `knife` and `chef-client` help text
- - Properly handle session_timeout default value in `knife bootstrap`
- - Avoid failures due to Train::Transports::SSHFailed class not being loaded in `knife bootstrap`
- - Resolve failures using the ca_trust_file option with `knife bootstrap`
+ * Allow accepting the license on non-interactive Windows sessions
+ * Resolve license acceptance failures on Windows 2012 R2
+ * Improve some `knife` and `chef-client` help text
+ * Properly handle session_timeout default value in `knife bootstrap`
+ * Avoid failures due to Train::Transports::SSHFailed class not being loaded in `knife bootstrap`
+ * Resolve failures using the ca_trust_file option with `knife bootstrap`
# What's New in 15.0.293
@@ -1640,10 +2028,10 @@ Chef Client has a new name, but don't worry, it's the same Chef Client you've gr
Chef Infra Client requires an EULA to be accepted by users before it can run. Users can accept the EULA in a variety of ways:
-- `chef-client --chef-license accept`
-- `chef-client --chef-license accept-no-persist`
-- `CHEF_LICENSE="accept" chef-client`
-- `CHEF_LICENSE="accept-no-persist" chef-client`
+* `chef-client --chef-license accept`
+* `chef-client --chef-license accept-no-persist`
+* `CHEF_LICENSE="accept" chef-client`
+* `CHEF_LICENSE="accept-no-persist" chef-client`
Finally, if users run `chef-client` without any of these options, they will receive an interactive prompt asking for license acceptance. If the license is accepted, a marker file will be written to the filesystem unless `accept-no-persist` is specified. Once this marker file is persisted, users no longer need to set any of these flags.
@@ -2057,14 +2445,14 @@ The `windows_task` resource now supports the Start When Available option with a
Chef Infra Client is now tested against the following platforms with packages available on [downloads.chef.io](https://downloads.chef.io):
-- Ubuntu 20.04
-- Ubuntu 18.04 aarch64
-- Debian 10
+* Ubuntu 20.04
+* Ubuntu 18.04 aarch64
+* Debian 10
### Retired Platforms
-- Chef Infra Clients packages are no longer produced for Windows 2008 R2 as this release reached its end of life on Jan 14th, 2020.
-- Chef Infra Client packages are no longer produced for RHEL 6 on the s390x platform.
+* Chef Infra Clients packages are no longer produced for Windows 2008 R2 as this release reached its end of life on Jan 14th, 2020.
+* Chef Infra Client packages are no longer produced for RHEL 6 on the s390x platform.
## Security Updates
@@ -2076,16 +2464,16 @@ OpenSSL has been updated to 1.0.2u to resolve [CVE-2019-1551](https://cve.mitre.
Ruby has been updated from 2.5.7 to 2.5.8 to resolve the following CVEs:
-- [CVE-2020-16255](https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/): Unsafe Object Creation Vulnerability in JSON (Additional fix)
-- [CVE-2020-10933](https://www.ruby-lang.org/en/news/2020/03/31/heap-exposure-in-socket-cve-2020-10933/): Heap exposure vulnerability in the socket library
+* [CVE-2020-16255](https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/): Unsafe Object Creation Vulnerability in JSON (Additional fix)
+* [CVE-2020-10933](https://www.ruby-lang.org/en/news/2020/03/31/heap-exposure-in-socket-cve-2020-10933/): Heap exposure vulnerability in the socket library
# What's New in 14.14.29
## Bug Fixes
-- Fixed an error with the `service` and `systemd_unit` resources which would try to re-enable services with an indirect status.
-- The `systemd_unit` resource now logs at the info level.
-- Fixed knife config when it returned a `TypeError: no implicit conversion of nil into String` error.
+* Fixed an error with the `service` and `systemd_unit` resources which would try to re-enable services with an indirect status.
+* The `systemd_unit` resource now logs at the info level.
+* Fixed knife config when it returned a `TypeError: no implicit conversion of nil into String` error.
## Security Updates
@@ -2097,14 +2485,14 @@ libxslt has been updated to 1.1.34 to resolve [CVE-2019-13118](https://nvd.nist.
## Bug Fixes
-- Resolved a regression introduced in Chef Infra Client 14.14.14 that broke installation of gems in some scenarios
-- Fixed Habitat packaging of `chef-client` artifacts
-- Fixed crash in knife when displaying a missing profile error message
-- Fixed knife subcommand --help not working as intended for some commands
-- Fixed knife ssh interactive mode exit error
-- Fixed for `:day` option not accepting integer value in the `windows_task` resource
-- Fixed for `user` resource not handling a GID if it is specified as a string
-- Fixed the `ifconfig` resource to support interfaces with a `-` in the name
+* Resolved a regression introduced in Chef Infra Client 14.14.14 that broke installation of gems in some scenarios
+* Fixed Habitat packaging of `chef-client` artifacts
+* Fixed crash in knife when displaying a missing profile error message
+* Fixed knife subcommand --help not working as intended for some commands
+* Fixed knife ssh interactive mode exit error
+* Fixed for `:day` option not accepting integer value in the `windows_task` resource
+* Fixed for `user` resource not handling a GID if it is specified as a string
+* Fixed the `ifconfig` resource to support interfaces with a `-` in the name
## What's New in 14.14.14
@@ -2114,20 +2502,20 @@ libxslt has been updated to 1.1.34 to resolve [CVE-2019-13118](https://nvd.nist.
The following platforms are now packaged and tested for Chef Infra Client:
-- Red Hat 8
-- FreeBSD 12
-- macOS 10.15
-- Windows 2019
-- AIX 7.2
+* Red Hat 8
+* FreeBSD 12
+* macOS 10.15
+* Windows 2019
+* AIX 7.2
### Deprecated Platforms
The following platforms have reached EOL status and are no longer packaged or tested for Chef Infra Client:
-- FreeBSD 10
-- macOS 10.12
-- SUSE Linux Enterprise Server (SLES) 11
-- Ubuntu 14.04
+* FreeBSD 10
+* macOS 10.12
+* SUSE Linux Enterprise Server (SLES) 11
+* Ubuntu 14.04
See Chef's [Platform End-of-Life Policy](https://docs.chef.io/platforms.html#platform-end-of-life-policy) for more information on when Chef ends support for an OS release.
@@ -2174,8 +2562,8 @@ end
### New Options for installing Ruby Gems From metadata.rb
Chef Infra Client allows gems to be specified in the cookbook metadata.rb, which can be problematic in some environments. When a cookbook is running in an airgapped environment, Chef Infra Client attempts to connect to rubygems.org even if the gem is already on the system. There are now two additional configuration options that can be set in your `client.rb` config:
- - `gem_installer_bundler_options`: This allows setting additional bundler options for the install such as --local to install from local cache. Example: ["--local", "--clean"].
- - `skip_gem_metadata_installation`: If set to true skip gem metadata installation if all gems are already installed.
+ * `gem_installer_bundler_options`: This allows setting additional bundler options for the install such as --local to install from local cache. Example: ["--local", "--clean"].
+ * `skip_gem_metadata_installation`: If set to true skip gem metadata installation if all gems are already installed.
### SLES / openSUSE 15 detection
@@ -2195,12 +2583,12 @@ Knife now fails with a descriptive error message when attempting to bootstrap no
Ruby has been updated from 2.5.5 to 2.5.7 in order to resolve the following CVEs:
-- [CVE-2012-6708](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6708)
-- [CVE-2015-9251](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9251).
-- [CVE-2019-16201](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15845).
-- [CVE-2019-15845](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9251).
-- [CVE-2019-16254](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16254).
-- [CVE-2019-16255](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16255).
+* [CVE-2012-6708](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6708)
+* [CVE-2015-9251](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9251).
+* [CVE-2019-16201](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15845).
+* [CVE-2019-15845](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9251).
+* [CVE-2019-16254](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16254).
+* [CVE-2019-16255](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16255).
### openssl
@@ -2248,8 +2636,8 @@ The `CHEF-25` deprecation for resource collisions between cookbooks and resource
## Updated Components
-- openssl 1.0.2r -> 1.0.2s (bugfix only release)
-- cacerts 2019-01-23 -> 2019-05-15
+* openssl 1.0.2r -> 1.0.2s (bugfix only release)
+* cacerts 2019-01-23 -> 2019-05-15
# What's New in 14.12.9
@@ -2259,9 +2647,9 @@ In preparation for Chef Infra Client 15.0 we've added a placeholder `--chef-lice
## Important Bug Fixes
-- Blacklisting and whitelisting default and override level attributes is once again possible.
-- You may now encrypt a previously unencrypted data bag.
-- Resolved a regression introduced in Chef Infra Client 14.12.3 that resulted in errors when managing Windows services
+* Blacklisting and whitelisting default and override level attributes is once again possible.
+* You may now encrypt a previously unencrypted data bag.
+* Resolved a regression introduced in Chef Infra Client 14.12.3 that resulted in errors when managing Windows services
# What's New in 14.12.3
@@ -2277,10 +2665,10 @@ The windows_certificate resource now imports nested certificates while importing
## Updated Components
-- nokogiri 1.10.1 -> 1.10.2
-- ruby 2.5.3 -> 2.5.5
-- InSpec 3.7.1 -> 3.9.0
-- The unused windows-api gem is no longer bundled with Chef on Windows hosts
+* nokogiri 1.10.1 -> 1.10.2
+* ruby 2.5.3 -> 2.5.5
+* InSpec 3.7.1 -> 3.9.0
+* The unused windows-api gem is no longer bundled with Chef on Windows hosts
# What's New in 14.11
@@ -2316,9 +2704,9 @@ InSpec has been updated from 3.4.1 to 3.7.1. This new release contains improveme
## Updated Components
-- bundler 1.16.1 -> 1.17.3
-- libxml2 2.9.7 -> 2.9.9
-- ca-certs updated to 2019-01-22 for new roots
+* bundler 1.16.1 -> 1.17.3
+* libxml2 2.9.7 -> 2.9.9
+* ca-certs updated to 2019-01-22 for new roots
## Security Updates
@@ -2330,12 +2718,12 @@ OpenSSL has been updated to 1.0.2r in order to resolve [CVE-2019-1559](https://c
RubyGems has been updated to 2.7.9 in order to resolve the following CVEs:
-- [CVE-2019-8320](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8320): Delete directory using symlink when decompressing tar
-- [CVE-2019-8321](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8321): Escape sequence injection vulnerability in verbose
-- [CVE-2019-8322](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8322): Escape sequence injection vulnerability in gem owner
-- [CVE-2019-8323](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8323): Escape sequence injection vulnerability in API response handling
-- [CVE-2019-8324](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8324): Installing a malicious gem may lead to arbitrary code execution
-- [CVE-2019-8325](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8325): Escape sequence injection vulnerability in errors
+* [CVE-2019-8320](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8320): Delete directory using symlink when decompressing tar
+* [CVE-2019-8321](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8321): Escape sequence injection vulnerability in verbose
+* [CVE-2019-8322](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8322): Escape sequence injection vulnerability in gem owner
+* [CVE-2019-8323](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8323): Escape sequence injection vulnerability in API response handling
+* [CVE-2019-8324](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8324): Installing a malicious gem may lead to arbitrary code execution
+* [CVE-2019-8325](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8325): Escape sequence injection vulnerability in errors
# What's New in 14.10
@@ -2502,12 +2890,12 @@ BSD-based systems can now detect guests running on KVM and Amazon's hypervisor w
### New Platform Support
-- Ohai now properly detects the openSUSE 15.X platform. Thank you [@megamorf](https://github.com/megamorf) for reporting this issue.
-- SUSE Linux Enterprise Desktop now identified as platform_family 'suse'
-- XCP-NG is now identified as platform 'xcp' and platform_family 'rhel'. Thank you [@heyjodom](http://github.com/heyjodom) for submitting this enhancement.
-- Mangeia Linux is now identified as platform 'mangeia' and platform_family 'mandriva'
-- Antergos Linux now identified as platform_family 'arch'
-- Manjaro Linux now identified as platform_family 'arch'
+* Ohai now properly detects the openSUSE 15.X platform. Thank you [@megamorf](https://github.com/megamorf) for reporting this issue.
+* SUSE Linux Enterprise Desktop now identified as platform_family 'suse'
+* XCP-NG is now identified as platform 'xcp' and platform_family 'rhel'. Thank you [@heyjodom](http://github.com/heyjodom) for submitting this enhancement.
+* Mangeia Linux is now identified as platform 'mangeia' and platform_family 'mandriva'
+* Antergos Linux now identified as platform_family 'arch'
+* Manjaro Linux now identified as platform_family 'arch'
## Security Updates
@@ -2515,8 +2903,8 @@ BSD-based systems can now detect guests running on KVM and Amazon's hypervisor w
OpenSSL has been updated to 1.0.2q in order to resolve:
-- Microarchitecture timing vulnerability in ECC scalar multiplication [CVE-2018-5407](https://nvd.nist.gov/vuln/detail/CVE-2018-5407)
-- Timing vulnerability in DSA signature generation ([CVE-2018-0734](https://nvd.nist.gov/vuln/detail/CVE-2018-0734))
+* Microarchitecture timing vulnerability in ECC scalar multiplication [CVE-2018-5407](https://nvd.nist.gov/vuln/detail/CVE-2018-5407)
+* Timing vulnerability in DSA signature generation ([CVE-2018-0734](https://nvd.nist.gov/vuln/detail/CVE-2018-0734))
# What's New in 14.7
@@ -2622,12 +3010,12 @@ Chef is now tested against macOS Mojave, and packages are now available at downl
## Important Bugfixes
-- Multiple bugfixes in Chef Vault have been resolved by updating chef-vault to 3.4.2
-- Invalid yum package names now gracefully fail
-- `windows_ad_join` now properly executes. Thank you [@cpjones01](https://github.com/cpjones01) for reporting this.
-- `rhsm_errata_level` now properly executes. Thank you [@freakinhippie](https://github.com/freakinhippie) for this fix.
-- `registry_key` now properly writes out the correct value when `sensitive` is specified. Thank you [@josh-barker](https://github.com/josh-barker) for this fix.
-- `locale` now properly executes on RHEL 6 and Amazon Linux 201X.
+* Multiple bugfixes in Chef Vault have been resolved by updating chef-vault to 3.4.2
+* Invalid yum package names now gracefully fail
+* `windows_ad_join` now properly executes. Thank you [@cpjones01](https://github.com/cpjones01) for reporting this.
+* `rhsm_errata_level` now properly executes. Thank you [@freakinhippie](https://github.com/freakinhippie) for this fix.
+* `registry_key` now properly writes out the correct value when `sensitive` is specified. Thank you [@josh-barker](https://github.com/josh-barker) for this fix.
+* `locale` now properly executes on RHEL 6 and Amazon Linux 201X.
## Ohai 14.6
@@ -2655,16 +3043,16 @@ The system_profile plugin will be removed from Chef/Ohai 15 in April 2019. This
Ruby has been updated to from 2.5.1 to 2.5.3 to resolve multiple CVEs and bugs:
-- [CVE-2018-16396](https://www.ruby-lang.org/en/news/2018/10/17/not-propagated-taint-flag-in-some-formats-of-pack-cve-2018-16396/)
-- [CVE-2018-16395](https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/)
+* [CVE-2018-16396](https://www.ruby-lang.org/en/news/2018/10/17/not-propagated-taint-flag-in-some-formats-of-pack-cve-2018-16396/)
+* [CVE-2018-16395](https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/)
# What's New in 14.5.33
This release resolves a regression that caused the ``windows_ad_join`` resource to fail to run. It also makes the following additional fixes:
-- The ``ohai`` resource's unused ``ohai_name`` property has been deprecated. This will be removed in Chef Infra Client 15.0.
-- Error messages in the ``windows_feature`` resources have been improved.
-- The ``windows_service`` resource will no longer log potentially sensitive information if the ``sensitive`` property is used.
+* The ``ohai`` resource's unused ``ohai_name`` property has been deprecated. This will be removed in Chef Infra Client 15.0.
+* Error messages in the ``windows_feature`` resources have been improved.
+* The ``windows_service`` resource will no longer log potentially sensitive information if the ``sensitive`` property is used.
Thanks to @cpjones01, @kitforbes, and @dgreeninger for their help with this release.
@@ -2702,11 +3090,11 @@ Thanks [@derekgroh](https://github.com/derekgroh) for contributing this new prop
InSpec has been updated from 2.2.70 to 2.2.102. This new version includes the following improvements:
-- Support for using ERB templating within the .yml files
-- HTTP basic auth support for fetching dependent profiles
-- A new global attributes concept
-- Better error handling with Automate reporting
-- Vendor command now vendors profiles when using path://
+* Support for using ERB templating within the .yml files
+* HTTP basic auth support for fetching dependent profiles
+* A new global attributes concept
+* Better error handling with Automate reporting
+* Vendor command now vendors profiles when using path://
## Ohai 14.5
@@ -2836,8 +3224,8 @@ Thank you [@dbresson](https://github.com/dbresson) for this contribution.
OpenSSL updated to 1.0.2p to resolve:
-- Client DoS due to large DH parameter ([CVE-2018-0732](https://nvd.nist.gov/vuln/detail/CVE-2018-0732))
-- Cache timing vulnerability in RSA Key Generation ([CVE-2018-0737](https://nvd.nist.gov/vuln/detail/CVE-2018-0737))
+* Client DoS due to large DH parameter ([CVE-2018-0732](https://nvd.nist.gov/vuln/detail/CVE-2018-0732))
+* Cache timing vulnerability in RSA Key Generation ([CVE-2018-0737](https://nvd.nist.gov/vuln/detail/CVE-2018-0737))
# What's New in 14.3
@@ -2857,13 +3245,13 @@ Use the chocolatey_config resource to add or remove Chocolatey configuration key
#### Actions
-- `set` - Sets a Chocolatey config value.
-- `unset` - Unsets a Chocolatey config value.
+* `set` * Sets a Chocolatey config value.
+* `unset` * Unsets a Chocolatey config value.
#### Properties
-- `config_key` - The name of the config. We'll use the resource's name if this isn't provided.
-- `value` - The value to set.
+* `config_key` * The name of the config. We'll use the resource's name if this isn't provided.
+* `value` * The value to set.
### chocolatey_source
@@ -2871,15 +3259,15 @@ Use the chocolatey_source resource to add or remove Chocolatey sources.
#### Actions
-- `add` - Adds a Chocolatey source.
-- `remove` - Removes a Chocolatey source.
+* `add` * Adds a Chocolatey source.
+* `remove` * Removes a Chocolatey source.
#### Properties
-- `source_name` - The name of the source to add. We'll use the resource's name if this isn't provided.
-- `source` - The source URL.
-- `bypass_proxy` - Whether or not to bypass the system's proxy settings to access the source.
-- `priority` - The priority level of the source.
+* `source_name` * The name of the source to add. We'll use the resource's name if this isn't provided.
+* `source` * The source URL.
+* `bypass_proxy` * Whether or not to bypass the system's proxy settings to access the source.
+* `priority` * The priority level of the source.
### powershell_package_source
@@ -2887,18 +3275,18 @@ Use the `powershell_package_source` resource to register a PowerShell package re
### Actions
-- `register` - Registers and updates the PowerShell package source.
-- `unregister` - Unregisters the PowerShell package source.
+* `register` * Registers and updates the PowerShell package source.
+* `unregister` * Unregisters the PowerShell package source.
#### Properties
-- `source_name` - The name of the package source.
-- `url` - The url to the package source.
-- `trusted` - Whether or not to trust packages from this source.
-- `provider_name` - The package management provider for the source. It supports the following providers: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' and 'chocolatey'.
-- `publish_location` - The url where modules will be published to for this source. Only valid if the provider is 'PowerShellGet'.
-- `script_source_location` - The url where scripts are located for this source. Only valid if the provider is 'PowerShellGet'.
-- `script_publish_location` - The location where scripts will be published to for this source. Only valid if the provider is 'PowerShellGet'.
+* `source_name` * The name of the package source.
+* `url` * The URL to the package source.
+* `trusted` * Whether or not to trust packages from this source.
+* `provider_name` * The package management provider for the source. It supports the following providers: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' and 'chocolatey'.
+* `publish_location` * The URL where modules will be published to for this source. Only valid if the provider is 'PowerShellGet'.
+* `script_source_location` * The URL where scripts are located for this source. Only valid if the provider is 'PowerShellGet'.
+* `script_publish_location` * The location where scripts will be published to for this source. Only valid if the provider is 'PowerShellGet'.
### kernel_module
@@ -2906,17 +3294,17 @@ Use the kernel_module resource to manage kernel modules on Linux systems. This r
#### Actions
-- `install` - Load kernel module, and ensure it loads on reboot.
-- `uninstall` - Unload a kernel module and remove module config, so it doesn't load on reboot.
-- `blacklist` - Blacklist a kernel module.
-- `load` - Load a kernel module.
-- `unload` - Unload kernel module
+* `install` * Load kernel module, and ensure it loads on reboot.
+* `uninstall` * Unload a kernel module and remove module config, so it doesn't load on reboot.
+* `blacklist` * Blacklist a kernel module.
+* `load` * Load a kernel module.
+* `unload` * Unload kernel module
#### Properties
-- `modname` - The name of the kernel module.
-- `load_dir` - The directory to load modules from.
-- `unload_dir` - The modprobe.d directory.
+* `modname` * The name of the kernel module.
+* `load_dir` * The directory to load modules from.
+* `unload_dir` * The modprobe.d directory.
### ssh_known_hosts_entry
@@ -2924,21 +3312,21 @@ Use the ssh_known_hosts_entry resource to add an entry for the specified host in
#### Actions
-- `create` - Create an entry in the ssh_known_hosts file.
-- `flush` - Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the Chef run so all entries can be accumulated before writing the file out.
+* `create` * Create an entry in the ssh_known_hosts file.
+* `flush` * Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the Chef run so all entries can be accumulated before writing the file out.
#### Properties
-- `host` - The host to add to the known hosts file.
-- `key` - An optional key for the host. If not provided this will be automatically determined.
-- `key_type` - The type of key to store.
-- `port` - The server port that the ssh-keyscan command will use to gather the public key.
-- `timeout` - The timeout in seconds for ssh-keyscan.
-- `mode` - The file mode for the ssh_known_hosts file.
-- `owner`- The file owner for the ssh_known_hosts file.
-- `group` - The file group for the ssh_known_hosts file.
-- `hash_entries` - Hash the hostname and addresses in the ssh_known_hosts file for privacy.
-- `file_location` - The location of the ssh known hosts file. Change this to set a known host file for a particular user.
+* `host` * The host to add to the known hosts file.
+* `key` * An optional key for the host. If not provided this will be automatically determined.
+* `key_type` * The type of key to store.
+* `port` * The server port that the ssh-keyscan command will use to gather the public key.
+* `timeout` * The timeout in seconds for ssh-keyscan.
+* `mode` * The file mode for the ssh_known_hosts file.
+* `owner`* The file owner for the ssh_known_hosts file.
+* `group` * The file group for the ssh_known_hosts file.
+* `hash_entries` * Hash the hostname and addresses in the ssh_known_hosts file for privacy.
+* `file_location` * The location of the ssh known hosts file. Change this to set a known host file for a particular user.
## New `knife config get` command
@@ -2964,14 +3352,14 @@ You can also pass specific keys to only display those `knife config get node_nam
The following helper methods have been deprecated in favor of the single shell_out helper:
-- `shell_out_with_systems_locale`
-- `shell_out_with_timeout`
-- `shell_out_compact`
-- `shell_out_compact_timeout`
-- `shell_out_with_systems_locale!`
-- `shell_out_with_timeout!`
-- `shell_out_compact!`
-- `shell_out_compact_timeout!`
+* `shell_out_with_systems_locale`
+* `shell_out_with_timeout`
+* `shell_out_compact`
+* `shell_out_compact_timeout`
+* `shell_out_with_systems_locale!`
+* `shell_out_with_timeout!`
+* `shell_out_compact!`
+* `shell_out_compact_timeout!`
The functionality of `shell_out_with_systems_locale` has been implemented using the `default_env: false` option that removes the PATH and locale mangling that has been the default behavior of `shell_out`.
@@ -3001,9 +3389,9 @@ provisioner:
solo_rb:
treat_deprecation_warnings_as_errors: true
silence_deprecation_warnings:
- - deploy_resource
- - chef-23
- - recipes/install.rb:22
+ * deploy_resource
+ * chef-23
+ * recipes/install.rb:22
```
You can also silence deprecations using a comment on the line that is raising the warning:
@@ -3016,12 +3404,12 @@ We advise caution in the use of this feature, as excessive or prolonged silencin
## Misc Windows improvements
-- A new `skip_publisher_check` property has been added to the `powershell_package` resource
-- `windows_feature_powershell` now supports Windows 2008 R2
-- The `mount` resource now supports the `mount_point` property on Windows
-- `windows_feature_dism` no longer errors when specifying the source
-- Resolved idempotency issues in the `windows_task` resource and prevented setting up a task with bad credentials
-- `windows_service` no longer throws Ruby deprecation warnings
+* A new `skip_publisher_check` property has been added to the `powershell_package` resource
+* `windows_feature_powershell` now supports Windows 2008 R2
+* The `mount` resource now supports the `mount_point` property on Windows
+* `windows_feature_dism` no longer errors when specifying the source
+* Resolved idempotency issues in the `windows_task` resource and prevented setting up a task with bad credentials
+* `windows_service` no longer throws Ruby deprecation warnings
## Newly Introduced Deprecations
@@ -3070,18 +3458,18 @@ Ohai now detects the virtualization hypervisor `amazonec2` when running on Amazo
This release resolves a number of regressions in 14.1.1:
-- `git` resource: don't use `--prune-tags` as it's really new.
-- `rhsm_repo` resource: now works
-- `apt_repository` resource: use the `repo_name` property to name files
-- `windows_task` resource: properly handle commands with arguments
-- `windows_task` resource: handle creating tasks as the SYSTEM user
-- `remote_directory` resource: restore the default for the `overwrite` property
+* `git` resource: don't use `--prune-tags` as it's really new.
+* `rhsm_repo` resource: now works
+* `apt_repository` resource: use the `repo_name` property to name files
+* `windows_task` resource: properly handle commands with arguments
+* `windows_task` resource: handle creating tasks as the SYSTEM user
+* `remote_directory` resource: restore the default for the `overwrite` property
## Ohai 14.1.3
-- Properly detect FIPS environments
-- `shard` plugin: work in FIPS compliant environments
-- `filesystem` plugin: Handle BSD platforms
+* Properly detect FIPS environments
+* `shard` plugin: work in FIPS compliant environments
+* `filesystem` plugin: Handle BSD platforms
# What's New in 14.1.1
@@ -3105,19 +3493,19 @@ The `ignore_failure` property takes a new argument, `:quiet`, to suppress the er
## This release of Chef Client 14 resolves a number of regressions in 14.0
-- On Windows, the installer now correctly re-extracts files during repair mode
-- Fix a number of issues relating to use with Red Hat Satellite
-- Git fetch now prunes remotes before running
-- Fix locking and unlocking packages with apt and zypper
-- Ensure we don't request every remote file when running with lazy loading enabled
-- The sysctl resource correctly handles missing keys when used with `ignore_error`
-- --recipe-url apparently never worked on Windows. Now it does.
+* On Windows, the installer now correctly re-extracts files during repair mode
+* Fix a number of issues relating to use with Red Hat Satellite
+* Git fetch now prunes remotes before running
+* Fix locking and unlocking packages with apt and zypper
+* Ensure we don't request every remote file when running with lazy loading enabled
+* The sysctl resource correctly handles missing keys when used with `ignore_error`
+* --recipe-url apparently never worked on Windows. Now it does.
## Security Updates
### ffi Gem
-- CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS
+* CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS
# Ohai Release Notes 14.1:
@@ -3137,10 +3525,10 @@ A new plugin to enumerate SCSI devices has been added. This plugin is optional.
This release of Chef 14 resolves several regressions in the Chef 14.0 release.
-- Resources contained in cookbooks would be used instead of built-in Chef client resources causing older resources to run
-- Resources failed due to a missing `property_is_set?` and `resources` methods
-- `yum_package` changed the order of `disablerepo` and `enablerepo` options
-- Depsolving large numbers of cookbooks with chef zero/local took a very long time
+* Resources contained in cookbooks would be used instead of built-in Chef client resources causing older resources to run
+* Resources failed due to a missing `property_is_set?` and `resources` methods
+* `yum_package` changed the order of `disablerepo` and `enablerepo` options
+* Depsolving large numbers of cookbooks with chef zero/local took a very long time
# What's New in 14.0
@@ -3358,9 +3746,9 @@ The `sensitive` property can now be used in `registry_key` to suppress the outpu
`systemd_unit` includes the following new actions:
-- `preset` - Restore the preset enable/disable configuration for a unit
-- `revert` - Revert to a vendor's version of a unit file
-- `reenable` - Reenable a unit file
+* `preset` * Restore the preset enable/disable configuration for a unit
+* `revert` * Revert to a vendor's version of a unit file
+* `reenable` * Reenable a unit file
Thanks @nathwill for these new actions.
@@ -3368,9 +3756,9 @@ Thanks @nathwill for these new actions.
`windows_service` now includes actions for fully managing services on Windows, in addition to the previous actions for starting/stopping/enabling services.
-- `create` - Create a new service
-- `delete` - Delete an existing service
-- `configure` - Reconfigure an existing service
+* `create` * Create a new service
+* `delete` * Delete an existing service
+* `configure` * Reconfigure an existing service
Thanks @jasonwbarnett for these new actions
@@ -3388,9 +3776,9 @@ Ohai has been expanded to collect more information than ever. This should make w
The kernel plugin now reports the following information on Windows:
-- `node['kernel']['product_type']` - Workstation vs. Server editions of Windows
-- `node['kernel']['system_type']` - What kind of hardware are we installed on (Desktop, Mobile, Workstation, Enterprise Server, etc.)
-- `node['kernel']['server_core']` - Are we on Windows Server Core edition?
+* `node['kernel']['product_type']` * Workstation vs. Server editions of Windows
+* `node['kernel']['system_type']` * What kind of hardware are we installed on (Desktop, Mobile, Workstation, Enterprise Server, etc.)
+* `node['kernel']['server_core']` * Are we on Windows Server Core edition?
### Cloud Detection
@@ -3472,13 +3860,13 @@ OpenSSL has been updated to 1.0.2o to resolve [CVE-2018-0739](https://cve.mitre.
Ruby has been updated to 2.5.1 to resolve the following vulnerabilities:
-- [cve-2017-17742](https://www.ruby-lang.org/en/news/2018/03/28/http-response-splitting-in-webrick-cve-2017-17742/)
-- [cve-2018-6914](https://www.ruby-lang.org/en/news/2018/03/28/unintentional-file-and-directory-creation-with-directory-traversal-cve-2018-6914/)
-- [cve-2018-8777](https://www.ruby-lang.org/en/news/2018/03/28/large-request-dos-in-webrick-cve-2018-8777/)
-- [cve-2018-8778](https://www.ruby-lang.org/en/news/2018/03/28/buffer-under-read-unpack-cve-2018-8778/)
-- [cve-2018-8779](https://www.ruby-lang.org/en/news/2018/03/28/poisoned-nul-byte-unixsocket-cve-2018-8779/)
-- [cve-2018-8780](https://www.ruby-lang.org/en/news/2018/03/28/poisoned-nul-byte-dir-cve-2018-8780/)
-- [Multiple vulnerabilities in rubygems](https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/)
+* [cve-2017-17742](https://www.ruby-lang.org/en/news/2018/03/28/http-response-splitting-in-webrick-cve-2017-17742/)
+* [cve-2018-6914](https://www.ruby-lang.org/en/news/2018/03/28/unintentional-file-and-directory-creation-with-directory-traversal-cve-2018-6914/)
+* [cve-2018-8777](https://www.ruby-lang.org/en/news/2018/03/28/large-request-dos-in-webrick-cve-2018-8777/)
+* [cve-2018-8778](https://www.ruby-lang.org/en/news/2018/03/28/buffer-under-read-unpack-cve-2018-8778/)
+* [cve-2018-8779](https://www.ruby-lang.org/en/news/2018/03/28/poisoned-nul-byte-unixsocket-cve-2018-8779/)
+* [cve-2018-8780](https://www.ruby-lang.org/en/news/2018/03/28/poisoned-nul-byte-dir-cve-2018-8780/)
+* [Multiple vulnerabilities in rubygems](https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/)
## Breaking Changes
@@ -3498,11 +3886,11 @@ Support for Windows 2003 has been removed from both Chef and Ohai, improving the
### knife deprecations
-- `knife bootstrap` options `--distro` and `--template_file` flags were deprecated in Chef 12 and have now been removed.
-- `knife help` functionality that read legacy Chef manpages has been removed as the manpages had not been updated and were often quite wrong. Running knife help will now simply show the help menu.
-- `knife index rebuild` has been removed as reindexing Chef Server was only necessary on releases prior to Chef Server 11.
-- The `knife ssh --identity-file` flag was deprecated and has been removed. Users should use the `--ssh_identity_file` flag instead.
-- `knife ssh csshx` was deprecated in Chef 10 and has been removed. Users should use `knife ssh cssh` instead.
+* `knife bootstrap` options `--distro` and `--template_file` flags were deprecated in Chef 12 and have now been removed.
+* `knife help` functionality that read legacy Chef manpages has been removed as the manpages had not been updated and were often quite wrong. Running knife help will now simply show the help menu.
+* `knife index rebuild` has been removed as reindexing Chef Server was only necessary on releases prior to Chef Server 11.
+* The `knife ssh --identity-file` flag was deprecated and has been removed. Users should use the `--ssh_identity_file` flag instead.
+* `knife ssh csshx` was deprecated in Chef 10 and has been removed. Users should use `knife ssh cssh` instead.
### Chef Solo `-r` flag
@@ -3528,11 +3916,11 @@ The original name for the `ignore_failure` property in resource was `epic_fail`.
Several legacy mixins mostly used in older HWRPs have been removed. Usage of these mixins has resulted in deprecation warnings for several years and they are rarely used in cookbooks available on the Supermarket.
-- Chef::Mixin::LanguageIncludeAttribute
-- Chef::Mixin::RecipeDefinitionDSLCore
-- Chef::Mixin::LanguageIncludeRecipe
-- Chef::Mixin::Language
-- Chef::DSL::Recipe::FullDSL
+* Chef::Mixin::LanguageIncludeAttribute
+* Chef::Mixin::RecipeDefinitionDSLCore
+* Chef::Mixin::LanguageIncludeRecipe
+* Chef::Mixin::Language
+* Chef::DSL::Recipe::FullDSL
### cloud_v2 and filesystem2 Ohai Plugins
@@ -3564,16 +3952,16 @@ optional_plugins [ "lspci", "passwd" ]
## Bugfixes
-- The mount provider now properly adds blank lines between fstab entries on AIX
-- Ohai now reports itself as Ohai well communicating with GCE metadata endpoints
-- Property deprecations in custom resources no longer result in an error. Thanks for reporting this [martinisoft](https://github.com/martinisoft)
-- mixlib-archive has been updated to prevent corruption of archives on Windows systems
+* The mount provider now properly adds blank lines between fstab entries on AIX
+* Ohai now reports itself as Ohai well communicating with GCE metadata endpoints
+* Property deprecations in custom resources no longer result in an error. Thanks for reporting this [martinisoft](https://github.com/martinisoft)
+* mixlib-archive has been updated to prevent corruption of archives on Windows systems
## Updated Components
-- libxml2 2.9.7 -> 2.9.9
-- ca-certs updated to 2019-01-22 for new roots
-- nokogiri 1.8.5 -> 1.10.1
+* libxml2 2.9.7 -> 2.9.9
+* ca-certs updated to 2019-01-22 for new roots
+* nokogiri 1.8.5 -> 1.10.1
## Security Updates
@@ -3584,12 +3972,12 @@ OpenSSL has been updated to 1.0.2r in order to resolve [CVE-2019-1559](https://c
### RubyGems
RubyGems has been updated to 2.7.9 in order to resolve the following CVEs:
- - [CVE-2019-8320](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8320): Delete directory using symlink when decompressing tar
- - [CVE-2019-8321](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8321): Escape sequence injection vulnerability in verbose
- - [CVE-2019-8322](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8322): Escape sequence injection vulnerability in gem owner
- - [CVE-2019-8323](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8323): Escape sequence injection vulnerability in API response handling
- - [CVE-2019-8324](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8324): Installing a malicious gem may lead to arbitrary code execution
- - [CVE-2019-8325](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8325): Escape sequence injection vulnerability in errors
+ * [CVE-2019-8320](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8320): Delete directory using symlink when decompressing tar
+ * [CVE-2019-8321](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8321): Escape sequence injection vulnerability in verbose
+ * [CVE-2019-8322](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8322): Escape sequence injection vulnerability in gem owner
+ * [CVE-2019-8323](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8323): Escape sequence injection vulnerability in API response handling
+ * [CVE-2019-8324](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8324): Installing a malicious gem may lead to arbitrary code execution
+ * [CVE-2019-8325](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8325): Escape sequence injection vulnerability in errors
# What's New in 13.12.3
@@ -3603,8 +3991,8 @@ Chef is now tested against macOS Mojave and packages are now available at downlo
## SUSE Linux Enterprise Server 15
-- Ohai now properly detects SLES 15
-- The Chef package will no longer remove symlinks to chef-client and ohai when upgrading on SLES 15
+* Ohai now properly detects SLES 15
+* The Chef package will no longer remove symlinks to chef-client and ohai when upgrading on SLES 15
## Updated Chef-Vault
@@ -3618,8 +4006,8 @@ Improved Windows installation speed by skipping unnecessary steps when Windows I
### macOS Improvements
-- sysctl commands have been modified to gather only the bare minimum required data, which prevents sysctl hanging in some scenarios
-- Extra data has been removed from the system_profile plugin, reducing the amount of data stored on the chef-server for each node
+* sysctl commands have been modified to gather only the bare minimum required data, which prevents sysctl hanging in some scenarios
+* Extra data has been removed from the system_profile plugin, reducing the amount of data stored on the chef-server for each node
## New Deprecations
@@ -3636,51 +4024,51 @@ The ``ohai`` resource's unused ``ohai_name`` property has been deprecated. This
### Ruby 2.4.5
Ruby has been updated to from 2.4.4 to 2.4.5 to resolve multiple CVEs as well as bugs:
-- [CVE-2018-16396](https://www.ruby-lang.org/en/news/2018/10/17/not-propagated-taint-flag-in-some-formats-of-pack-cve-2018-16396/)
-- [CVE-2018-16395](https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/)
+* [CVE-2018-16396](https://www.ruby-lang.org/en/news/2018/10/17/not-propagated-taint-flag-in-some-formats-of-pack-cve-2018-16396/)
+* [CVE-2018-16395](https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/)
# What's New in 13.11
### Sensitive Properties on Windows
-- `windows_service` no longer logs potentially sensitive information when a service is setup
-- `windows_package` now respects the `sensitive` property to avoid logging sensitive data in the event of a package installation failure
+* `windows_service` no longer logs potentially sensitive information when a service is setup
+* `windows_package` now respects the `sensitive` property to avoid logging sensitive data in the event of a package installation failure
### Other Fixes
-- `remote_directory` now properly loads files in the root of a cookbook's `files` directory
-- `osx_profile` now uses the full path the profiles CLI tool to avoid running other binaries of the same name in a users path
-- `package` resources that don't support the `allow_downgrade` property will no longer fail
-- `knife bootstrap windows` error messages have been improved
+* `remote_directory` now properly loads files in the root of a cookbook's `files` directory
+* `osx_profile` now uses the full path the profiles CLI tool to avoid running other binaries of the same name in a users path
+* `package` resources that don't support the `allow_downgrade` property will no longer fail
+* `knife bootstrap windows` error messages have been improved
## Security Updates
### OpenSSL
-- OpenSSL has been updated to 1.0.2p to resolve [CVE-2018-0732](https://nvd.nist.gov/vuln/detail/CVE-2018-0732) and [CVE-2018-0737](https://nvd.nist.gov/vuln/detail/CVE-2018-0737)
+* OpenSSL has been updated to 1.0.2p to resolve [CVE-2018-0732](https://nvd.nist.gov/vuln/detail/CVE-2018-0732) and [CVE-2018-0737](https://nvd.nist.gov/vuln/detail/CVE-2018-0737)
### Rubyzip
-- Updated Rubyzip to 1.2.2 to resolve [CVE-2018-1000544](https://nvd.nist.gov/vuln/detail/CVE-2018-1000544)
+* Updated Rubyzip to 1.2.2 to resolve [CVE-2018-1000544](https://nvd.nist.gov/vuln/detail/CVE-2018-1000544)
# What's New in 13.10
## Bugfixes
-- Resolves a duplicate logging getting created when redirecting stdout
-- Using --recipe-url with a local file on Windows no longer fails
-- Service resource no longer throws Ruby deprecation warnings on Windows
+* Resolves a duplicate logging getting created when redirecting stdout
+* Using --recipe-url with a local file on Windows no longer fails
+* Service resource no longer throws Ruby deprecation warnings on Windows
## Ohai 13.10 Improvements
-- Correctly identify the platform_version on the final release of Amazon Linux 2.0
-- Detect nodes with the DMI data of "OpenStack Compute" as being OpenStack nodes
+* Correctly identify the platform_version on the final release of Amazon Linux 2.0
+* Detect nodes with the DMI data of "OpenStack Compute" as being OpenStack nodes
## Security Updates
### ffi Gem
-- CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS
+* CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS
# What's New in 13.9.X:
@@ -3688,21 +4076,21 @@ Ruby has been updated to from 2.4.4 to 2.4.5 to resolve multiple CVEs as well as
Ruby has been updated to 2.4.4
-- CVE-2017-17742: HTTP response splitting in WEBrick
-- CVE-2018-6914: Unintentional file and directory creation with directory traversal in tempfile and tmpdir
-- CVE-2018-8777: DoS by large request in WEBrick
-- CVE-2018-8778: Buffer under-read in String#unpack
-- CVE-2018-8779: Unintentional socket creation by poisoned NUL byte in UNIXServer and UNIXSocket
-- CVE-2018-8780: Unintentional directory traversal by poisoned NUL byte in Dir
-- Multiple vulnerabilities in RubyGems
+* CVE-2017-17742: HTTP response splitting in WEBrick
+* CVE-2018-6914: Unintentional file and directory creation with directory traversal in tempfile and tmpdir
+* CVE-2018-8777: DoS by large request in WEBrick
+* CVE-2018-8778: Buffer under-read in String#unpack
+* CVE-2018-8779: Unintentional socket creation by poisoned NUL byte in UNIXServer and UNIXSocket
+* CVE-2018-8780: Unintentional directory traversal by poisoned NUL byte in Dir
+* Multiple vulnerabilities in RubyGems
Nokogiri has been updated to 1.8.2
-- [MRI] Behavior in libxml2 has been reverted which caused CVE-2018-8048 (loofah gem), CVE-2018-3740 (sanitize gem), and CVE-2018-3741 (rails-html-sanitizer gem).
+* [MRI] Behavior in libxml2 has been reverted which caused CVE-2018-8048 (loofah gem), CVE-2018-3740 (sanitize gem), and CVE-2018-3741 (rails-html-sanitizer gem).
OpenSSL has been updated to 1.0.2o
-- CVE-2018-0739: Constructed ASN.1 types with a recursive definition could exceed the stack.
+* CVE-2018-0739: Constructed ASN.1 types with a recursive definition could exceed the stack.
## Platform Updates
@@ -3734,10 +4122,10 @@ Enable Ubuntu-18.04 and Debian-9 tested chef-client packages.
# What's New in 13.9:
-- On Windows, the installer now correctly re-extracts files during repair mode
-- The mount resource will now not create duplicate entries when the device type differs
-- Ensure we don't request every remote file when running with lazy loading enabled
-- Don't crash when getting the access rights for Windows system accounts
+* On Windows, the installer now correctly re-extracts files during repair mode
+* The mount resource will now not create duplicate entries when the device type differs
+* Ensure we don't request every remote file when running with lazy loading enabled
+* Don't crash when getting the access rights for Windows system accounts
## Custom Resource Improvements
@@ -3805,10 +4193,10 @@ end
# Ohai Release Notes 13.9:
-- Fix uptime parsing on AIX
-- Fix Softlayer cloud detection
-- Use the current Azure metadata endpoint
-- Correctly detect macOS guests on VMware and VirtualBox
+* Fix uptime parsing on AIX
+* Fix Softlayer cloud detection
+* Use the current Azure metadata endpoint
+* Correctly detect macOS guests on VMware and VirtualBox
# What's New in 13.8:
@@ -3822,7 +4210,7 @@ Per <https://discourse.chef.io/t/regression-in-chef-client-13-7-16/12518/1> , th
## Security Updates
-- Updated libxml2 to 2.9.7; fixes: CVE-2017-15412
+* Updated libxml2 to 2.9.7; fixes: CVE-2017-15412
# What's New in 13.7:
@@ -3848,11 +4236,11 @@ The original name for the ignore_failure property in resources was epic_fail. Ou
In Chef 14 several legacy legacy mixins will be removed. Usage of these mixins has resulted in deprecation warnings for several years. They were traditionally used in some HWRPs, but are rarely found in code available on the Supermarket. Foodcritic rules FC097, FC098, FC099, FC100, and FC102 have been introduced to detect these mixins.
-- Chef::Mixin::LanguageIncludeAttribute
-- Chef::Mixin::RecipeDefinitionDSLCore
-- Chef::Mixin::LanguageIncludeRecipe
-- Chef::Mixin::Language
-- Chef::DSL::Recipe::FullDSL
+* Chef::Mixin::LanguageIncludeAttribute
+* Chef::Mixin::RecipeDefinitionDSLCore
+* Chef::Mixin::LanguageIncludeRecipe
+* Chef::Mixin::Language
+* Chef::DSL::Recipe::FullDSL
### :uninstall action in chocolatey_package
@@ -3860,14 +4248,14 @@ The chocolatey cookbook's chocolatey_package resource originally contained an :u
## Bugfixes
-- Resolved a bug where knife commands that prompted on Windows would never display the prompt
-- Fixed hiding of sensitive resources when converge_if_changed was used
-- Fixed scenarios where services would fail to start on Solaris
+* Resolved a bug where knife commands that prompted on Windows would never display the prompt
+* Fixed hiding of sensitive resources when converge_if_changed was used
+* Fixed scenarios where services would fail to start on Solaris
## Security Updates
-- OpenSSL has been upgraded to 1.0.2n to resolve CVE-2017-3738, CVE-2017-3737, CVE-2017-3736, and CVE-2017-3735.
-- Ruby has been upgraded to 2.4.3 to resolve CVE-2017-17405
+* OpenSSL has been upgraded to 1.0.2n to resolve CVE-2017-3738, CVE-2017-3737, CVE-2017-3736, and CVE-2017-3735.
+* Ruby has been upgraded to 2.4.3 to resolve CVE-2017-17405
## Ohai 13.7 Release Notes:
@@ -3891,12 +4279,12 @@ The mdadm plugin has been updated to properly handle arrays with more than 10 di
## Bugfixes
-- Resolved a regression in 13.6.0 that prevented upgrading packages on Debian/Ubuntu when the package name contained a tilde.
+* Resolved a regression in 13.6.0 that prevented upgrading packages on Debian/Ubuntu when the package name contained a tilde.
## Security Updates
-- OpenSSL has been upgraded to 1.0.2m to resolve CVE-2017-3735 and CVE-2017-3736
-- RubyGems has been upgraded to 2.6.14 to resolve CVE-2017-0903
+* OpenSSL has been upgraded to 1.0.2m to resolve CVE-2017-3735 and CVE-2017-3736
+* RubyGems has been upgraded to 2.6.14 to resolve CVE-2017-0903
# What's New in 13.6:
@@ -3972,19 +4360,19 @@ Debug logs will show the length of time each plugin takes to run, making debuggi
Chef Client 13.4 includes Ruby 2.4.2 to fix the following CVEs:
-- CVE-2017-0898
-- CVE-2017-10784
-- CVE-2017-14033
-- CVE-2017-14064
+* CVE-2017-0898
+* CVE-2017-10784
+* CVE-2017-14033
+* CVE-2017-14064
## Security release of RubyGems
Chef Client 13.4 includes RubyGems 2.6.13 to fix the following CVEs:
-- CVE-2017-0899
-- CVE-2017-0900
-- CVE-2017-0901
-- CVE-2017-0902
+* CVE-2017-0899
+* CVE-2017-0900
+* CVE-2017-0901
+* CVE-2017-0902
## Ifconfig provider on Red Hat now supports additional properties
@@ -3992,19 +4380,19 @@ It is now possible to set `ETHTOOL_OPTS`, `BONDING_OPTS`, `MASTER` and `SLAVE` p
### Properties
-- `ethtool_opts`<br>
+* `ethtool_opts`<br>
**Ruby types:** String<br>
**Platforms:** Fedora, RHEL, Amazon Linux A string containing arguments to ethtool. The string will be wrapped in double quotes, so ensure that any needed quotes in the property are surrounded by single quotes
-- `bonding_opts`<br>
+* `bonding_opts`<br>
**Ruby types:** String<br>
**Platforms:** Fedora, RHEL, Amazon Linux A string containing configuration parameters for the bonding device.
-- `master`<br>
+* `master`<br>
**Ruby types:** String<br>
**Platforms:** Fedora, RHEL, Amazon Linux The channel bonding interface that this interface is linked to.
-- `slave`<br>
+* `slave`<br>
**Ruby types:** String<br>
**Platforms:** Fedora, RHEL, Amazon Linux Whether the interface is controlled by the channel bonding interface defined by `master`, above.
@@ -4022,15 +4410,15 @@ The `remote_file` resource now supports the use of credentials on Windows when a
The following properties are new for the `remote_file` resource:
-- `remote_user`<br>
+* `remote_user`<br>
**Ruby types:** String<br>
_Windows only:_ The user name of a user with access to the remote file specified by the `source` property. Default value: `nil`. The user name may optionally be specified with a domain, i.e. `domain\user` or `user@my.dns.domain.com` via Universal Principal Name (UPN) format. It can also be specified without a domain simply as `user` if the domain is instead specified using the `remote_domain` attribute. Note that this property is ignored if `source` is not a UNC path. If this property is specified, the `remote_password` property **must** be specified.
-- `remote_password`<br>
+* `remote_password`<br>
**Ruby types** String<br>
_Windows only:_ The password of the user specified by the `remote_user` property. Default value: `nil`. This property is mandatory if `remote_user` is specified and may only be specified if `remote_user` is specified. The `sensitive` property for this resource will automatically be set to `true` if `remote_password` is specified.
-- `remote_domain`<br>
+* `remote_domain`<br>
**Ruby types** String<br>
_Windows only:_ The domain of the user user specified by the `remote_user` property. Default value: `nil`. If not specified, the user and password properties specified by the `remote_user` and `remote_password` properties will be used to authenticate that user against the domain in which the system hosting the UNC path specified via `source` is joined, or if that system is not joined to a domain it will authenticate the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the `remote_user` property.
@@ -4084,12 +4472,12 @@ end
### Actions
-- `:add` - Add an item to the system path
-- `:remove` - Remove an item from the system path
+* `:add` * Add an item to the system path
+* `:remove` * Remove an item from the system path
### Properties
-- `path` - Name attribute. The name of the value to add to the system path
+* `path` * Name attribute. The name of the value to add to the system path
### Examples
@@ -4180,7 +4568,7 @@ Sample data now available under azure:
### Package Plugin Supports Arch Linux
-The Package plugin has been updated to include package information on Arch Linux systems.
+The Packages plugin has been updated to include package information on Arch Linux systems.
# What's New in 13.3:
@@ -4216,15 +4604,15 @@ Further information regarding apt-pinning is available via <https://wiki.debian.
### Actions
-- `:add`: creates a preferences file under /etc/apt/preferences.d
-- `:remove`: Removes the file, therefore unpin the package
+* `:add`: creates a preferences file under /etc/apt/preferences.d
+* `:remove`: Removes the file, therefore unpin the package
### Properties
-- `package_name`: name attribute. The name of the package
-- `glob`: Pin by glob() expression or regexp surrounded by /.
-- `pin`: The package version/repository to pin
-- `pin_priority`: The pinning priority aka "the highest package version wins"
+* `package_name`: name attribute. The name of the package
+* `glob`: Pin by glob() expression or regexp surrounded by /.
+* `pin`: The package version/repository to pin
+* `pin_priority`: The pinning priority aka "the highest package version wins"
### Examples
@@ -4261,25 +4649,25 @@ The zypper_repository resource allows for the creation of Zypper package reposit
### Actions
-- `:add` - adds a repo
-- `:delete` - removes a repo
+* `:add` * adds a repo
+* `:delete` * removes a repo
### Properties
-- `repo_name` - repository name if different from the resource name (name property)
-- `type` - the repository type. default: 'NONE'
-- `description` - the description of the repo that will be shown in `zypper repos`
-- `baseurl` - the base url of the repo
-- `path` - the relative path from the `baseurl`
-- `mirrorlist` - the url to the mirrorlist to use
-- `gpgcheck` - should we gpg check the repo (true/false). default: true
-- `gpgkey` - location of repo key to import
-- `priority` - priority of the repo. default: 99
-- `autorefresh` - should the repository be automatically refreshed (true/false). default: true
-- `keeppackages` - should packages be saved (true/false). default: false
-- `refresh_cache` - should package cache be refreshed (true/false). default: true
-- `enabled` - should this repository be enabled (true/false). default: true
-- `mode` - the file mode of the repository file. default: "0644"
+* `repo_name` * repository name if different from the resource name (name property)
+* `type` * the repository type. default: 'NONE'
+* `description` * the description of the repo that will be shown in `zypper repos`
+* `baseurl` * the base url of the repo
+* `path` * the relative path from the `baseurl`
+* `mirrorlist` * the url to the mirrorlist to use
+* `gpgcheck` * should we gpg check the repo (true/false). default: true
+* `gpgkey` * location of repo key to import
+* `priority` * priority of the repo. default: 99
+* `autorefresh` * should the repository be automatically refreshed (true/false). default: true
+* `keeppackages` * should packages be saved (true/false). default: false
+* `refresh_cache` * should package cache be refreshed (true/false). default: true
+* `enabled` * should this repository be enabled (true/false). default: true
+* `mode` * the file mode of the repository file. default: "0644"
### Examples
@@ -4300,8 +4688,8 @@ end
Ohai now properly detects the [F5 Big-IP](https://www.f5.com/) platform and platform_version.
-- platform: bigip
-- platform_family: rhel
+* platform: bigip
+* platform_family: rhel
# What's New in 13.2:
@@ -4353,13 +4741,13 @@ Ohai now properly detects the [Clear](https://clearlinux.org/) and [ClearOS](htt
#### Clear Linux
-- platform: clearlinux
-- platform_family: clearlinux
+* platform: clearlinux
+* platform_family: clearlinux
#### ClearOS
-- platform: clearos
-- platform_family: rhel
+* platform: clearos
+* platform_family: rhel
## New Deprecations
@@ -4393,7 +4781,7 @@ The behavior of `gem_package` and `chef_gem` is now to always apply the `Chef::C
This should enable easier setup of rubygems mirrors particularly in "airgapped" environments through the use of the global config variable. It also means that an admin may force all rubygems.org traffic to an internal mirror, while still being able to consume external cookbooks which have resources which add other mirrors unchanged (in a non-airgapped environment).
-In the case where a resource must force the use of only the specified source(s), then the `include_default_source` property has been added -- setting it to false will remove the `Chef::Config[:rubygems_url]` setting from the list of sources for that resource.
+In the case where a resource must force the use of only the specified source(s), then the `include_default_source` property has been added -* setting it to false will remove the `Chef::Config[:rubygems_url]` setting from the list of sources for that resource.
The behavior of the `clear_sources` property is now to only add `--clear-sources` and has no magic side effects on the source options.
@@ -4411,7 +4799,7 @@ This can be used by any other resource by just overriding the name property and
property :name, String, default: ""
```
-Notifications to resources with empty strings as their name is also supported via either the bare resource name (`apt_update` -- matches what the user types in the DSL) or with empty brackets (`apt_update[]` -- matches the resource notification pattern).
+Notifications to resources with empty strings as their name is also supported via either the bare resource name (`apt_update` -* matches what the user types in the DSL) or with empty brackets (`apt_update[]` -* matches the resource notification pattern).
## The knife ssh command applies the same fuzzifier as knife search node
@@ -4667,16 +5055,16 @@ The PATH changes have also been tweaked so that the ruby bindir and gemdir PATHS
Some examples of changes:
-- `which ruby` in 12.x will return any system ruby and fall back to the embedded ruby if using omnibus
-- `which ruby` in 13.x will return any system ruby and will not find the embedded ruby if using omnibus
-- `shell_out_with_systems_locale("which ruby")` behaves the same as `which ruby` above
-- `shell_out("which ruby")` in 12.x will return any system ruby and fall back to the embedded ruby if using omnibus
-- `shell_out("which ruby")` in 13.x will always return the omnibus ruby first (but will find the system ruby if not using omnibus)
+* `which ruby` in 12.x will return any system ruby and fall back to the embedded ruby if using omnibus
+* `which ruby` in 13.x will return any system ruby and will not find the embedded ruby if using omnibus
+* `shell_out_with_systems_locale("which ruby")` behaves the same as `which ruby` above
+* `shell_out("which ruby")` in 12.x will return any system ruby and fall back to the embedded ruby if using omnibus
+* `shell_out("which ruby")` in 13.x will always return the omnibus ruby first (but will find the system ruby if not using omnibus)
The PATH in `shell_out` can also be overridden:
-- `shell_out("which ruby", env: { "PATH" => nil })` - behaves like shell_out_with_systems_locale()
-- `shell_out("which ruby", env: { "PATH" => [...include PATH string here...] })` - set it arbitrarily however you need
+* `shell_out("which ruby", env: { "PATH" => nil })` * behaves like shell_out_with_systems_locale()
+* `shell_out("which ruby", env: { "PATH" => [...include PATH string here...] })` * set it arbitrarily however you need
Since most providers which launch custom user commands use `shell_out_with_systems_locale` (service, execute, script, etc) the behavior will be that those commands that used to be having embedded omnibus paths injected into them no longer will. Generally this will fix more problems than it solves, but may causes issues for some use cases.
@@ -4772,9 +5160,9 @@ detail from the off.
## Highlighted enhancements for this release:
-- Systemd unit files are now verified before being installed.
-- Added support for windows alternate user identity in execute resources.
-- Added ed25519 key support for for ssh connections.
+* Systemd unit files are now verified before being installed.
+* Added support for windows alternate user identity in execute resources.
+* Added ed25519 key support for for ssh connections.
### Windows alternate user identity execute support
@@ -4796,15 +5184,15 @@ Chef::ReservedNames::Win32::Security.get_account_right('<user>').include?('SeAss
The following properties are new or updated for the `execute`, `script`, `batch`, and `powershell_script` resources and any resources derived from them:
-- `user`<br>
+* `user`<br>
**Ruby types:** String<br>
The user name of the user identity with which to launch the new process. Default value: `nil`. The user name may optionally be specified with a domain, i.e. `domain\user` or `user@my.dns.domain.com` via Universal Principal Name (UPN) format. It can also be specified without a domain simply as `user` if the domain is instead specified using the `domain` attribute. On Windows only, if this property is specified, the `password` property **must** be specified.
-- `password`<br>
+* `password`<br>
**Ruby types** String<br>
_Windows only:_ The password of the user specified by the `user` property. Default value: `nil`. This property is mandatory if `user` is specified on Windows and may only be specified if `user` is specified. The `sensitive` property for this resource will automatically be set to `true` if `password` is specified.
-- `domain`<br>
+* `domain`<br>
**Ruby types** String<br>
_Windows only:_ The domain of the user user specified by the `user` property. Default value: `nil`. If not specified, the user name and password specified by the `user` and `password` properties will be used to resolve that user against the domain in which the system running Chef client is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the `user` property.
@@ -4848,12 +5236,12 @@ end
## Highlighted bug fixes for this release:
-- Ensure that the Windows Administrator group can access the chef-solo nodes directory
-- When loading a cookbook in Chef Solo, use `metadata.json` in preference to `metadata.rb`
+* Ensure that the Windows Administrator group can access the chef-solo nodes directory
+* When loading a cookbook in Chef Solo, use `metadata.json` in preference to `metadata.rb`
## Deprecation Notice
-- As of version 12.19, chef client will no longer be build or tested on the Cisco NX-OS and IOS XR platforms.
+* As of version 12.19, chef client will no longer be build or tested on the Cisco NX-OS and IOS XR platforms.
# Ohai Release Notes 8.23:
@@ -4883,36 +5271,36 @@ GCC detection has been improved to collect additional information, and to not pr
### Ohai::Config removed
-- **Deprecation ID**: OHAI-1
-- **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_legacy_config>
-- **Expected Removal**: Ohai 13 (April 2017)
+* **Deprecation ID**: OHAI-1
+* **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_legacy_config>
+* **Expected Removal**: Ohai 13 (April 2017)
### sigar gem based plugins removed
-- **Deprecation ID**: OHAI-2
-- **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_sigar_plugins>
-- **Expected Removal**: Ohai 13 (April 2017)
+* **Deprecation ID**: OHAI-2
+* **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_sigar_plugins>
+* **Expected Removal**: Ohai 13 (April 2017)
### run_command and popen4 helper methods removed
-- **Deprecation ID**: OHAI-3
-- **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_run_command_helpers>
-- **Expected Removal**: Ohai 13 (April 2017)
+* **Deprecation ID**: OHAI-3
+* **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_run_command_helpers>
+* **Expected Removal**: Ohai 13 (April 2017)
### libvirt plugin attributes moved
-- **Deprecation ID**: OHAI-4
-- **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_libvirt_plugin>
-- **Expected Removal**: Ohai 13 (April 2017)
+* **Deprecation ID**: OHAI-4
+* **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_libvirt_plugin>
+* **Expected Removal**: Ohai 13 (April 2017)
### Windows CPU plugin attribute changes
-- **Deprecation ID**: OHAI-5
-- **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_windows_cpu>
-- **Expected Removal**: Ohai 13 (April 2017)
+* **Deprecation ID**: OHAI-5
+* **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_windows_cpu>
+* **Expected Removal**: Ohai 13 (April 2017)
### DigitalOcean plugin attribute changes
-- **Deprecation ID**: OHAI-6
-- **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_digitalocean/>
-- **Expected Removal**: Ohai 13 (April 2017)
+* **Deprecation ID**: OHAI-6
+* **Remediation Docs**: <https://docs.chef.io/deprecations_ohai_digitalocean/>
+* **Expected Removal**: Ohai 13 (April 2017)
diff --git a/Rakefile b/Rakefile
index 780e379ecd..09c8d5e131 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2008-2019, Chef Software Inc.
+# Copyright:: Copyright, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,10 +23,9 @@ $LOAD_PATH.unshift(File.expand_path("chef-config/lib", __dir__))
begin
require_relative "tasks/rspec"
require_relative "tasks/dependencies"
- require_relative "tasks/announce"
require_relative "tasks/docs"
require_relative "tasks/spellcheck"
- require_relative "lib/chef/dist"
+ require_relative "chef-utils/lib/chef-utils/dist" unless defined?(ChefUtils::Dist)
rescue LoadError => e
puts "Skipping missing rake dep: #{e}"
end
@@ -48,6 +47,7 @@ namespace :pre_install do
desc "Renders the powershell extensions with distro flavoring"
task :render_powershell_extension do
+ require "erb"
template_file = ::File.join(::File.dirname(__FILE__), "distro", "templates", "powershell", "chef", "chef.psm1.erb")
psm1_path = ::File.join(::File.dirname(__FILE__), "distro", "powershell", "chef")
FileUtils.mkdir_p psm1_path
@@ -88,6 +88,25 @@ task :register_eventlog do
end
end
+desc "Copies powershell_exec related binaries from the latest built Habitat Packages"
+task :update_chef_exec_dll do
+ raise "This task must be run on Windows since we are installing a Windows targeted package!" unless Gem.win_platform?
+
+ require "mkmf"
+ raise "Unable to locate Habitat cli. Please install Habitat cli before invoking this task!" unless find_executable "hab"
+
+ sh("hab pkg install chef/chef-powershell-shim")
+ sh("hab pkg install chef/chef-powershell-shim-x86")
+ x64 = `hab pkg path chef/chef-powershell-shim`.chomp.gsub(/\\/, "/")
+ x86 = `hab pkg path chef/chef-powershell-shim-x86`.chomp.gsub(/\\/, "/")
+ FileUtils.rm_rf(Dir["distro/ruby_bin_folder/AMD64/*"])
+ FileUtils.rm_rf(Dir["distro/ruby_bin_folder/x86/*"])
+ puts "Copying #{x64}/bin/* to distro/ruby_bin_folder/AMD64"
+ FileUtils.cp_r(Dir["#{x64}/bin/*"], "distro/ruby_bin_folder/AMD64")
+ puts "Copying #{x86}/bin/* to distro/ruby_bin_folder/x86"
+ FileUtils.cp_r(Dir["#{x86}/bin/*"], "distro/ruby_bin_folder/x86")
+end
+
begin
require "chefstyle"
require "rubocop/rake_task"
@@ -97,15 +116,3 @@ begin
rescue LoadError
puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed."
end
-
-begin
- require "yard"
- DOC_FILES = [ "spec/tiny_server.rb", "lib/**/*.rb" ].freeze
-
- YARD::Rake::YardocTask.new(:docs) do |t|
- t.files = DOC_FILES
- t.options = ["--format", "html"]
- end
-rescue LoadError
- puts "yard is not available. bundle install first to make sure all dependencies are installed."
-end
diff --git a/VERSION b/VERSION
index e0621c5341..7d31a2a0d2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-16.5.26 \ No newline at end of file
+17.0.0 \ No newline at end of file
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index f808fa6ff9..c87781b1e1 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -16,8 +16,6 @@ jobs:
- job:
strategy:
matrix:
- ubuntu_kitchen_tests:
- imageName: 'ubuntu-latest'
mac_kitchen_tests:
imageName: 'macos-latest'
@@ -42,7 +40,7 @@ jobs:
- script: |
cd kitchen-tests
- sudo /opt/chef/embedded/bin/bundle config set without 'omnibus_package docgen ruby_prof'
+ sudo /opt/chef/embedded/bin/bundle config set without 'omnibus_package ruby_prof'
sudo /opt/chef/embedded/bin/bundle install --jobs=3 --retry=3 --path=vendor/bundle
sudo /opt/chef/embedded/bin/gem install berkshelf --no-doc
sudo /opt/chef/embedded/bin/berks vendor cookbooks
@@ -79,9 +77,15 @@ jobs:
- powershell: |
cd kitchen-tests
$env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
- bundle config set without 'omnibus_package docgen ruby_prof'
+ bundle config set without 'omnibus_package ruby_prof'
bundle install --jobs=3 --retry=3 --path=vendor/bundle
gem install berkshelf --no-doc
+ # berks emits a ruby warning when it loads net/http due to a previously
+ # defined constant. Even though it is just a warning, powershell immediately
+ # exits 1. I'm not sure why but this just suppresses the warnings.
+ $env:RUBYOPT="-W0"
berks vendor cookbooks
+ # restore the default warning level
+ $env:RUBYOPT="-W1"
chef-client -z -o end_to_end --chef-license accept-no-persist
displayName: 'Run end_to_end::default recipe'
diff --git a/bin/knife b/bin/knife
index e93e47d1d4..85ac3b91e9 100755
--- a/bin/knife
+++ b/bin/knife
@@ -18,7 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
+$:.unshift(File.expand_path(File.join(__dir__, "..", "lib")))
require "chef/application/knife"
Chef::Application::Knife.new.run
diff --git a/chef-bin/.rspec b/chef-bin/.rspec
deleted file mode 100644
index eb3ef03653..0000000000
--- a/chef-bin/.rspec
+++ /dev/null
@@ -1,2 +0,0 @@
---color
--fd
diff --git a/chef-bin/Gemfile b/chef-bin/Gemfile
index 96ab544690..05b93d9230 100644
--- a/chef-bin/Gemfile
+++ b/chef-bin/Gemfile
@@ -2,3 +2,7 @@ source "https://rubygems.org"
# Specify your gem's dependencies in chef-config.gemspec
gemspec
+
+group(:development, :test) do
+ gem "rake"
+end \ No newline at end of file
diff --git a/chef-bin/Rakefile b/chef-bin/Rakefile
index 5e5c9bbf5f..7fe4f1e9d4 100644
--- a/chef-bin/Rakefile
+++ b/chef-bin/Rakefile
@@ -10,7 +10,7 @@ Bundler::GemHelper.install_tasks
desc "force install the chef-bin gem"
task "install:force" do
sh "gem build -V chef-bin.gemspec"
- built_gem_path = Dir["chef-bin-*.gem"].sort_by { |f| File.mtime(f) }.last
+ built_gem_path = Dir["chef-bin-*.gem"].max_by { |f| File.mtime(f) }
FileUtils.mkdir_p("pkg") unless Dir.exist?("pkg")
FileUtils.mv(built_gem_path, "pkg")
sh "gem install -f pkg/#{built_gem_path}"
diff --git a/chef-bin/bin/chef-apply b/chef-bin/bin/chef-apply
index 05b975a118..92c350b85b 100755
--- a/chef-bin/bin/chef-apply
+++ b/chef-bin/bin/chef-apply
@@ -18,7 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+$:.unshift(File.join(__dir__, "..", "lib"))
require "chef/application/apply"
Chef::Application::Apply.new.run(enforce_license: true)
diff --git a/chef-bin/bin/chef-client b/chef-bin/bin/chef-client
index 45a6af546a..69436d4182 100755
--- a/chef-bin/bin/chef-client
+++ b/chef-bin/bin/chef-client
@@ -18,7 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+$:.unshift(File.join(__dir__, "..", "lib"))
require "chef"
require "chef/application/client"
diff --git a/chef-bin/bin/chef-resource-inspector b/chef-bin/bin/chef-resource-inspector
index 6a7eac0c32..e5f4100441 100755
--- a/chef-bin/bin/chef-resource-inspector
+++ b/chef-bin/bin/chef-resource-inspector
@@ -19,8 +19,8 @@
Encoding.default_external = Encoding::UTF_8
-$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
+$:.unshift(File.expand_path(File.join(__dir__, "..", "lib")))
require "chef/resource_inspector"
-ResourceInspector.start
+Chef::ResourceInspector.start
diff --git a/chef-bin/bin/chef-service-manager b/chef-bin/bin/chef-service-manager
index 64cc043a54..dcaae80141 100755
--- a/chef-bin/bin/chef-service-manager
+++ b/chef-bin/bin/chef-service-manager
@@ -18,16 +18,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+$:.unshift(File.join(__dir__, "..", "lib"))
require "chef"
require "chef/application/windows_service_manager"
-require "chef/dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
if Chef::Platform.windows?
chef_client_service = {
- service_name: Chef::Dist::CLIENT,
- service_display_name: "#{Chef::Dist::PRODUCT} Service",
- service_description: "Runs #{Chef::Dist::PRODUCT} on regular, configurable intervals.",
+ service_name: ChefUtils::Dist::Infra::CLIENT,
+ service_display_name: "#{ChefUtils::Dist::Infra::PRODUCT} Service",
+ service_description: "Runs #{ChefUtils::Dist::Infra::PRODUCT} on regular, configurable intervals.",
service_file_path: File.expand_path("../chef-windows-service", $PROGRAM_NAME),
delayed_start: true,
dependencies: ["Winmgmt"],
diff --git a/chef-bin/bin/chef-shell b/chef-bin/bin/chef-shell
index 666ce1944c..48263dd7ea 100755
--- a/chef-bin/bin/chef-shell
+++ b/chef-bin/bin/chef-shell
@@ -24,7 +24,7 @@ require "irb"
require "irb/completion"
require "irb/ext/save-history"
-$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
+$:.unshift(File.expand_path(File.join(__dir__, "..", "lib")))
require "chef/shell"
diff --git a/chef-bin/bin/chef-solo b/chef-bin/bin/chef-solo
index 7a2168230d..379aa89485 100755
--- a/chef-bin/bin/chef-solo
+++ b/chef-bin/bin/chef-solo
@@ -18,7 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+$:.unshift(File.join(__dir__, "..", "lib"))
require "chef/application/solo"
Chef::Application::Solo.new.run(enforce_license: true)
diff --git a/chef-bin/bin/chef-windows-service b/chef-bin/bin/chef-windows-service
index 646e3b4a93..ce1a30baae 100755
--- a/chef-bin/bin/chef-windows-service
+++ b/chef-bin/bin/chef-windows-service
@@ -23,7 +23,7 @@
# generate will call that file, and will be registered as
# a windows service.
-$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+$:.unshift(File.join(__dir__, "..", "lib"))
require "chef"
require "chef/application/windows_service"
diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb
index 4d00d540fd..b6cfe496d8 100644
--- a/chef-bin/lib/chef-bin/version.rb
+++ b/chef-bin/lib/chef-bin/version.rb
@@ -21,7 +21,7 @@
module ChefBin
CHEFBIN_ROOT = File.expand_path("..", __dir__)
- VERSION = "16.5.26".freeze
+ VERSION = "17.0.0".freeze
end
#
diff --git a/chef-config/Gemfile b/chef-config/Gemfile
index c3d90e5e6c..4498154338 100644
--- a/chef-config/Gemfile
+++ b/chef-config/Gemfile
@@ -2,5 +2,9 @@ source "https://rubygems.org"
gem "chef-utils", path: File.expand_path("../chef-utils", __dir__) if File.exist?(File.expand_path("../chef-utils", __dir__))
-# Specify your gem's dependencies in chef-config.gemspec
gemspec
+
+group(:development, :test) do
+ gem "rake"
+ gem "rspec"
+end
diff --git a/chef-config/chef-config.gemspec b/chef-config/chef-config.gemspec
index 6b4312c13d..08086ff25b 100644
--- a/chef-config/chef-config.gemspec
+++ b/chef-config/chef-config.gemspec
@@ -8,10 +8,20 @@ Gem::Specification.new do |spec|
spec.authors = ["Adam Jacob"]
spec.email = ["adam@chef.io"]
- spec.summary = %q{Chef's default configuration and config loading}
+ spec.summary = %q{Chef Infra's default configuration and config loading library}
spec.homepage = "https://github.com/chef/chef"
spec.license = "Apache-2.0"
+ spec.required_ruby_version = ">= 2.6.0"
+
+ spec.metadata = {
+ "bug_tracker_uri" => "https://github.com/chef/chef/issues",
+ "changelog_uri" => "https://github.com/chef/chef/blob/master/CHANGELOG.md",
+ "documentation_uri" => "https://github.com/chef/chef/tree/master/chef-config/README.md",
+ "homepage_uri" => "https://github.com/chef/chef/tree/master/chef-config",
+ "source_code_uri" => "https://github.com/chef/chef/tree/master/chef-config",
+ }
+
spec.require_paths = ["lib"]
spec.add_dependency "chef-utils", "= #{ChefConfig::VERSION}"
@@ -21,12 +31,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "addressable"
spec.add_dependency "tomlrb", "~> 1.2"
- spec.add_development_dependency "rake"
-
- %w{rspec-core rspec-expectations rspec-mocks}.each do |rspec|
- spec.add_development_dependency(rspec, "~> 3.2")
- end
-
spec.files = %w{Rakefile LICENSE} + Dir.glob("*.gemspec") +
Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb
index a767d072ef..2f261b45a7 100644
--- a/chef-config/lib/chef-config/config.rb
+++ b/chef-config/lib/chef-config/config.rb
@@ -20,8 +20,8 @@
# limitations under the License.
require "mixlib/config" unless defined?(Mixlib::Config)
-require "pathname" unless defined?(Pathname)
-require "chef-utils" unless defined?(ChefUtils::CANARY)
+autoload :Pathname, "pathname"
+autoload :ChefUtils, "chef-utils"
require_relative "fips"
require_relative "logger"
@@ -29,12 +29,16 @@ require_relative "windows"
require_relative "path_helper"
require_relative "mixin/fuzzy_hostname_matcher"
-require "mixlib/shellout" unless defined?(Mixlib::ShellOut::DEFAULT_READ_TIMEOUT)
-require "uri" unless defined?(URI)
-require "addressable/uri" unless defined?(Addressable::URI)
-require "openssl" unless defined?(OpenSSL)
-require "yaml"
-require_relative "dist"
+module Mixlib
+ autoload :ShellOut, "mixlib/shellout"
+end
+autoload :URI, "uri"
+module Addressable
+ autoload :URI, "addressable/uri"
+end
+autoload :OpenSSL, "openssl"
+autoload :YAML, "yaml"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
module ChefConfig
@@ -80,7 +84,7 @@ module ChefConfig
# @return [String] the platform-specific path
#
def self.etc_chef_dir(windows: ChefUtils.windows?)
- path = windows ? c_chef_dir : PathHelper.join("/etc", ChefConfig::Dist::DIR_SUFFIX, windows: windows)
+ path = windows ? c_chef_dir : PathHelper.join("/etc", ChefUtils::Dist::Infra::DIR_SUFFIX, windows: windows)
PathHelper.cleanpath(path, windows: windows)
end
@@ -90,7 +94,7 @@ module ChefConfig
# @return [String] the platform-specific path
#
def self.var_chef_dir(windows: ChefUtils.windows?)
- path = windows ? c_chef_dir : PathHelper.join("/var", ChefConfig::Dist::DIR_SUFFIX, windows: windows)
+ path = windows ? c_chef_dir : PathHelper.join("/var", ChefUtils::Dist::Infra::DIR_SUFFIX, windows: windows)
PathHelper.cleanpath(path, windows: windows)
end
@@ -112,7 +116,7 @@ module ChefConfig
#
def self.c_chef_dir(windows: ChefUtils.windows?)
drive = windows_installation_drive || "C:"
- PathHelper.join(drive, ChefConfig::Dist::DIR_SUFFIX, windows: windows)
+ PathHelper.join(drive, ChefUtils::Dist::Infra::DIR_SUFFIX, windows: windows)
end
# On windows, C:/opscode
@@ -123,7 +127,7 @@ module ChefConfig
#
def self.c_opscode_dir(windows: ChefUtils.windows?)
drive = windows_installation_drive || "C:"
- PathHelper.join(drive, ChefConfig::Dist::LEGACY_CONF_DIR, ChefConfig::Dist::DIR_SUFFIX, windows: windows)
+ PathHelper.join(drive, ChefUtils::Dist::Org::LEGACY_CONF_DIR, ChefUtils::Dist::Infra::DIR_SUFFIX, windows: windows)
end
# the drive where Chef is installed on a windows host. This is determined
@@ -188,7 +192,7 @@ module ChefConfig
if config_file
PathHelper.dirname(PathHelper.canonical_path(config_file, false))
else
- PathHelper.join(PathHelper.cleanpath(user_home), ChefConfig::Dist::USER_CONF_DIR, "")
+ PathHelper.join(PathHelper.cleanpath(user_home), ChefUtils::Dist::Infra::USER_CONF_DIR, "")
end
end
@@ -267,7 +271,7 @@ module ChefConfig
end
path = new_path
end
- ChefConfig.logger.info("Auto-discovered #{ChefConfig::Dist::SHORT} repository at #{path}")
+ ChefConfig.logger.info("Auto-discovered #{ChefUtils::Dist::Infra::SHORT} repository at #{path}")
path
end
@@ -365,7 +369,7 @@ module ChefConfig
# Otherwise, we'll create .chef under the user's home directory and use that as
# the cache path.
unless path_accessible?(primary_cache_path) || path_accessible?(primary_cache_root)
- secondary_cache_path = PathHelper.join(user_home, ChefConfig::Dist::USER_CONF_DIR)
+ secondary_cache_path = PathHelper.join(user_home, ChefUtils::Dist::Infra::USER_CONF_DIR)
secondary_cache_path = target_mode? ? PathHelper.join(secondary_cache_path, target_mode.host) : secondary_cache_path
ChefConfig.logger.trace("Unable to access cache at #{primary_cache_path}. Switching cache to #{secondary_cache_path}")
secondary_cache_path
@@ -396,7 +400,7 @@ module ChefConfig
# If your `file_cache_path` resides on a NFS (or non-flock()-supporting
# fs), it's recommended to set this to something like
# '/tmp/chef-client-running.pid'
- default(:lockfile) { PathHelper.join(file_cache_path, "#{ChefConfig::Dist::CLIENT}-running.pid") }
+ default(:lockfile) { PathHelper.join(file_cache_path, "#{ChefUtils::Dist::Infra::CLIENT}-running.pid") }
## Daemonization Settings ##
# What user should Chef run as?
@@ -645,7 +649,7 @@ module ChefConfig
# credentials toml files which doesn't allow ruby symbol values
configurable(:ssl_verify_mode).writes_value do |value|
if value.is_a?(String) && value[0] == ":"
- value[1..-1].to_sym
+ value[1..].to_sym
else
value.to_sym
end
@@ -793,7 +797,7 @@ module ChefConfig
if chef_server_url.to_s =~ %r{/organizations/(.*)$}
"#{$1}-validator"
else
- "#{ChefConfig::Dist::SHORT}-validator"
+ "#{ChefUtils::Dist::Infra::SHORT}-validator"
end
end
@@ -867,7 +871,7 @@ module ChefConfig
default :profile, nil
default :chef_guid_path do
- PathHelper.join(config_dir, "#{ChefConfig::Dist::SHORT}_guid")
+ PathHelper.join(config_dir, "#{ChefUtils::Dist::Infra::SHORT}_guid")
end
default :chef_guid, nil
@@ -1076,7 +1080,7 @@ module ChefConfig
# generated by the DataCollector when Chef is run in Solo mode. This
# allows users to associate their Solo nodes with faux organizations
# without the nodes being connected to an actual Chef Server.
- default :organization, "#{ChefConfig::Dist::SHORT}_solo"
+ default :organization, "#{ChefUtils::Dist::Infra::SHORT}_solo"
end
configurable(:http_proxy)
@@ -1102,13 +1106,6 @@ module ChefConfig
export_no_proxy(no_proxy) if key?(:no_proxy) && no_proxy
end
- # Character classes for Addressable
- # See https://www.ietf.org/rfc/rfc3986.txt 3.2.1
- # The user part may not have a : in it
- USER = Addressable::URI::CharacterClasses::UNRESERVED + Addressable::URI::CharacterClasses::SUB_DELIMS
- # The password part may have any valid USERINFO characters
- PASSWORD = USER + "\\:"
-
# Builds a proxy uri and exports it to the appropriate environment variables. Examples:
# http://username:password@hostname:port
# https://username@hostname:port
@@ -1120,15 +1117,22 @@ module ChefConfig
# pass = password
# @api private
def self.export_proxy(scheme, path, user, pass)
+ # Character classes for Addressable
+ # See https://www.ietf.org/rfc/rfc3986.txt 3.2.1
+ # The user part may not have a : in it
+ user_class = Addressable::URI::CharacterClasses::UNRESERVED + Addressable::URI::CharacterClasses::SUB_DELIMS
+ # The password part may have any valid USERINFO characters
+ password_class = user_class + "\\:"
+
path = "#{scheme}://#{path}" unless path.include?("://")
# URI.split returns the following parts:
# [scheme, userinfo, host, port, registry, path, opaque, query, fragment]
uri = Addressable::URI.encode(path, Addressable::URI)
if user && !user.empty?
- userinfo = Addressable::URI.encode_component(user, USER)
+ userinfo = Addressable::URI.encode_component(user, user_class)
if pass
- userinfo << ":#{Addressable::URI.encode_component(pass, PASSWORD)}"
+ userinfo << ":#{Addressable::URI.encode_component(pass, password_class)}"
end
uri.userinfo = userinfo
end
@@ -1203,7 +1207,7 @@ module ChefConfig
# Transform into the form en_ZZ.UTF-8
guessed_locale.gsub(/UTF-?8$/i, "UTF-8")
else
- ChefConfig.logger.warn "Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support."
+ ChefConfig.logger.warn "Please install an English UTF-8 locale for #{ChefUtils::Dist::Infra::PRODUCT} to use, falling back to C locale and disabling UTF-8 support."
"C"
end
end
@@ -1256,9 +1260,9 @@ module ChefConfig
# @api private
def self.enable_fips_mode
OpenSSL.fips_mode = true
- require "digest"
- require "digest/sha1"
- require "digest/md5"
+ require "digest" unless defined?(Digest)
+ require "digest/sha1" unless defined?(Digest::SHA1)
+ require "digest/md5" unless defined?(Digest::MD5)
# Remove pre-existing constants if they do exist to reduce the
# amount of log spam and warnings.
Digest.send(:remove_const, "SHA1") if Digest.const_defined?("SHA1")
diff --git a/chef-config/lib/chef-config/dist.rb b/chef-config/lib/chef-config/dist.rb
deleted file mode 100644
index 67d1063163..0000000000
--- a/chef-config/lib/chef-config/dist.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module ChefConfig
- class Dist
- # The chef executable name.
- EXEC = "chef".freeze
-
- # The client's alias (chef-client)
- CLIENT = "chef-client".freeze
-
- # A short name for the product
- SHORT = "chef".freeze
-
- # The suffix for Chef's /etc/chef, /var/chef and C:\\Chef directories
- # "cinc" => /etc/cinc, /var/cinc, C:\\cinc
- DIR_SUFFIX = "chef".freeze
-
- # The user's configuration directory
- USER_CONF_DIR = ".chef".freeze
-
- # The legacy conf folder: C:/opscode/chef. Specifically the "opscode" part
- # DIR_SUFFIX is appended to it in code where relevant
- LEGACY_CONF_DIR = "opscode".freeze
-
- # Enable forcing Chef EULA
- ENFORCE_LICENSE = true
-
- # The servers's alias (chef-server)
- SERVER = "chef-server".freeze
-
- # The server's configuration utility
- SERVER_CTL = "chef-server-ctl".freeze
-
- end
-end
diff --git a/chef-config/lib/chef-config/mixin/credentials.rb b/chef-config/lib/chef-config/mixin/credentials.rb
index 12fceef75d..a17d94b443 100644
--- a/chef-config/lib/chef-config/mixin/credentials.rb
+++ b/chef-config/lib/chef-config/mixin/credentials.rb
@@ -15,8 +15,9 @@
# limitations under the License.
#
-require "tomlrb"
+autoload :Tomlrb, "tomlrb"
require_relative "../path_helper"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
module ChefConfig
module Mixin
@@ -36,7 +37,7 @@ module ChefConfig
# normally set via a command-line option.
# @return [String]
def credentials_profile(profile = nil)
- context_file = PathHelper.home(ChefConfig::Dist::USER_CONF_DIR, "context").freeze
+ context_file = PathHelper.home(ChefUtils::Dist::Infra::USER_CONF_DIR, "context").freeze
if !profile.nil?
profile
elsif ENV.include?("CHEF_PROFILE")
@@ -53,7 +54,7 @@ module ChefConfig
# @since 14.4
# @return [String]
def credentials_file_path
- PathHelper.home(ChefConfig::Dist::USER_CONF_DIR, "credentials").freeze
+ PathHelper.home(ChefUtils::Dist::Infra::USER_CONF_DIR, "credentials").freeze
end
# Load and parse the credentials file.
@@ -84,17 +85,17 @@ module ChefConfig
# @return [void]
def load_credentials(profile = nil)
profile = credentials_profile(profile)
- config = parse_credentials_file
- return if config.nil? # No credentials, nothing to do here.
+ cred_config = parse_credentials_file
+ return if cred_config.nil? # No credentials, nothing to do here.
- if config[profile].nil?
+ if cred_config[profile].nil?
# Unknown profile name. For "default" just silently ignore, otherwise
# raise an error.
return if profile == "default"
raise ChefConfig::ConfigurationError, "Profile #{profile} doesn't exist. Please add it to #{credentials_file_path}."
end
- apply_credentials(config[profile], profile)
+ apply_credentials(cred_config[profile], profile)
end
end
end
diff --git a/chef-config/lib/chef-config/mixin/dot_d.rb b/chef-config/lib/chef-config/mixin/dot_d.rb
index a4347474fe..efe5c957f1 100644
--- a/chef-config/lib/chef-config/mixin/dot_d.rb
+++ b/chef-config/lib/chef-config/mixin/dot_d.rb
@@ -20,6 +20,7 @@ module ChefConfig
module Mixin
module DotD
# Find available configuration files in a `.d/` style include directory.
+ # Make sure we exclude anything that's not a file so we avoid directories ending in .rb (just in case)
#
# @api internal
# @param path [String] Base .d/ path to load from.
diff --git a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
index ab51966077..533db85860 100644
--- a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
+++ b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
@@ -20,8 +20,16 @@ module ChefConfig
module Mixin
module FuzzyHostnameMatcher
+ #
+ # Check to see if a hostname matches a match string. Used to see if hosts fall under our no_proxy config
+ #
+ # @param [String] hostname the hostname to check
+ # @param [String] matches the pattern to match
+ #
+ # @return [Boolean]
+ #
def fuzzy_hostname_match_any?(hostname, matches)
- if (!hostname.nil?) && (!matches.nil?)
+ if hostname && matches
return matches.to_s.split(/\s*,\s*/).compact.any? do |m|
fuzzy_hostname_match?(hostname, m)
end
diff --git a/chef-config/lib/chef-config/mixin/train_transport.rb b/chef-config/lib/chef-config/mixin/train_transport.rb
new file mode 100644
index 0000000000..942f0ab3b7
--- /dev/null
+++ b/chef-config/lib/chef-config/mixin/train_transport.rb
@@ -0,0 +1,141 @@
+# Author:: Bryan McLellan <btm@loftninjas.org>
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "credentials"
+autoload :Train, "train"
+require_relative "../config"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
+
+module ChefConfig
+ module Mixin
+ module TrainTransport
+ include ChefConfig::Mixin::Credentials
+
+ attr_accessor :logger
+
+ def initialize(logger)
+ @logger = logger
+ end
+
+ #
+ # Returns a RFC099 credentials profile as a hash
+ #
+ def load_credentials(profile)
+ # Tomlrb.load_file returns a hash with keys as strings
+ credentials = parse_credentials_file
+ if contains_split_fqdn?(credentials, profile)
+ logger.warn("Credentials file #{credentials_file_path} contains target '#{profile}' as a Hash, expected a string.")
+ logger.warn("Hostnames must be surrounded by single quotes, e.g. ['host.example.org']")
+ end
+
+ # host names must be specified in credentials file as ['foo.example.org'] with quotes
+ if !credentials.nil? && !credentials[profile].nil?
+ credentials[profile].transform_keys(&:to_sym) # return symbolized keys to match Train.options()
+ else
+ nil
+ end
+ end
+
+ # Toml creates hashes when a key is separated by periods, e.g.
+ # [host.example.org] => { host: { example: { org: {} } } }
+ #
+ # Returns true if the above example is true
+ #
+ # A hostname has to be specified as ['host.example.org']
+ # This will be a common mistake so we should catch it
+ #
+ def contains_split_fqdn?(hash, fqdn)
+ fqdn.split(".").reduce(hash) do |h, k|
+ v = h[k]
+ if Hash === v
+ v
+ else
+ break false
+ end
+ end
+ end
+
+ # ChefConfig::Mixin::Credentials.credentials_file_path is designed around knife,
+ # overriding it here.
+ #
+ # Credentials file preference:
+ #
+ # 1) target_mode.credentials_file
+ # 2) /etc/chef/TARGET_MODE_HOST/credentials
+ # 3) #credentials_file_path from parent ($HOME/.chef/credentials)
+ #
+ def credentials_file_path
+ tm_config = config.target_mode
+ profile = tm_config.host
+
+ credentials_file =
+ if tm_config.credentials_file && File.exist?(tm_config.credentials_file)
+ tm_config.credentials_file
+ elsif File.exist?(config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/#{profile}/credentials"))
+ config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/#{profile}/credentials")
+ else
+ super
+ end
+
+ raise ArgumentError, "No credentials file found for target '#{profile}'" unless credentials_file
+ raise ArgumentError, "Credentials file specified for target mode does not exist: '#{credentials_file}'" unless File.exist?(credentials_file)
+
+ logger.debug("Loading credentials file '#{credentials_file}' for target '#{profile}'")
+
+ credentials_file
+ end
+
+ def build_transport
+ return nil unless config.target_mode?
+
+ # TODO: Consider supporting parsing the protocol from a URI passed to `--target`
+ #
+ train_config = {}
+
+ # Load the target_mode config context from config, and place any valid settings into the train configuration
+ tm_config = config.target_mode
+ protocol = tm_config.protocol
+ train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
+ logger.trace("Using target mode options from #{ChefUtils::Dist::Infra::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
+
+ # Load the credentials file, and place any valid settings into the train configuration
+ credentials = load_credentials(tm_config.host)
+ if credentials
+ valid_settings = credentials.select { |k| Train.options(protocol).key?(k) }
+ valid_settings[:enable_password] = credentials[:enable_password] if credentials.key?(:enable_password)
+ train_config.merge!(valid_settings)
+ logger.trace("Using target mode options from credentials file: #{valid_settings.keys.join(", ")}") if valid_settings
+ end
+
+ train_config[:logger] = logger
+
+ # Train handles connection retries for us
+ Train.create(protocol, train_config)
+ rescue SocketError => e # likely a dns failure, not caught by train
+ e.message.replace "Error connecting to #{train_config[:target]} - #{e.message}"
+ raise e
+ rescue Train::PluginLoadError
+ logger.error("Invalid target mode protocol: #{protocol}")
+ exit(1)
+ end
+
+ def config
+ raise NotImplementedError
+ end
+ end
+ end
+end
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index 86d00e7201..14415e333d 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -15,5 +15,5 @@
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("..", __dir__)
- VERSION = "16.5.26".freeze
+ VERSION = "17.0.0".freeze
end
diff --git a/chef-config/lib/chef-config/workstation_config_loader.rb b/chef-config/lib/chef-config/workstation_config_loader.rb
index 4e44a24fd7..ea42211120 100644
--- a/chef-config/lib/chef-config/workstation_config_loader.rb
+++ b/chef-config/lib/chef-config/workstation_config_loader.rb
@@ -59,7 +59,7 @@ module ChefConfig
@chef_config_dir = false
full_path = working_directory.split(File::SEPARATOR)
(full_path.length - 1).downto(0) do |i|
- candidate_directory = File.join(full_path[0..i] + [ChefConfig::Dist::USER_CONF_DIR])
+ candidate_directory = File.join(full_path[0..i] + [ChefUtils::Dist::Infra::USER_CONF_DIR])
if File.exist?(candidate_directory) && File.directory?(candidate_directory)
@chef_config_dir = candidate_directory
break
@@ -129,7 +129,7 @@ module ChefConfig
candidate_configs << File.join(chef_config_dir, "knife.rb")
end
# Look for $HOME/.chef/knife.rb
- PathHelper.home(ChefConfig::Dist::USER_CONF_DIR) do |dot_chef_dir|
+ PathHelper.home(ChefUtils::Dist::Infra::USER_CONF_DIR) do |dot_chef_dir|
candidate_configs << File.join(dot_chef_dir, "config.rb")
candidate_configs << File.join(dot_chef_dir, "knife.rb")
end
@@ -166,7 +166,7 @@ module ChefConfig
when "client_key"
extract_key(value, :client_key, :client_key_contents)
when "knife"
- Config.knife.merge!(Hash[value.map { |k, v| [k.to_sym, v] }])
+ Config.knife.merge!(value.transform_keys(&:to_sym))
else
Config[key.to_sym] = value
end
@@ -184,7 +184,7 @@ module ChefConfig
end
def home_chef_dir
- @home_chef_dir ||= PathHelper.home(ChefConfig::Dist::USER_CONF_DIR)
+ @home_chef_dir ||= PathHelper.home(ChefUtils::Dist::Infra::USER_CONF_DIR)
end
def apply_config(config_content, config_file_path)
@@ -195,8 +195,8 @@ module ChefConfig
message = ""
message << "You have invalid ruby syntax in your config file #{config_file_path}\n\n"
message << "#{e.class.name}: #{e.message}\n"
- if file_line = e.message[/#{Regexp.escape(config_file_path)}:[\d]+/]
- line = file_line[/:([\d]+)$/, 1].to_i
+ if file_line = e.message[/#{Regexp.escape(config_file_path)}:\d+/]
+ line = file_line[/:(\d+)$/, 1].to_i
message << highlight_config_error(config_file_path, line)
end
raise ChefConfig::ConfigurationError, message
@@ -206,7 +206,7 @@ module ChefConfig
filtered_trace = e.backtrace.grep(/#{Regexp.escape(config_file_path)}/)
filtered_trace.each { |bt_line| message << " " << bt_line << "\n" }
unless filtered_trace.empty?
- line_nr = filtered_trace.first[/#{Regexp.escape(config_file_path)}:([\d]+)/, 1]
+ line_nr = filtered_trace.first[/#{Regexp.escape(config_file_path)}:(\d+)/, 1]
message << highlight_config_error(config_file_path, line_nr.to_i)
end
raise ChefConfig::ConfigurationError, message
diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb
index 8daee3fa19..3d7365927d 100644
--- a/chef-config/spec/unit/config_spec.rb
+++ b/chef-config/spec/unit/config_spec.rb
@@ -170,7 +170,7 @@ RSpec.describe ChefConfig::Config do
apply_config
expect(described_class[:data_bag_path]).to eq("#{current_directory}/data_bags")
expect(described_class[:cookbook_path]).to eq("#{current_directory}/cookbooks")
- expect(described_class[:chef_repo_path]).to eq("#{current_directory}")
+ expect(described_class[:chef_repo_path]).to eq(current_directory)
end
end
@@ -225,7 +225,7 @@ RSpec.describe ChefConfig::Config do
end
describe "#var_chef_path" do
- let (:dirname) { ChefConfig::Dist::DIR_SUFFIX }
+ let (:dirname) { ChefUtils::Dist::Infra::DIR_SUFFIX }
context "on unix", :unix_only do
it "var_chef_dir is /var/chef" do
@@ -931,7 +931,7 @@ RSpec.describe ChefConfig::Config do
shared_examples_for "a suitable locale" do
it "returns an English UTF-8 locale" do
- expect(ChefConfig.logger).to_not receive(:warn).with(/Please install an English UTF-8 locale for Chef to use/)
+ expect(ChefConfig.logger).to_not receive(:warn).with(/Please install an English UTF-8 locale for Chef Infra Client to use/)
expect(ChefConfig.logger).to_not receive(:trace).with(/Defaulting to locale en_US.UTF-8 on Windows/)
expect(ChefConfig.logger).to_not receive(:trace).with(/No usable locale -a command found/)
expect(ChefConfig::Config.guess_internal_locale).to eq expected_locale
@@ -984,7 +984,7 @@ RSpec.describe ChefConfig::Config do
let(:locale_array) { ["af_ZA", "af_ZA.ISO8859-1", "af_ZA.ISO8859-15", "af_ZA.UTF-8"] }
it "should fall back to C locale" do
- expect(ChefConfig.logger).to receive(:warn).with("Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.")
+ expect(ChefConfig.logger).to receive(:warn).with("Please install an English UTF-8 locale for Chef Infra Client to use, falling back to C locale and disabling UTF-8 support.")
expect(ChefConfig::Config.guess_internal_locale).to eq "C"
end
end
diff --git a/chef-config/spec/unit/fips_spec.rb b/chef-config/spec/unit/fips_spec.rb
index 5ee62b6c79..4be6f64a2d 100644
--- a/chef-config/spec/unit/fips_spec.rb
+++ b/chef-config/spec/unit/fips_spec.rb
@@ -20,7 +20,7 @@ require "chef-config/fips"
require "spec_helper"
begin
- require "win32/registry"
+ require "win32/registry" unless defined?(Win32::Registry)
rescue LoadError
# not on unix
end
diff --git a/chef-config/spec/unit/workstation_config_loader_spec.rb b/chef-config/spec/unit/workstation_config_loader_spec.rb
index c589b298ae..70b42ad961 100644
--- a/chef-config/spec/unit/workstation_config_loader_spec.rb
+++ b/chef-config/spec/unit/workstation_config_loader_spec.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "tempfile"
+require "tempfile" unless defined?(Tempfile)
require "chef-config/exceptions"
require "chef-utils"
diff --git a/chef-universal-mingw32.gemspec b/chef-universal-mingw32.gemspec
index 6c64621cc0..fa95de76f5 100644
--- a/chef-universal-mingw32.gemspec
+++ b/chef-universal-mingw32.gemspec
@@ -9,7 +9,7 @@ gemspec.add_dependency "win32-event", "~> 0.6.1"
gemspec.add_dependency "win32-eventlog", "0.6.3"
gemspec.add_dependency "win32-mmap", "~> 0.4.1"
gemspec.add_dependency "win32-mutex", "~> 0.4.2"
-gemspec.add_dependency "win32-process", "~> 0.8.2"
+gemspec.add_dependency "win32-process", "~> 0.9"
gemspec.add_dependency "win32-service", ">= 2.1.5", "< 3.0"
gemspec.add_dependency "wmi-lite", "~> 1.0"
gemspec.add_dependency "win32-taskscheduler", "~> 2.0"
diff --git a/chef-utils/Gemfile b/chef-utils/Gemfile
index 65cb76c2b5..2555cf15d9 100644
--- a/chef-utils/Gemfile
+++ b/chef-utils/Gemfile
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
source "https://rubygems.org"
gemspec
@@ -6,4 +7,4 @@ group(:development, :test) do
gem "fauxhai-ng"
gem "rake"
gem "rspec"
-end
+end \ No newline at end of file
diff --git a/chef-utils/README.md b/chef-utils/README.md
index 6bfd97a1c4..d3088a7bc2 100644
--- a/chef-utils/README.md
+++ b/chef-utils/README.md
@@ -43,7 +43,7 @@ Super Families:
* `fedora_based?` - anything of fedora lineage (fedora, redhat, centos, amazon, pidora, etc)
* `rpm_based?`- all `fedora_based` systems plus `suse` and any future linux distros based on RPM (excluding AIX)
-* `solaris_based?`- all solaris-derived systems (opensolaris, nexentacore, omnios, smartos, etc)
+* `solaris_based?`- all solaris-derived systems (omnios, smartos, openindiana, etc)
* `bsd_based?`- all bsd-derived systems (freebsd, netbsd, openbsd, dragonflybsd).
### Platform Helpers
@@ -64,11 +64,9 @@ The Platform helpers provide an alternative to comparing values from `node['plat
* `linuxmint_platform?`
* `macos_platform?`
* `netbsd_platform?`
-* `nexentacore_platform?`
* `omnios_platform?`
* `openbsd_platform?`
* `openindiana_platform?`
-* `opensolaris_platform?`
* `opensuse_platform?`
* `oracle_platform?`
* `raspbian_platform?`
@@ -86,10 +84,8 @@ For compatibility with old chef-sugar code the following aliases work for backwa
* `centos?`
* `clearos?`
* `linuxmint?`
-* `nexentacore?`
* `omnios?`
* `openindiana?`
-* `opensolaris?`
* `opensuse?`
* `oracle?`
* `raspbian?`
diff --git a/chef-utils/Rakefile b/chef-utils/Rakefile
index 4bb4605e0c..237f47f72b 100644
--- a/chef-utils/Rakefile
+++ b/chef-utils/Rakefile
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require "bundler/gem_tasks"
task default: :spec
diff --git a/chef-utils/chef-utils.gemspec b/chef-utils/chef-utils.gemspec
index 0fd6ad668d..836fef1ff9 100644
--- a/chef-utils/chef-utils.gemspec
+++ b/chef-utils/chef-utils.gemspec
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "chef-utils/version"
@@ -8,13 +9,15 @@ Gem::Specification.new do |spec|
spec.authors = ["Chef Software, Inc"]
spec.email = ["oss@chef.io"]
- spec.summary = %q{Basic utility functions for Core Chef development}
+ spec.summary = %q{Basic utility functions for Core Chef Infra development}
spec.homepage = "https://github.com/chef/chef/tree/master/chef-utils"
spec.license = "Apache-2.0"
+ spec.required_ruby_version = ">= 2.6.0"
+
spec.metadata = {
"bug_tracker_uri" => "https://github.com/chef/chef/issues",
- "changelog_uri" => "https://github.com/chef/chef/CHANGELOG.md",
+ "changelog_uri" => "https://github.com/chef/chef/blob/master/CHANGELOG.md",
"documentation_uri" => "https://github.com/chef/chef/tree/master/chef-utils/README.md",
"homepage_uri" => "https://github.com/chef/chef/tree/master/chef-utils",
"source_code_uri" => "https://github.com/chef/chef/tree/master/chef-utils",
@@ -40,7 +43,4 @@ Gem::Specification.new do |spec|
spec.files = %w{Rakefile LICENSE} + Dir.glob("*.gemspec") +
Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
-
- spec.bindir = "bin"
- spec.executables = []
end
diff --git a/chef-utils/lib/chef-utils.rb b/chef-utils/lib/chef-utils.rb
index c1b06ed3fb..57a1e4017c 100644
--- a/chef-utils/lib/chef-utils.rb
+++ b/chef-utils/lib/chef-utils.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dist.rb b/chef-utils/lib/chef-utils/dist.rb
new file mode 100644
index 0000000000..c4fe72960d
--- /dev/null
+++ b/chef-utils/lib/chef-utils/dist.rb
@@ -0,0 +1,98 @@
+# frozen_string_literal: true
+module ChefUtils
+ # This class is not fully implemented, depending on it is not recommended!
+ module Dist
+ class Apply
+ # The chef-apply product name
+ PRODUCT = "Chef Infra Apply"
+
+ # The chef-apply binary
+ EXEC = "chef-apply"
+ end
+
+ class Automate
+ # name of the automate product
+ PRODUCT = "Chef Automate"
+ end
+
+ class Infra
+ # When referencing a product directly, like Chef (Now Chef Infra)
+ PRODUCT = "Chef Infra Client"
+
+ # A short designation for the product, used in Windows event logs
+ # and some nomenclature.
+ SHORT = "chef"
+
+ # The client's alias (chef-client)
+ CLIENT = "chef-client"
+
+ # The chef executable, as in `chef gem install` or `chef generate cookbook`
+ EXEC = "chef"
+
+ # The chef-shell executable
+ SHELL = "chef-shell"
+
+ # Configuration related constants
+ # The chef-shell configuration file
+ SHELL_CONF = "chef_shell.rb"
+
+ # The user's configuration directory
+ USER_CONF_DIR = ".chef"
+
+ # The suffix for Chef's /etc/chef, /var/chef and C:\\Chef directories
+ # "chef" => /etc/cinc, /var/cinc, C:\\cinc
+ DIR_SUFFIX = "chef"
+ end
+
+ class Org
+ # product Website address
+ WEBSITE = "https://chef.io"
+
+ # The downloads site
+ DOWNLOADS_URL = "downloads.chef.io"
+
+ # The legacy conf folder: C:/opscode/chef. Specifically the "opscode" part
+ # DIR_SUFFIX is appended to it in code where relevant
+ LEGACY_CONF_DIR = "opscode"
+
+ # Enable forcing Chef EULA
+ ENFORCE_LICENSE = true
+
+ # product patents page
+ PATENTS = "https://www.chef.io/patents"
+
+ # knife documentation page
+ KNIFE_DOCS = "https://docs.chef.io/workstation/knife/"
+ end
+
+ class Server
+ # The name of the server product
+ PRODUCT = "Chef Infra Server"
+
+ # The server's configuration directory
+ CONF_DIR = "/etc/chef-server"
+
+ # The servers's alias (chef-server)
+ SERVER = "chef-server"
+
+ # The server's configuration utility
+ SERVER_CTL = "chef-server-ctl"
+ end
+
+ class Solo
+ # Chef-Solo's product name
+ PRODUCT = "Chef Infra Solo"
+
+ # The chef-solo executable (legacy local mode)
+ EXEC = "chef-solo"
+ end
+
+ class Zero
+ # chef-zero executable
+ PRODUCT = "Chef Infra Zero"
+
+ # The chef-zero executable (local mode)
+ EXEC = "chef-zero"
+ end
+ end
+end
diff --git a/chef-utils/lib/chef-utils/dsl/architecture.rb b/chef-utils/lib/chef-utils/dsl/architecture.rb
index 1d1cd643b7..e1ac4a099a 100644
--- a/chef-utils/lib/chef-utils/dsl/architecture.rb
+++ b/chef-utils/lib/chef-utils/dsl/architecture.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/cloud.rb b/chef-utils/lib/chef-utils/dsl/cloud.rb
index 6d9a8b7136..9d4de55656 100644
--- a/chef-utils/lib/chef-utils/dsl/cloud.rb
+++ b/chef-utils/lib/chef-utils/dsl/cloud.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/default_paths.rb b/chef-utils/lib/chef-utils/dsl/default_paths.rb
index f18bd93157..b2eb359273 100644
--- a/chef-utils/lib/chef-utils/dsl/default_paths.rb
+++ b/chef-utils/lib/chef-utils/dsl/default_paths.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/introspection.rb b/chef-utils/lib/chef-utils/dsl/introspection.rb
index 35a0be73bd..4edfb8d139 100644
--- a/chef-utils/lib/chef-utils/dsl/introspection.rb
+++ b/chef-utils/lib/chef-utils/dsl/introspection.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/os.rb b/chef-utils/lib/chef-utils/dsl/os.rb
index b7d2137180..da6850a77a 100644
--- a/chef-utils/lib/chef-utils/dsl/os.rb
+++ b/chef-utils/lib/chef-utils/dsl/os.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/path_sanity.rb b/chef-utils/lib/chef-utils/dsl/path_sanity.rb
index 1fbfbdccf3..7766ce3176 100644
--- a/chef-utils/lib/chef-utils/dsl/path_sanity.rb
+++ b/chef-utils/lib/chef-utils/dsl/path_sanity.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/platform.rb b/chef-utils/lib/chef-utils/dsl/platform.rb
index c2ac460ff1..f44cb811bb 100644
--- a/chef-utils/lib/chef-utils/dsl/platform.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
@@ -235,19 +236,6 @@ module ChefUtils
# chef-sugar backcompat method
alias_method :openindiana?, :openindiana_platform?
- # Determine if the current node is Nexenta Core Platform aka Nexenta OS.
- #
- # @param [Chef::Node] node the node to check
- # @since 15.5
- #
- # @return [Boolean]
- #
- def nexentacore_platform?(node = __getnode)
- node["platform"] == "nexentacore"
- end
- # chef-sugar backcompat method
- alias_method :nexentacore?, :nexentacore_platform?
-
# Determine if the current node is AIX.
#
# @param [Chef::Node] node the node to check
diff --git a/chef-utils/lib/chef-utils/dsl/platform_family.rb b/chef-utils/lib/chef-utils/dsl/platform_family.rb
index cfe6b617e5..10d7b35901 100644
--- a/chef-utils/lib/chef-utils/dsl/platform_family.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform_family.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
@@ -320,7 +321,7 @@ module ChefUtils
# @return [Boolean]
#
def solaris_based?(node = __getnode)
- %w{solaris2 smartos omnios openindiana opensolaris nexentacore}.include?(node["platform"])
+ %w{solaris2 smartos omnios openindiana}.include?(node["platform"])
end
# All of the BSD-lineage.
diff --git a/chef-utils/lib/chef-utils/dsl/platform_version.rb b/chef-utils/lib/chef-utils/dsl/platform_version.rb
index 4d0a9247bd..33a534c5fb 100644
--- a/chef-utils/lib/chef-utils/dsl/platform_version.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform_version.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/service.rb b/chef-utils/lib/chef-utils/dsl/service.rb
index ed7805806c..4dedc8b8d6 100644
--- a/chef-utils/lib/chef-utils/dsl/service.rb
+++ b/chef-utils/lib/chef-utils/dsl/service.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/train_helpers.rb b/chef-utils/lib/chef-utils/dsl/train_helpers.rb
index a821383eac..8cc676d34d 100644
--- a/chef-utils/lib/chef-utils/dsl/train_helpers.rb
+++ b/chef-utils/lib/chef-utils/dsl/train_helpers.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
@@ -25,8 +26,13 @@ module ChefUtils
#
# FIXME: generally these helpers all use the pattern of checking for target_mode?
# and then if it is we use train. That approach should likely be flipped so that
- # even when we're running without target mode we still use inspec in its local
- # mode.
+ # even when we're running without target mode we still use train in its local
+ # mode. A prerequisite for that will be better CI testing of train against
+ # chef-client though, and ensuring that the APIs are entirely compatible. This
+ # will be particularly problematic for shell_out APIs and eventual file-creating
+ # APIs which are unlikely to be as sophisticated as the exiting code in chef-client
+ # for locally shelling out and creating files, and just dropping inspec local mode
+ # into chef-client would break the world.
#
# Train wrapper around File.exist? to make it local mode aware.
@@ -57,6 +63,24 @@ module ChefUtils
end
end
+ # Alias to easily convert IO.read / File.read to file_read
+ def file_read(path)
+ file_open(path).read
+ end
+
+ def file_directory?(path)
+ if __transport_connection
+ __transport_connection.file(filename).directory?
+ else
+ File.directory?(path)
+ end
+ end
+
+ # Alias to easily convert Dir.exist to dir_exist
+ def dir_exist?(path)
+ file_directory?(path)
+ end
+
extend self
end
end
diff --git a/chef-utils/lib/chef-utils/dsl/virtualization.rb b/chef-utils/lib/chef-utils/dsl/virtualization.rb
index ebc5d5228a..d2c1c5b531 100644
--- a/chef-utils/lib/chef-utils/dsl/virtualization.rb
+++ b/chef-utils/lib/chef-utils/dsl/virtualization.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/which.rb b/chef-utils/lib/chef-utils/dsl/which.rb
index c1aa64c159..49779f92a7 100644
--- a/chef-utils/lib/chef-utils/dsl/which.rb
+++ b/chef-utils/lib/chef-utils/dsl/which.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/dsl/windows.rb b/chef-utils/lib/chef-utils/dsl/windows.rb
index 67d2852393..dc8cd4ebc0 100644
--- a/chef-utils/lib/chef-utils/dsl/windows.rb
+++ b/chef-utils/lib/chef-utils/dsl/windows.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/internal.rb b/chef-utils/lib/chef-utils/internal.rb
index aa52005912..e5a7e65c89 100644
--- a/chef-utils/lib/chef-utils/internal.rb
+++ b/chef-utils/lib/chef-utils/internal.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/lib/chef-utils/mash.rb b/chef-utils/lib/chef-utils/mash.rb
index 00a1444964..484e172b33 100644
--- a/chef-utils/lib/chef-utils/mash.rb
+++ b/chef-utils/lib/chef-utils/mash.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright 2009-2016, Dan Kubb
# Permission is hereby granted, free of charge, to any person obtaining
diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb
index fa08a29bfc..3edb9d6ba4 100644
--- a/chef-utils/lib/chef-utils/version.rb
+++ b/chef-utils/lib/chef-utils/version.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
@@ -15,5 +16,5 @@
module ChefUtils
CHEFUTILS_ROOT = File.expand_path("..", __dir__)
- VERSION = "16.5.26".freeze
+ VERSION = "17.0.0"
end
diff --git a/chef-utils/lib/chef-utils/version_string.rb b/chef-utils/lib/chef-utils/version_string.rb
index 744704dc63..425fe5b050 100644
--- a/chef-utils/lib/chef-utils/version_string.rb
+++ b/chef-utils/lib/chef-utils/version_string.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright:: Copyright 2017, Noah Kantrowitz
# License:: Apache License, Version 2.0
#
@@ -27,7 +28,7 @@ module ChefUtils
#
# @param val [String] Version string to parse.
def initialize(val)
- val = "" unless val
+ val ||= ""
super(val)
begin
@parsed_version = ::Gem::Version.create(self)
diff --git a/chef-utils/spec/spec_helper.rb b/chef-utils/spec/spec_helper.rb
index 0b193e2d9a..da4fe0a03e 100644
--- a/chef-utils/spec/spec_helper.rb
+++ b/chef-utils/spec/spec_helper.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require "chef-utils"
# FIXME: dynamically generate this for accuracy
diff --git a/chef-utils/spec/unit/dsl/architecture_spec.rb b/chef-utils/spec/unit/dsl/architecture_spec.rb
index 30eab27bfb..a5336d05ef 100644
--- a/chef-utils/spec/unit/dsl/architecture_spec.rb
+++ b/chef-utils/spec/unit/dsl/architecture_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/cloud_spec.rb b/chef-utils/spec/unit/dsl/cloud_spec.rb
index 6cb7753b32..8a718dc37d 100644
--- a/chef-utils/spec/unit/dsl/cloud_spec.rb
+++ b/chef-utils/spec/unit/dsl/cloud_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/dsl_spec.rb b/chef-utils/spec/unit/dsl/dsl_spec.rb
index c03f3224ec..fd8869222f 100644
--- a/chef-utils/spec/unit/dsl/dsl_spec.rb
+++ b/chef-utils/spec/unit/dsl/dsl_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/introspection_spec.rb b/chef-utils/spec/unit/dsl/introspection_spec.rb
index 9275a9fc79..2a841dee68 100644
--- a/chef-utils/spec/unit/dsl/introspection_spec.rb
+++ b/chef-utils/spec/unit/dsl/introspection_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/os_spec.rb b/chef-utils/spec/unit/dsl/os_spec.rb
index 9230670487..967517b957 100644
--- a/chef-utils/spec/unit/dsl/os_spec.rb
+++ b/chef-utils/spec/unit/dsl/os_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/path_sanity_spec.rb b/chef-utils/spec/unit/dsl/path_sanity_spec.rb
index c75b99a751..50cadd7466 100644
--- a/chef-utils/spec/unit/dsl/path_sanity_spec.rb
+++ b/chef-utils/spec/unit/dsl/path_sanity_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/platform_family_spec.rb b/chef-utils/spec/unit/dsl/platform_family_spec.rb
index bcd0f3412c..fdf4584afd 100644
--- a/chef-utils/spec/unit/dsl/platform_family_spec.rb
+++ b/chef-utils/spec/unit/dsl/platform_family_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/platform_spec.rb b/chef-utils/spec/unit/dsl/platform_spec.rb
index 93b61f0532..216e15f112 100644
--- a/chef-utils/spec/unit/dsl/platform_spec.rb
+++ b/chef-utils/spec/unit/dsl/platform_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/service_spec.rb b/chef-utils/spec/unit/dsl/service_spec.rb
index 0288343940..bfb78441b2 100644
--- a/chef-utils/spec/unit/dsl/service_spec.rb
+++ b/chef-utils/spec/unit/dsl/service_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/virtualization_spec.rb b/chef-utils/spec/unit/dsl/virtualization_spec.rb
index 2b26f5514f..6ee7eb3d3b 100644
--- a/chef-utils/spec/unit/dsl/virtualization_spec.rb
+++ b/chef-utils/spec/unit/dsl/virtualization_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/dsl/which_spec.rb b/chef-utils/spec/unit/dsl/which_spec.rb
index 941f6282a0..5ea5f6ccea 100644
--- a/chef-utils/spec/unit/dsl/which_spec.rb
+++ b/chef-utils/spec/unit/dsl/which_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
@@ -94,7 +95,7 @@ RSpec.describe ChefUtils::DSL::Which do
end
test_which("arrays with blocks", "foo1", "foo2", finds: "/dir2/foo1", others: [ "/dir1/foo2" ]) do |f|
- raise "bad arg to block" unless f == "/dir2/foo1" || f == "/dir1/foo2"
+ raise "bad arg to block" unless ["/dir2/foo1", "/dir1/foo2"].include?(f)
true
end
diff --git a/chef-utils/spec/unit/dsl/windows_spec.rb b/chef-utils/spec/unit/dsl/windows_spec.rb
index a1d20e854b..423cfe5187 100644
--- a/chef-utils/spec/unit/dsl/windows_spec.rb
+++ b/chef-utils/spec/unit/dsl/windows_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
diff --git a/chef-utils/spec/unit/mash_spec.rb b/chef-utils/spec/unit/mash_spec.rb
index 2991592ec1..3f83823773 100644
--- a/chef-utils/spec/unit/mash_spec.rb
+++ b/chef-utils/spec/unit/mash_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Matthew Kent (<mkent@magoazul.com>)
# Copyright:: Copyright (c) Chef Software Inc.
diff --git a/chef.gemspec b/chef.gemspec
index 78b1f0c3c2..a41dffa741 100644
--- a/chef.gemspec
+++ b/chef.gemspec
@@ -20,17 +20,18 @@ Gem::Specification.new do |s|
s.add_dependency "train-core", "~> 3.2", ">= 3.2.28" # 3.2.28 fixes sudo prompts. See https://github.com/chef/chef/pull/9635
s.add_dependency "train-winrm", ">= 0.2.5"
- s.add_dependency "license-acceptance", "~> 1.0", ">= 1.0.5"
+ s.add_dependency "license-acceptance", ">= 1.0.5", "< 3"
s.add_dependency "mixlib-cli", ">= 2.1.1", "< 3.0"
s.add_dependency "mixlib-log", ">= 2.0.3", "< 4.0"
s.add_dependency "mixlib-authentication", ">= 2.1", "< 4"
s.add_dependency "mixlib-shellout", ">= 3.1.1", "< 4.0"
s.add_dependency "mixlib-archive", ">= 0.4", "< 2.0"
- s.add_dependency "ohai", "~> 16.0"
+ s.add_dependency "ohai", "~> 17.0"
+ s.add_dependency "inspec-core", "~> 4.23"
s.add_dependency "ffi", ">= 1.9.25"
s.add_dependency "ffi-yajl", "~> 2.2"
- s.add_dependency "net-ssh", ">= 4.2", "< 7"
+ s.add_dependency "net-ssh", ">= 5.1", "< 7"
s.add_dependency "net-ssh-multi", "~> 1.2", ">= 1.2.1"
s.add_dependency "net-sftp", ">= 2.1.2", "< 4.0"
s.add_dependency "ed25519", "~> 1.2" # ed25519 ssh key support
@@ -38,7 +39,7 @@ Gem::Specification.new do |s|
s.add_dependency "highline", ">= 1.6.9", "< 3"
s.add_dependency "tty-prompt", "~> 0.21" # knife ui.ask prompt
s.add_dependency "tty-screen", "~> 0.6" # knife list
- s.add_dependency "tty-table", "~> 0.11.0" # knife render table output
+ s.add_dependency "tty-table", "~> 0.11" # knife render table output.
s.add_dependency "pastel" # knife ui.color
s.add_dependency "erubis", "~> 2.7"
s.add_dependency "diff-lcs", ">= 1.2.4", "< 1.4.0" # 1.4 breaks output
diff --git a/cspell.json b/cspell.json
index dd9fe6717f..2c34043b30 100644
--- a/cspell.json
+++ b/cspell.json
@@ -16,7 +16,6 @@
"words": [
"abcz",
"Abdulin",
- "badssl",
"ABORTIFHUNG",
"ACCOUNTDISABLE",
"activationkey",
@@ -111,6 +110,7 @@
"backupfile",
"BADKEY",
"badpasswordattempts",
+ "badssl",
"balasankarc",
"Balatero",
"barbaz",
@@ -317,6 +317,7 @@
"DBCS",
"dbresson",
"DBUS",
+ "dctoken",
"DDTHH",
"debconf",
"debianrcd",
@@ -418,7 +419,6 @@
"Eachern",
"EASTEUROPE",
"EBUSY",
- "escapepath",
"eckey",
"ecparam",
"edir",
@@ -452,6 +452,7 @@
"Erubis",
"Eruby",
"esac",
+ "escapepath",
"ESRCH",
"etag",
"etags",
@@ -761,6 +762,7 @@
"Juanje",
"jugatsu",
"julienhuon",
+ "jxvf",
"katello",
"Kauppila",
"kaustubh",
@@ -942,6 +944,7 @@
"metafile",
"METAFILE",
"metalink",
+ "metasearch",
"Miah",
"michaellihs",
"Microarchitecture",
@@ -1064,8 +1067,6 @@
"newguard",
"newpkg",
"newval",
- "Nexenta",
- "nexentacore",
"nillable",
"Nimisha",
"nlist",
@@ -1175,6 +1176,7 @@
"PASSWORDNAME",
"PATCHLEVEL",
"pathed",
+ "PATHEXT",
"PATHFINDING",
"pathnames",
"pbkdf",
@@ -1881,7 +1883,6 @@
"Zanetti",
"Zapp",
"zeproc",
- "PATHEXT",
"ZEROEXEC",
"ZEROINIT",
"Zimmek",
@@ -1913,7 +1914,8 @@
"omnibus/resources/chef/**/*",
"kitchen-tests/cookbooks/end_to_end/files/*",
"spec/**",
- "docs_site"
+ "docs_site",
+ "distro/ruby_bin_folder/**/*"
],
"ignoreRegExpList": [
// Ignore "'s" at the end of a word. If "Chef" is an accepted word, so is "Chef's".
diff --git a/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
new file mode 100644
index 0000000000..022591ffd1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll
new file mode 100644
index 0000000000..2316fffdb5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/Ijwhost.dll b/distro/ruby_bin_folder/AMD64/Ijwhost.dll
new file mode 100644
index 0000000000..e2c6c9fc90
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/Ijwhost.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/Newtonsoft.Json.dll b/distro/ruby_bin_folder/AMD64/Newtonsoft.Json.dll
index 1971a35679..1971a35679 100644
--- a/distro/ruby_bin_folder/Newtonsoft.Json.dll
+++ b/distro/ruby_bin_folder/AMD64/Newtonsoft.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/concrt140.dll b/distro/ruby_bin_folder/AMD64/concrt140.dll
new file mode 100644
index 0000000000..87dd4f08fe
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/concrt140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll b/distro/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll
new file mode 100644
index 0000000000..7595b4cd83
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/msvcp140.dll b/distro/ruby_bin_folder/AMD64/msvcp140.dll
new file mode 100644
index 0000000000..0e0639bc22
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/msvcp140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/msvcp140_1.dll b/distro/ruby_bin_folder/AMD64/msvcp140_1.dll
new file mode 100644
index 0000000000..53845b5f1f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/msvcp140_1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/msvcp140_2.dll b/distro/ruby_bin_folder/AMD64/msvcp140_2.dll
new file mode 100644
index 0000000000..4365b9f06d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/msvcp140_2.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dll b/distro/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dll
new file mode 100644
index 0000000000..1cfb379c67
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dll b/distro/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dll
new file mode 100644
index 0000000000..42cc3406a5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll
new file mode 100644
index 0000000000..cb9a5c276b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll
new file mode 100644
index 0000000000..3f472f2c81
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb
new file mode 100644
index 0000000000..03a0860086
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json
new file mode 100644
index 0000000000..9d0500cd16
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json
@@ -0,0 +1,9 @@
+{
+ "runtimeOptions": {
+ "tfm": "net5.0",
+ "framework": {
+ "name": "Microsoft.NETCore.App",
+ "version": "5.0.0"
+ }
+ }
+} \ No newline at end of file
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll
new file mode 100644
index 0000000000..e2c6c9fc90
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dll
new file mode 100644
index 0000000000..2a70d37424
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dll
new file mode 100644
index 0000000000..f1d216624a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll
new file mode 100644
index 0000000000..fe584ad61c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dll
new file mode 100644
index 0000000000..8b6f598975
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dll
new file mode 100644
index 0000000000..bfdf0b004b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.amd64.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.amd64.dll
new file mode 100644
index 0000000000..e376a20352
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.amd64.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
new file mode 100644
index 0000000000..2e5c7ea7d5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dll
new file mode 100644
index 0000000000..c70b1d3205
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dll
new file mode 100644
index 0000000000..6d14e763cd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json
new file mode 100644
index 0000000000..a415e4237a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json
@@ -0,0 +1,2576 @@
+{
+ "runtimeTarget": {
+ "name": ".NETCoreApp,Version=v5.0/win10-x64",
+ "signature": ""
+ },
+ "compilationOptions": {},
+ "targets": {
+ ".NETCoreApp,Version=v5.0": {},
+ ".NETCoreApp,Version=v5.0/win10-x64": {
+ "Chef.Powershell.Core/1.0.0": {
+ "dependencies": {
+ "Microsoft.PowerShell.Commands.Diagnostics": "7.1.0",
+ "Microsoft.PowerShell.Commands.Management": "7.1.0",
+ "Microsoft.PowerShell.Commands.Utility": "7.1.0",
+ "Microsoft.PowerShell.ConsoleHost": "7.1.0",
+ "Microsoft.WSMan.Management": "7.1.0",
+ "Microsoft.WSMan.Runtime": "7.1.0",
+ "Newtonsoft.Json": "12.0.3",
+ "System.Management.Automation": "7.1.0",
+ "runtimepack.Microsoft.NETCore.App.Runtime.win-x64": "5.0.0"
+ },
+ "runtime": {
+ "Chef.Powershell.Core.dll": {}
+ }
+ },
+ "runtimepack.Microsoft.NETCore.App.Runtime.win-x64/5.0.0": {
+ "runtime": {
+ "Microsoft.CSharp.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "Microsoft.VisualBasic.Core.dll": {
+ "assemblyVersion": "10.0.6.0",
+ "fileVersion": "11.0.20.51904"
+ },
+ "Microsoft.VisualBasic.dll": {
+ "assemblyVersion": "10.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "Microsoft.Win32.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "Microsoft.Win32.Registry.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.AppContext.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Buffers.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.Concurrent.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.Immutable.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.NonGeneric.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.Specialized.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.Annotations.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.DataAnnotations.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.EventBasedAsync.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.TypeConverter.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Configuration.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Console.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Core.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Data.Common.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Data.DataSetExtensions.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Data.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Contracts.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Debug.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.DiagnosticSource.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.FileVersionInfo.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Process.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.StackTrace.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.TextWriterTraceListener.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Tools.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.TraceSource.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Tracing.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Drawing.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Drawing.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Dynamic.Runtime.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Formats.Asn1.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Globalization.Calendars.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Globalization.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Globalization.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.Brotli.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.FileSystem.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.ZipFile.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.DriveInfo.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.Watcher.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.IsolatedStorage.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.MemoryMappedFiles.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Pipes.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Pipes.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.UnmanagedMemoryStream.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.Expressions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.Parallel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.Queryable.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Memory.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Http.Json.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Http.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.HttpListener.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Mail.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.NameResolution.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.NetworkInformation.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Ping.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Requests.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Security.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.ServicePoint.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Sockets.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebClient.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebHeaderCollection.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebProxy.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebSockets.Client.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebSockets.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Numerics.Vectors.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Numerics.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ObjectModel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.DataContractSerialization.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.Uri.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.Xml.Linq.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.Xml.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.DispatchProxy.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Emit.ILGeneration.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Emit.Lightweight.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Emit.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Metadata.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.TypeExtensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Resources.Reader.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Resources.ResourceManager.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Resources.Writer.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.CompilerServices.Unsafe.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.CompilerServices.VisualC.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Handles.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.InteropServices.RuntimeInformation.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.InteropServices.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Intrinsics.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Loader.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Numerics.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Formatters.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Json.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Xml.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Claims.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Algorithms.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Cng.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Csp.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Encoding.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.OpenSsl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.X509Certificates.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Principal.Windows.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Principal.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.SecureString.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ServiceModel.Web.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ServiceProcess.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encoding.CodePages.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encoding.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encoding.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encodings.Web.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Json.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.RegularExpressions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Channels.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Overlapped.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.Dataflow.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.Parallel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Thread.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.ThreadPool.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Timer.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Transactions.Local.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Transactions.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ValueTuple.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Web.HttpUtility.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Web.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Windows.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.Linq.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.ReaderWriter.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.Serialization.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XDocument.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XPath.XDocument.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XPath.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XmlDocument.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XmlSerializer.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "WindowsBase.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscorlib.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "netstandard.dll": {
+ "assemblyVersion": "2.1.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.CoreLib.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ },
+ "native": {
+ "Microsoft.DiaSymReader.Native.amd64.dll": {
+ "fileVersion": "14.12.25830.2"
+ },
+ "api-ms-win-core-console-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-console-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-datetime-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-debug-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-errorhandling-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-file-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-file-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-file-l2-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-handle-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-heap-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-interlocked-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-libraryloader-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-localization-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-memory-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-namedpipe-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-processenvironment-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-processthreads-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-processthreads-l1-1-1.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-profile-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-rtlsupport-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-string-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-synch-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-synch-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-sysinfo-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-timezone-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-util-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-conio-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-convert-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-environment-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-filesystem-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-heap-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-locale-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-math-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-multibyte-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-private-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-process-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-runtime-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-stdio-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-string-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-time-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-utility-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "clrcompression.dll": {
+ "fileVersion": "42.42.42.42424"
+ },
+ "clretwrc.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "clrjit.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "coreclr.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "createdump.exe": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "dbgshim.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "hostfxr.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "hostpolicy.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscordaccore.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscordaccore_amd64_amd64_5.0.20.51904.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscordbi.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscorrc.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "ucrtbase.dll": {
+ "fileVersion": "10.0.19041.1"
+ }
+ }
+ },
+ "Markdig.Signed/0.21.1": {
+ "runtime": {
+ "lib/netcoreapp3.1/Markdig.Signed.dll": {
+ "assemblyVersion": "0.21.1.0",
+ "fileVersion": "0.21.1.0"
+ }
+ }
+ },
+ "Microsoft.ApplicationInsights/2.15.0": {
+ "dependencies": {
+ "System.Diagnostics.DiagnosticSource": "4.6.0",
+ "System.Memory": "4.5.4"
+ },
+ "runtime": {
+ "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": {
+ "assemblyVersion": "2.15.0.44797",
+ "fileVersion": "2.15.0.44797"
+ }
+ }
+ },
+ "Microsoft.CodeAnalysis.Analyzers/3.0.0": {},
+ "Microsoft.CodeAnalysis.Common/3.7.0": {
+ "dependencies": {
+ "Microsoft.CodeAnalysis.Analyzers": "3.0.0",
+ "System.Collections.Immutable": "1.5.0",
+ "System.Memory": "4.5.4",
+ "System.Reflection.Metadata": "1.6.0",
+ "System.Runtime.CompilerServices.Unsafe": "5.0.0",
+ "System.Text.Encoding.CodePages": "5.0.0",
+ "System.Threading.Tasks.Extensions": "4.5.3"
+ },
+ "runtime": {
+ "lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": {
+ "assemblyVersion": "3.7.0.0",
+ "fileVersion": "3.700.20.37502"
+ }
+ },
+ "resources": {
+ "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "cs"
+ },
+ "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "de"
+ },
+ "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "es"
+ },
+ "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "fr"
+ },
+ "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "it"
+ },
+ "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "ja"
+ },
+ "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "ko"
+ },
+ "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "pl"
+ },
+ "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "pt-BR"
+ },
+ "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "ru"
+ },
+ "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "tr"
+ },
+ "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "zh-Hans"
+ },
+ "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "zh-Hant"
+ }
+ }
+ },
+ "Microsoft.CodeAnalysis.CSharp/3.7.0": {
+ "dependencies": {
+ "Microsoft.CodeAnalysis.Common": "3.7.0"
+ },
+ "runtime": {
+ "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": {
+ "assemblyVersion": "3.7.0.0",
+ "fileVersion": "3.700.20.37502"
+ }
+ },
+ "resources": {
+ "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "cs"
+ },
+ "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "de"
+ },
+ "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "es"
+ },
+ "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "fr"
+ },
+ "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "it"
+ },
+ "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "ja"
+ },
+ "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "ko"
+ },
+ "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "pl"
+ },
+ "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "pt-BR"
+ },
+ "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "ru"
+ },
+ "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "tr"
+ },
+ "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "zh-Hans"
+ },
+ "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "zh-Hant"
+ }
+ }
+ },
+ "Microsoft.CSharp/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Dynamic.Runtime": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.Linq.Expressions": "4.3.0",
+ "System.ObjectModel": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Extensions": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Reflection.TypeExtensions": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/Microsoft.CSharp.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "Microsoft.Management.Infrastructure/2.0.0": {
+ "dependencies": {
+ "Microsoft.Management.Infrastructure.Runtime.Unix": "2.0.0",
+ "Microsoft.Management.Infrastructure.Runtime.Win": "2.0.0"
+ }
+ },
+ "Microsoft.Management.Infrastructure.Runtime.Unix/2.0.0": {},
+ "Microsoft.Management.Infrastructure.Runtime.Win/2.0.0": {
+ "runtime": {
+ "runtimes/win10-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll": {
+ "assemblyVersion": "1.0.0.0",
+ "fileVersion": "10.0.18362.1"
+ },
+ "runtimes/win10-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll": {
+ "assemblyVersion": "1.0.0.0",
+ "fileVersion": "10.0.18362.1"
+ }
+ },
+ "native": {
+ "runtimes/win10-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll": {
+ "fileVersion": "10.0.18362.1"
+ },
+ "runtimes/win10-x64/native/mi.dll": {
+ "fileVersion": "10.0.18362.1"
+ },
+ "runtimes/win10-x64/native/miutils.dll": {
+ "fileVersion": "10.0.18362.1"
+ }
+ }
+ },
+ "Microsoft.NETCore.Platforms/5.0.0": {},
+ "Microsoft.NETCore.Targets/1.1.0": {},
+ "Microsoft.PowerShell.Commands.Diagnostics/7.1.0": {
+ "dependencies": {
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Commands.Diagnostics.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Commands.Management/7.1.0": {
+ "dependencies": {
+ "Microsoft.PowerShell.Security": "7.1.0",
+ "System.ServiceProcess.ServiceController": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Commands.Management.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Commands.Utility/7.1.0": {
+ "dependencies": {
+ "Microsoft.CodeAnalysis.CSharp": "3.7.0",
+ "Microsoft.PowerShell.MarkdownRender": "7.1.0",
+ "NJsonSchema": "10.2.2",
+ "System.Drawing.Common": "5.0.0",
+ "System.Management.Automation": "7.1.0",
+ "System.Threading.AccessControl": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Commands.Utility.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.ConsoleHost/7.1.0": {
+ "dependencies": {
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.ConsoleHost.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.CoreCLR.Eventing/7.1.0": {
+ "dependencies": {
+ "System.Diagnostics.EventLog": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.CoreCLR.Eventing.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.MarkdownRender/7.1.0": {
+ "dependencies": {
+ "Markdig.Signed": "0.21.1",
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.MarkdownRender.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Native/7.1.0": {
+ "native": {
+ "runtimes/win-x64/native/PowerShell.Core.Instrumentation.dll": {
+ "fileVersion": "10.0.10011.16384"
+ },
+ "runtimes/win-x64/native/pwrshplugin.dll": {
+ "fileVersion": "10.0.10011.16384"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Security/7.1.0": {
+ "dependencies": {
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Security.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.Win32.Registry/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "Microsoft.Win32.Registry.AccessControl/5.0.0": {
+ "dependencies": {
+ "Microsoft.Win32.Registry": "5.0.0",
+ "System.Security.AccessControl": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "Microsoft.Win32.SystemEvents/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "Microsoft.WSMan.Management/7.1.0": {
+ "dependencies": {
+ "Microsoft.WSMan.Runtime": "7.1.0",
+ "System.Management.Automation": "7.1.0",
+ "System.ServiceProcess.ServiceController": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.WSMan.Management.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.WSMan.Runtime/7.1.0": {
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.WSMan.Runtime.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Namotion.Reflection/1.0.14": {
+ "dependencies": {
+ "Microsoft.CSharp": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard2.0/Namotion.Reflection.dll": {
+ "assemblyVersion": "1.0.14.0",
+ "fileVersion": "1.0.14.0"
+ }
+ }
+ },
+ "Newtonsoft.Json/12.0.3": {
+ "runtime": {
+ "lib/netstandard2.0/Newtonsoft.Json.dll": {
+ "assemblyVersion": "12.0.0.0",
+ "fileVersion": "12.0.3.23909"
+ }
+ }
+ },
+ "NJsonSchema/10.2.2": {
+ "dependencies": {
+ "Namotion.Reflection": "1.0.14",
+ "Newtonsoft.Json": "12.0.3"
+ },
+ "runtime": {
+ "lib/netstandard2.0/NJsonSchema.dll": {
+ "assemblyVersion": "10.2.2.0",
+ "fileVersion": "10.2.2.0"
+ }
+ }
+ },
+ "runtime.any.System.Collections/4.3.0": {
+ "dependencies": {
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Collections.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Globalization/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Globalization.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.IO/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.5/System.IO.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Reflection/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.5/System.Reflection.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Reflection.Extensions/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Extensions.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Reflection.Primitives/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Primitives.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Resources.ResourceManager/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Resources.ResourceManager.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Runtime/4.3.0": {
+ "dependencies": {
+ "System.Private.Uri": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.5/System.Runtime.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Runtime.Handles/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Runtime.Handles.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Runtime.InteropServices/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.6/System.Runtime.InteropServices.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Text.Encoding/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Text.Encoding.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Threading.Tasks/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Threading.Tasks.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.win.System.Diagnostics.Debug/4.3.0": {
+ "runtime": {
+ "runtimes/win/lib/netstandard1.3/System.Diagnostics.Debug.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.win.System.Runtime.Extensions/4.3.0": {
+ "dependencies": {
+ "System.Private.Uri": "4.3.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard1.5/System.Runtime.Extensions.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.win7.System.Private.Uri/4.3.0": {
+ "runtime": {
+ "runtimes/win/lib/netstandard1.0/System.Private.Uri.dll": {
+ "assemblyVersion": "4.0.3.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.CodeDom/5.0.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.CodeDom.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Collections/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Collections": "4.3.0"
+ }
+ },
+ "System.Collections.Immutable/1.5.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.Collections.Immutable.dll": {
+ "assemblyVersion": "1.2.3.0",
+ "fileVersion": "4.6.26515.6"
+ }
+ }
+ },
+ "System.Configuration.ConfigurationManager/5.0.0": {
+ "dependencies": {
+ "System.Security.Cryptography.ProtectedData": "5.0.0",
+ "System.Security.Permissions": "5.0.0"
+ },
+ "runtime": {
+ "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Diagnostics.Debug/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.win.System.Diagnostics.Debug": "4.3.0"
+ }
+ },
+ "System.Diagnostics.DiagnosticSource/4.6.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": {
+ "assemblyVersion": "4.0.4.0",
+ "fileVersion": "4.700.19.46214"
+ }
+ }
+ },
+ "System.Diagnostics.EventLog/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.Win32.Registry": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.DirectoryServices/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "System.IO.FileSystem.AccessControl": "5.0.0",
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Permissions": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.DirectoryServices.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Drawing.Common/5.0.0": {
+ "dependencies": {
+ "Microsoft.Win32.SystemEvents": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Dynamic.Runtime/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.Linq.Expressions": "4.3.0",
+ "System.ObjectModel": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Reflection.TypeExtensions": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Dynamic.Runtime.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Formats.Asn1/5.0.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.Formats.Asn1.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Globalization/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Globalization": "4.3.0"
+ }
+ },
+ "System.IO/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading.Tasks": "4.3.0",
+ "runtime.any.System.IO": "4.3.0"
+ }
+ },
+ "System.IO.FileSystem.AccessControl/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.IO.FileSystem.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Linq/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.6/System.Linq.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Linq.Expressions/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.ObjectModel": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Emit.Lightweight": "4.3.0",
+ "System.Reflection.Extensions": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Reflection.TypeExtensions": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.6/System.Linq.Expressions.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Management/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.Win32.Registry": "5.0.0",
+ "System.CodeDom": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Management.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Management.Automation/7.1.0": {
+ "dependencies": {
+ "Microsoft.ApplicationInsights": "2.15.0",
+ "Microsoft.Management.Infrastructure": "2.0.0",
+ "Microsoft.PowerShell.CoreCLR.Eventing": "7.1.0",
+ "Microsoft.PowerShell.Native": "7.1.0",
+ "Microsoft.Win32.Registry.AccessControl": "5.0.0",
+ "Newtonsoft.Json": "12.0.3",
+ "System.Configuration.ConfigurationManager": "5.0.0",
+ "System.DirectoryServices": "5.0.0",
+ "System.IO.FileSystem.AccessControl": "5.0.0",
+ "System.Management": "5.0.0",
+ "System.Runtime.CompilerServices.Unsafe": "5.0.0",
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Cryptography.Pkcs": "5.0.0",
+ "System.Security.Permissions": "5.0.0",
+ "System.Text.Encoding.CodePages": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/System.Management.Automation.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "System.Memory/4.5.4": {},
+ "System.ObjectModel/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.ObjectModel.dll": {
+ "assemblyVersion": "4.0.13.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Private.Uri/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "runtime.win7.System.Private.Uri": "4.3.0"
+ }
+ },
+ "System.Reflection/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.IO": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Reflection": "4.3.0"
+ }
+ },
+ "System.Reflection.Emit/4.3.0": {
+ "dependencies": {
+ "System.IO": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Emit.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Reflection.Emit.ILGeneration/4.3.0": {
+ "dependencies": {
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Reflection.Emit.Lightweight/4.3.0": {
+ "dependencies": {
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Reflection.Extensions/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Reflection.Extensions": "4.3.0"
+ }
+ },
+ "System.Reflection.Metadata/1.6.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.Reflection.Metadata.dll": {
+ "assemblyVersion": "1.4.3.0",
+ "fileVersion": "4.6.26515.6"
+ }
+ }
+ },
+ "System.Reflection.Primitives/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Reflection.Primitives": "4.3.0"
+ }
+ },
+ "System.Reflection.TypeExtensions/4.3.0": {
+ "dependencies": {
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Resources.ResourceManager/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Globalization": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Resources.ResourceManager": "4.3.0"
+ }
+ },
+ "System.Runtime/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "runtime.any.System.Runtime": "4.3.0"
+ }
+ },
+ "System.Runtime.CompilerServices.Unsafe/5.0.0": {
+ "runtime": {
+ "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Runtime.Extensions/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.win.System.Runtime.Extensions": "4.3.0"
+ }
+ },
+ "System.Runtime.Handles/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Runtime.Handles": "4.3.0"
+ }
+ },
+ "System.Runtime.InteropServices/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "runtime.any.System.Runtime.InteropServices": "4.3.0"
+ }
+ },
+ "System.Security.AccessControl/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Cryptography.Cng/5.0.0": {
+ "dependencies": {
+ "System.Formats.Asn1": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Cryptography.Pkcs/5.0.0": {
+ "dependencies": {
+ "System.Formats.Asn1": "5.0.0",
+ "System.Security.Cryptography.Cng": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Pkcs.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Cryptography.ProtectedData/5.0.0": {
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Permissions/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Windows.Extensions": "5.0.0"
+ },
+ "runtime": {
+ "lib/net5.0/System.Security.Permissions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Principal.Windows/5.0.0": {
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.ServiceProcess.ServiceController/5.0.0": {
+ "dependencies": {
+ "System.Diagnostics.EventLog": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.ServiceProcess.ServiceController.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Text.Encoding/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Text.Encoding": "4.3.0"
+ }
+ },
+ "System.Text.Encoding.CodePages/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Threading/4.3.0": {
+ "dependencies": {
+ "System.Runtime": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Threading.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Threading.AccessControl/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.Threading.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Threading.Tasks/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.Threading.Tasks.Extensions/4.5.3": {},
+ "System.Windows.Extensions/5.0.0": {
+ "dependencies": {
+ "System.Drawing.Common": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ }
+ }
+ },
+ "libraries": {
+ "Chef.Powershell.Core/1.0.0": {
+ "type": "project",
+ "serviceable": false,
+ "sha512": ""
+ },
+ "runtimepack.Microsoft.NETCore.App.Runtime.win-x64/5.0.0": {
+ "type": "runtimepack",
+ "serviceable": false,
+ "sha512": ""
+ },
+ "Markdig.Signed/0.21.1": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Lg0FPQdKUXai4/XZpQGlQ/HldpHsGnsU6Jd+udJgHj/R7i3ngM2TtR+SZqdHRtgItIHe3dFh2DS/M5qXGSPRiQ==",
+ "path": "markdig.signed/0.21.1",
+ "hashPath": "markdig.signed.0.21.1.nupkg.sha512"
+ },
+ "Microsoft.ApplicationInsights/2.15.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-tG9WZoFc0BTbkj+UjH4IUp8qkT9NA5st8zvPzlHbU8rJDgPFqZDJ3SSAQajl42jet1ghhJ5ZixsjjqVvwi4kaQ==",
+ "path": "microsoft.applicationinsights/2.15.0",
+ "hashPath": "microsoft.applicationinsights.2.15.0.nupkg.sha512"
+ },
+ "Microsoft.CodeAnalysis.Analyzers/3.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-ojG5pGAhTPmjxRGTNvuszO3H8XPZqksDwr9xLd4Ae/JBjZZdl6GuoLk7uLMf+o7yl5wO0TAqoWcEKkEWqrZE5g==",
+ "path": "microsoft.codeanalysis.analyzers/3.0.0",
+ "hashPath": "microsoft.codeanalysis.analyzers.3.0.0.nupkg.sha512"
+ },
+ "Microsoft.CodeAnalysis.Common/3.7.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SFEdnbw8204hTlde3JePYSIpNX58h/MMXa7LctUsUDigWMR8Ar9gE8LnsLqAIFM0O33JEuQbJ0G4Sat+cPGldw==",
+ "path": "microsoft.codeanalysis.common/3.7.0",
+ "hashPath": "microsoft.codeanalysis.common.3.7.0.nupkg.sha512"
+ },
+ "Microsoft.CodeAnalysis.CSharp/3.7.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-sKi5PIVy9nVDerkbplY6OQhJBNzEO4XJsMGrnmb6KFEa6K1ulGCHIv6NtDjdUQ/dGrouU3OExc3yzww0COD76w==",
+ "path": "microsoft.codeanalysis.csharp/3.7.0",
+ "hashPath": "microsoft.codeanalysis.csharp.3.7.0.nupkg.sha512"
+ },
+ "Microsoft.CSharp/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==",
+ "path": "microsoft.csharp/4.3.0",
+ "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512"
+ },
+ "Microsoft.Management.Infrastructure/2.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-IaKZRNBBv3sdrmBWd+aqwHq8cVHk/3WgWFAN/dt40MRY9rbtHiDfTTmaEN0tGTmQqGCGDo/ncntA8MvFMvcsRw==",
+ "path": "microsoft.management.infrastructure/2.0.0",
+ "hashPath": "microsoft.management.infrastructure.2.0.0.nupkg.sha512"
+ },
+ "Microsoft.Management.Infrastructure.Runtime.Unix/2.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-p0lslMX5bdWLxO2P7ao+rjAMOB0LEwPYpzvdCQ2OEYgX2NxFpQ8ILvqPGnYlTAb53rT8gu5DyIol1HboHFYfxQ==",
+ "path": "microsoft.management.infrastructure.runtime.unix/2.0.0",
+ "hashPath": "microsoft.management.infrastructure.runtime.unix.2.0.0.nupkg.sha512"
+ },
+ "Microsoft.Management.Infrastructure.Runtime.Win/2.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-vjBWQeDOjgernkrOdbEgn7M70SF7hof7ORdKPSlL06Uc15+oYdth5dZju9KsgUoti/cwnkZTiwtDx/lRtay0sA==",
+ "path": "microsoft.management.infrastructure.runtime.win/2.0.0",
+ "hashPath": "microsoft.management.infrastructure.runtime.win.2.0.0.nupkg.sha512"
+ },
+ "Microsoft.NETCore.Platforms/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
+ "path": "microsoft.netcore.platforms/5.0.0",
+ "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.NETCore.Targets/1.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==",
+ "path": "microsoft.netcore.targets/1.1.0",
+ "hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Commands.Diagnostics/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Hipqx38QOv1xWXbV4yGWHOmFIV8zp0O15z2H+Vx0Z0cOnzu4eb+MUblb4Dc1FA3S7ZE56qplC3XBK3hs0EsvYA==",
+ "path": "microsoft.powershell.commands.diagnostics/7.1.0",
+ "hashPath": "microsoft.powershell.commands.diagnostics.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Commands.Management/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-3S5CU0Zq8ecdywaI3NoKyzjyaLaS7OKAi6z2AfiyKDG5IZfoLTBgIzNQElNFag8UALTNRlKGD8cumVtM3myAQA==",
+ "path": "microsoft.powershell.commands.management/7.1.0",
+ "hashPath": "microsoft.powershell.commands.management.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Commands.Utility/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-6BXJ7NRCs8xCHqspv1VoijXKLfLrM6O8rJwyTk0mPc5BZvpC2NSQq1NAJHAlk60ENFTu0vtxK2IzWkbFvJ/BUQ==",
+ "path": "microsoft.powershell.commands.utility/7.1.0",
+ "hashPath": "microsoft.powershell.commands.utility.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.ConsoleHost/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-vfs4i5cViK5YsiIveuFv7OTrN2m5vPfOXj3XBkrQHtlMb2u0mkIsqVMTDHRMAyopcpp0ZJ1H+4ZsZ9z1bcpagQ==",
+ "path": "microsoft.powershell.consolehost/7.1.0",
+ "hashPath": "microsoft.powershell.consolehost.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.CoreCLR.Eventing/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-TCTaoyysnTHUErm0w8W50CVB5Mzwj1PQyb740K1DLvbw8Ba607Q1HCSzBHClEDlG+Cphuv9ie2pbvEWcUKslVg==",
+ "path": "microsoft.powershell.coreclr.eventing/7.1.0",
+ "hashPath": "microsoft.powershell.coreclr.eventing.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.MarkdownRender/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-FD8ARPyKg22yRhU3gUk6NKZtmtSk5uekqufjJCiTu8A5lvWF9A0mCr/OUYE7+HQLnJoBu8BR19vwnED0Jpd1WQ==",
+ "path": "microsoft.powershell.markdownrender/7.1.0",
+ "hashPath": "microsoft.powershell.markdownrender.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Native/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-PJ/ei1HnYC+CMVDdUMT96PgWFONwVv/ZaJ5j//qLdk073alzdzOPWZiGsxYimJaRLP0TW4uomgIsR9q6jrf48A==",
+ "path": "microsoft.powershell.native/7.1.0",
+ "hashPath": "microsoft.powershell.native.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Security/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-I4ab6z1Vlu25c33jc0gG0Val6YpSgyOyxNsNOENcBGue9TDJQ+d6ppw1IKcCILefpVAo/UWiE4xrWxO04KUc3g==",
+ "path": "microsoft.powershell.security/7.1.0",
+ "hashPath": "microsoft.powershell.security.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.Win32.Registry/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
+ "path": "microsoft.win32.registry/5.0.0",
+ "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.Win32.Registry.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-rwF501ZS/xKGWz5H3RLBvwta6E5kcMLB0UYGTgrZ8nL5bvrbGmtEcEObgMC/qRFhA3og/0Zh+eacrcA+0FBXJA==",
+ "path": "microsoft.win32.registry.accesscontrol/5.0.0",
+ "hashPath": "microsoft.win32.registry.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.Win32.SystemEvents/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Bh6blKG8VAKvXiLe2L+sEsn62nc1Ij34MrNxepD2OCrS5cpCwQa9MeLyhVQPQ/R4Wlzwuy6wMK8hLb11QPDRsQ==",
+ "path": "microsoft.win32.systemevents/5.0.0",
+ "hashPath": "microsoft.win32.systemevents.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.WSMan.Management/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-noQxoEaJW5W4vbRfwIB1l+ecERA+K4ZygZBv1YNu0IwdDos0mIiPY+YpFKz2uHyeNSk1Z3j1fsXV0b/r+eRT1Q==",
+ "path": "microsoft.wsman.management/7.1.0",
+ "hashPath": "microsoft.wsman.management.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.WSMan.Runtime/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-DVtFU3QQ12w5ej86Gw/vNtJjCXPd7r9fLJs9tzYqptEO6WtJX+vH65qPacP0DN/LEuc+93+iRVfNjjf/EMuNBQ==",
+ "path": "microsoft.wsman.runtime/7.1.0",
+ "hashPath": "microsoft.wsman.runtime.7.1.0.nupkg.sha512"
+ },
+ "Namotion.Reflection/1.0.14": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-wuJGiFvGfehH2w7jAhMbCJt0/rvUuHyqSZn0sMhNTviDfBZRyX8LFlR/ndQcofkGWulPDfH5nKYTeGXE8xBHPA==",
+ "path": "namotion.reflection/1.0.14",
+ "hashPath": "namotion.reflection.1.0.14.nupkg.sha512"
+ },
+ "Newtonsoft.Json/12.0.3": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==",
+ "path": "newtonsoft.json/12.0.3",
+ "hashPath": "newtonsoft.json.12.0.3.nupkg.sha512"
+ },
+ "NJsonSchema/10.2.2": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-s6oNUrjw5Ix5WVkYdU0vgyzoutZdi7p+uQqTGYa3QbLtjDYrkD4ahfGnfyCpHNoJUXun9pHKGy6AD0LJNcSgjQ==",
+ "path": "njsonschema/10.2.2",
+ "hashPath": "njsonschema.10.2.2.nupkg.sha512"
+ },
+ "runtime.any.System.Collections/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-23g6rqftKmovn2cLeGsuHUYm0FD7pdutb0uQMJpZ3qTvq+zHkgmt6J65VtRry4WDGYlmkMa4xDACtaQ94alNag==",
+ "path": "runtime.any.system.collections/4.3.0",
+ "hashPath": "runtime.any.system.collections.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Globalization/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-sMDBnad4rp4t7GY442Jux0MCUuKL4otn5BK6Ni0ARTXTSpRNBzZ7hpMfKSvnVSED5kYJm96YOWsqV0JH0d2uuw==",
+ "path": "runtime.any.system.globalization/4.3.0",
+ "hashPath": "runtime.any.system.globalization.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.IO/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SDZ5AD1DtyRoxYtEcqQ3HDlcrorMYXZeCt7ZhG9US9I5Vva+gpIWDGMkcwa5XiKL0ceQKRZIX2x0XEjLX7PDzQ==",
+ "path": "runtime.any.system.io/4.3.0",
+ "hashPath": "runtime.any.system.io.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Reflection/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-hLC3A3rI8jipR5d9k7+f0MgRCW6texsAp0MWkN/ci18FMtQ9KH7E2vDn/DH2LkxsszlpJpOn9qy6Z6/69rH6eQ==",
+ "path": "runtime.any.system.reflection/4.3.0",
+ "hashPath": "runtime.any.system.reflection.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Reflection.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-cPhT+Vqu52+cQQrDai/V91gubXUnDKNRvlBnH+hOgtGyHdC17aQIU64EaehwAQymd7kJA5rSrVRNfDYrbhnzyA==",
+ "path": "runtime.any.system.reflection.extensions/4.3.0",
+ "hashPath": "runtime.any.system.reflection.extensions.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Reflection.Primitives/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Nrm1p3armp6TTf2xuvaa+jGTTmncALWFq22CpmwRvhDf6dE9ZmH40EbOswD4GnFLrMRS0Ki6Kx5aUPmKK/hZBg==",
+ "path": "runtime.any.system.reflection.primitives/4.3.0",
+ "hashPath": "runtime.any.system.reflection.primitives.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Resources.ResourceManager/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Lxb89SMvf8w9p9+keBLyL6H6x/TEmc6QVsIIA0T36IuyOY3kNvIdyGddA2qt35cRamzxF8K5p0Opq4G4HjNbhQ==",
+ "path": "runtime.any.system.resources.resourcemanager/4.3.0",
+ "hashPath": "runtime.any.system.resources.resourcemanager.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Runtime/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-fRS7zJgaG9NkifaAxGGclDDoRn9HC7hXACl52Or06a/fxdzDajWb5wov3c6a+gVSlekRoexfjwQSK9sh5um5LQ==",
+ "path": "runtime.any.system.runtime/4.3.0",
+ "hashPath": "runtime.any.system.runtime.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Runtime.Handles/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-GG84X6vufoEzqx8PbeBKheE4srOhimv+yLtGb/JkR3Y2FmoqmueLNFU4Xx8Y67plFpltQSdK74x0qlEhIpv/CQ==",
+ "path": "runtime.any.system.runtime.handles/4.3.0",
+ "hashPath": "runtime.any.system.runtime.handles.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Runtime.InteropServices/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-lBoFeQfxe/4eqjPi46E0LU/YaCMdNkQ8B4MZu/mkzdIAZh8RQ1NYZSj0egrQKdgdvlPFtP4STtob40r4o2DBAw==",
+ "path": "runtime.any.system.runtime.interopservices/4.3.0",
+ "hashPath": "runtime.any.system.runtime.interopservices.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Text.Encoding/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-+ihI5VaXFCMVPJNstG4O4eo1CfbrByLxRrQQTqOTp1ttK0kUKDqOdBSTaCB2IBk/QtjDrs6+x4xuezyMXdm0HQ==",
+ "path": "runtime.any.system.text.encoding/4.3.0",
+ "hashPath": "runtime.any.system.text.encoding.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Threading.Tasks/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-OhBAVBQG5kFj1S+hCEQ3TUHBAEtZ3fbEMgZMRNdN8A0Pj4x+5nTELEqL59DU0TjKVE6II3dqKw4Dklb3szT65w==",
+ "path": "runtime.any.system.threading.tasks/4.3.0",
+ "hashPath": "runtime.any.system.threading.tasks.4.3.0.nupkg.sha512"
+ },
+ "runtime.win.System.Diagnostics.Debug/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-hHHP0WCStene2jjeYcuDkETozUYF/3sHVRHAEOgS3L15hlip24ssqCTnJC28Z03Wpo078oMcJd0H4egD2aJI8g==",
+ "path": "runtime.win.system.diagnostics.debug/4.3.0",
+ "hashPath": "runtime.win.system.diagnostics.debug.4.3.0.nupkg.sha512"
+ },
+ "runtime.win.System.Runtime.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-RkgHVhUPvzZxuUubiZe8yr/6CypRVXj0VBzaR8hsqQ8f+rUo7e4PWrHTLOCjd8fBMGWCrY//fi7Ku3qXD7oHRw==",
+ "path": "runtime.win.system.runtime.extensions/4.3.0",
+ "hashPath": "runtime.win.system.runtime.extensions.4.3.0.nupkg.sha512"
+ },
+ "runtime.win7.System.Private.Uri/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Q+IBgaPYicSQs2tBlmXqbS25c/JLIthWrgrpMwxKSOobW/OqIMVFruUGfuaz4QABVzV8iKdCAbN7APY7Tclbnw==",
+ "path": "runtime.win7.system.private.uri/4.3.0",
+ "hashPath": "runtime.win7.system.private.uri.4.3.0.nupkg.sha512"
+ },
+ "System.CodeDom/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ==",
+ "path": "system.codedom/5.0.0",
+ "hashPath": "system.codedom.5.0.0.nupkg.sha512"
+ },
+ "System.Collections/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==",
+ "path": "system.collections/4.3.0",
+ "hashPath": "system.collections.4.3.0.nupkg.sha512"
+ },
+ "System.Collections.Immutable/1.5.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==",
+ "path": "system.collections.immutable/1.5.0",
+ "hashPath": "system.collections.immutable.1.5.0.nupkg.sha512"
+ },
+ "System.Configuration.ConfigurationManager/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-aM7cbfEfVNlEEOj3DsZP+2g9NRwbkyiAv2isQEzw7pnkDg9ekCU2m1cdJLM02Uq691OaCS91tooaxcEn8d0q5w==",
+ "path": "system.configuration.configurationmanager/5.0.0",
+ "hashPath": "system.configuration.configurationmanager.5.0.0.nupkg.sha512"
+ },
+ "System.Diagnostics.Debug/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==",
+ "path": "system.diagnostics.debug/4.3.0",
+ "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512"
+ },
+ "System.Diagnostics.DiagnosticSource/4.6.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==",
+ "path": "system.diagnostics.diagnosticsource/4.6.0",
+ "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512"
+ },
+ "System.Diagnostics.EventLog/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-FHkCwUfsTs+/5tsK+c0egLfacUgbhvcwi3wUFWSEEArSXao343mYqcpOVVFMlcCkdNtjU4YwAWaKYwal6f02og==",
+ "path": "system.diagnostics.eventlog/5.0.0",
+ "hashPath": "system.diagnostics.eventlog.5.0.0.nupkg.sha512"
+ },
+ "System.DirectoryServices/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-lAS54Y3KO1XV68akGa0/GJeddkkuuiv2CtcSkMiTmLHQ6o6kFbKpw4DmJZADF7a6KjPwYxmZnH4D3eGicrJdcg==",
+ "path": "system.directoryservices/5.0.0",
+ "hashPath": "system.directoryservices.5.0.0.nupkg.sha512"
+ },
+ "System.Drawing.Common/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SztFwAnpfKC8+sEKXAFxCBWhKQaEd97EiOL7oZJZP56zbqnLpmxACWA8aGseaUExciuEAUuR9dY8f7HkTRAdnw==",
+ "path": "system.drawing.common/5.0.0",
+ "hashPath": "system.drawing.common.5.0.0.nupkg.sha512"
+ },
+ "System.Dynamic.Runtime/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==",
+ "path": "system.dynamic.runtime/4.3.0",
+ "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512"
+ },
+ "System.Formats.Asn1/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==",
+ "path": "system.formats.asn1/5.0.0",
+ "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512"
+ },
+ "System.Globalization/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==",
+ "path": "system.globalization/4.3.0",
+ "hashPath": "system.globalization.4.3.0.nupkg.sha512"
+ },
+ "System.IO/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==",
+ "path": "system.io/4.3.0",
+ "hashPath": "system.io.4.3.0.nupkg.sha512"
+ },
+ "System.IO.FileSystem.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==",
+ "path": "system.io.filesystem.accesscontrol/5.0.0",
+ "hashPath": "system.io.filesystem.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "System.Linq/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==",
+ "path": "system.linq/4.3.0",
+ "hashPath": "system.linq.4.3.0.nupkg.sha512"
+ },
+ "System.Linq.Expressions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==",
+ "path": "system.linq.expressions/4.3.0",
+ "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512"
+ },
+ "System.Management/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==",
+ "path": "system.management/5.0.0",
+ "hashPath": "system.management.5.0.0.nupkg.sha512"
+ },
+ "System.Management.Automation/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-WjmMs8kNETGWUmbE2A87cTcAGRz0WJ24TOZm5xkhop/93fIINK8TEcghEr2I0mSgXb7t0pWkPdKdEA5vizFQPA==",
+ "path": "system.management.automation/7.1.0",
+ "hashPath": "system.management.automation.7.1.0.nupkg.sha512"
+ },
+ "System.Memory/4.5.4": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==",
+ "path": "system.memory/4.5.4",
+ "hashPath": "system.memory.4.5.4.nupkg.sha512"
+ },
+ "System.ObjectModel/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==",
+ "path": "system.objectmodel/4.3.0",
+ "hashPath": "system.objectmodel.4.3.0.nupkg.sha512"
+ },
+ "System.Private.Uri/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-I4SwANiUGho1esj4V4oSlPllXjzCZDE+5XXso2P03LW2vOda2Enzh8DWOxwN6hnrJyp314c7KuVu31QYhRzOGg==",
+ "path": "system.private.uri/4.3.0",
+ "hashPath": "system.private.uri.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==",
+ "path": "system.reflection/4.3.0",
+ "hashPath": "system.reflection.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Emit/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==",
+ "path": "system.reflection.emit/4.3.0",
+ "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Emit.ILGeneration/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==",
+ "path": "system.reflection.emit.ilgeneration/4.3.0",
+ "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Emit.Lightweight/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==",
+ "path": "system.reflection.emit.lightweight/4.3.0",
+ "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==",
+ "path": "system.reflection.extensions/4.3.0",
+ "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Metadata/1.6.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==",
+ "path": "system.reflection.metadata/1.6.0",
+ "hashPath": "system.reflection.metadata.1.6.0.nupkg.sha512"
+ },
+ "System.Reflection.Primitives/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==",
+ "path": "system.reflection.primitives/4.3.0",
+ "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.TypeExtensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==",
+ "path": "system.reflection.typeextensions/4.3.0",
+ "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512"
+ },
+ "System.Resources.ResourceManager/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==",
+ "path": "system.resources.resourcemanager/4.3.0",
+ "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==",
+ "path": "system.runtime/4.3.0",
+ "hashPath": "system.runtime.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime.CompilerServices.Unsafe/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==",
+ "path": "system.runtime.compilerservices.unsafe/5.0.0",
+ "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512"
+ },
+ "System.Runtime.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==",
+ "path": "system.runtime.extensions/4.3.0",
+ "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime.Handles/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==",
+ "path": "system.runtime.handles/4.3.0",
+ "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime.InteropServices/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==",
+ "path": "system.runtime.interopservices/4.3.0",
+ "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512"
+ },
+ "System.Security.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
+ "path": "system.security.accesscontrol/5.0.0",
+ "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Cryptography.Cng/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==",
+ "path": "system.security.cryptography.cng/5.0.0",
+ "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Cryptography.Pkcs/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-9TPLGjBCGKmNvG8pjwPeuYy0SMVmGZRwlTZvyPHDbYv/DRkoeumJdfumaaDNQzVGMEmbWtg07zUpSW9q70IlDQ==",
+ "path": "system.security.cryptography.pkcs/5.0.0",
+ "hashPath": "system.security.cryptography.pkcs.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Cryptography.ProtectedData/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-HGxMSAFAPLNoxBvSfW08vHde0F9uh7BjASwu6JF9JnXuEPhCY3YUqURn0+bQV/4UWeaqymmrHWV+Aw9riQCtCA==",
+ "path": "system.security.cryptography.protecteddata/5.0.0",
+ "hashPath": "system.security.cryptography.protecteddata.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Permissions/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-uE8juAhEkp7KDBCdjDIE3H9R1HJuEHqeqX8nLX9gmYKWwsqk3T5qZlPx8qle5DPKimC/Fy3AFTdV7HamgCh9qQ==",
+ "path": "system.security.permissions/5.0.0",
+ "hashPath": "system.security.permissions.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Principal.Windows/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
+ "path": "system.security.principal.windows/5.0.0",
+ "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512"
+ },
+ "System.ServiceProcess.ServiceController/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-p2yX167GW1pr2DCR6cW+cBKrvhli4thckXk108faFaTPHnoudb0AYPcIPq3nmrwn7IQj9FEmjpyJlXzcOmIjjw==",
+ "path": "system.serviceprocess.servicecontroller/5.0.0",
+ "hashPath": "system.serviceprocess.servicecontroller.5.0.0.nupkg.sha512"
+ },
+ "System.Text.Encoding/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==",
+ "path": "system.text.encoding/4.3.0",
+ "hashPath": "system.text.encoding.4.3.0.nupkg.sha512"
+ },
+ "System.Text.Encoding.CodePages/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-NyscU59xX6Uo91qvhOs2Ccho3AR2TnZPomo1Z0K6YpyztBPM/A5VbkzOO19sy3A3i1TtEnTxA7bCe3Us+r5MWg==",
+ "path": "system.text.encoding.codepages/5.0.0",
+ "hashPath": "system.text.encoding.codepages.5.0.0.nupkg.sha512"
+ },
+ "System.Threading/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==",
+ "path": "system.threading/4.3.0",
+ "hashPath": "system.threading.4.3.0.nupkg.sha512"
+ },
+ "System.Threading.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-WJ9w9m4iHJVq0VoH7hZvYAccbRq95itYRhAAXd6M4kVCzLmT6NqTwmSXKwp3oQilWHhYTXgqaIXxBfg8YaqtmA==",
+ "path": "system.threading.accesscontrol/5.0.0",
+ "hashPath": "system.threading.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "System.Threading.Tasks/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==",
+ "path": "system.threading.tasks/4.3.0",
+ "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512"
+ },
+ "System.Threading.Tasks.Extensions/4.5.3": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==",
+ "path": "system.threading.tasks.extensions/4.5.3",
+ "hashPath": "system.threading.tasks.extensions.4.5.3.nupkg.sha512"
+ },
+ "System.Windows.Extensions/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-c1ho9WU9ZxMZawML+ssPKZfdnrg/OjR3pe0m9v8230z3acqphwvPJqzAkH54xRYm5ntZHGG1EPP3sux9H3qSPg==",
+ "path": "system.windows.extensions/5.0.0",
+ "hashPath": "system.windows.extensions.5.0.0.nupkg.sha512"
+ }
+ },
+ "runtimes": {
+ "win10-x64": [
+ "win10",
+ "win81-x64",
+ "win81",
+ "win8-x64",
+ "win8",
+ "win7-x64",
+ "win7",
+ "win-x64",
+ "win",
+ "any",
+ "base"
+ ],
+ "win10-x64-aot": [
+ "win10-aot",
+ "win10-x64",
+ "win10",
+ "win81-x64-aot",
+ "win81-aot",
+ "win81-x64",
+ "win81",
+ "win8-x64-aot",
+ "win8-aot",
+ "win8-x64",
+ "win8",
+ "win7-x64-aot",
+ "win7-aot",
+ "win7-x64",
+ "win7",
+ "win-x64-aot",
+ "win-aot",
+ "win-x64",
+ "win",
+ "aot",
+ "any",
+ "base"
+ ]
+ }
+} \ No newline at end of file
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll
new file mode 100644
index 0000000000..9ada03f00f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll
new file mode 100644
index 0000000000..7d8d5afcd3
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll
new file mode 100644
index 0000000000..b63f889771
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll
new file mode 100644
index 0000000000..96fa29deea
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll
new file mode 100644
index 0000000000..1dc32290ac
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll
new file mode 100644
index 0000000000..6af4347c1d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll
new file mode 100644
index 0000000000..fd06cf702f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll
new file mode 100644
index 0000000000..bf973055a5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll
new file mode 100644
index 0000000000..52a95e4526
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll
new file mode 100644
index 0000000000..d33a2ffd25
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll
new file mode 100644
index 0000000000..5644be0dfd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll
new file mode 100644
index 0000000000..98e3049e20
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dll
new file mode 100644
index 0000000000..934802f5c2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll
new file mode 100644
index 0000000000..990f4b057b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dll
new file mode 100644
index 0000000000..b5aa0c4cd3
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dll
new file mode 100644
index 0000000000..36ecf91055
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dll
new file mode 100644
index 0000000000..8cbfb13909
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll
new file mode 100644
index 0000000000..b501fb6a29
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dll
new file mode 100644
index 0000000000..61939347a6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll
new file mode 100644
index 0000000000..f81811110f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll
new file mode 100644
index 0000000000..9c954491b6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dll
new file mode 100644
index 0000000000..873495d3bd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll
new file mode 100644
index 0000000000..8e151864d0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll
new file mode 100644
index 0000000000..3681784cd9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll
new file mode 100644
index 0000000000..55193843db
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll
new file mode 100644
index 0000000000..5c6823f5c2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll
new file mode 100644
index 0000000000..d2d620e0cd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll
new file mode 100644
index 0000000000..710e80bef0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll
new file mode 100644
index 0000000000..acf9bcc273
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll
new file mode 100644
index 0000000000..e3e976dfa8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll
new file mode 100644
index 0000000000..9e3165a748
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll
new file mode 100644
index 0000000000..666295ff6b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll
new file mode 100644
index 0000000000..d2e8f92286
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dll
new file mode 100644
index 0000000000..1644e5d6d6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll
new file mode 100644
index 0000000000..d0287ad5b7
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll
new file mode 100644
index 0000000000..ea4ce56f07
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll
new file mode 100644
index 0000000000..032abb8207
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll
new file mode 100644
index 0000000000..07d640324b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll
new file mode 100644
index 0000000000..03158d5e3d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll
new file mode 100644
index 0000000000..a89797b701
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll
new file mode 100644
index 0000000000..e1229986d2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll
new file mode 100644
index 0000000000..044d000167
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll
new file mode 100644
index 0000000000..666679b5f8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll
new file mode 100644
index 0000000000..bb76446a5e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll
new file mode 100644
index 0000000000..7f834d498d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll
new file mode 100644
index 0000000000..32299e23a3
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll
new file mode 100644
index 0000000000..1d96415e59
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll
new file mode 100644
index 0000000000..e797b5fd8e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll
new file mode 100644
index 0000000000..092ad2ccf2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll
new file mode 100644
index 0000000000..de6cf08e2b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll
new file mode 100644
index 0000000000..da993d1a04
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dll
new file mode 100644
index 0000000000..e43577d592
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll
new file mode 100644
index 0000000000..87fe0ae8bb
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll
new file mode 100644
index 0000000000..35286a516c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll
new file mode 100644
index 0000000000..a21e8cc76b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll
new file mode 100644
index 0000000000..275fa6d994
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll
new file mode 100644
index 0000000000..650e9bb3e6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll
new file mode 100644
index 0000000000..6f2e9eefcd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll
new file mode 100644
index 0000000000..634eb7b297
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll
new file mode 100644
index 0000000000..517afce5c2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll
new file mode 100644
index 0000000000..fc19d7815a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll
new file mode 100644
index 0000000000..843262414d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll
new file mode 100644
index 0000000000..72ef4b77af
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll
new file mode 100644
index 0000000000..dc745f66f6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll
new file mode 100644
index 0000000000..327874faaa
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll
new file mode 100644
index 0000000000..f54b160fd1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll
new file mode 100644
index 0000000000..3b56126a89
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll
new file mode 100644
index 0000000000..15e01a461f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll
new file mode 100644
index 0000000000..caf3778f8b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll
new file mode 100644
index 0000000000..c121ec29b7
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll
new file mode 100644
index 0000000000..52baaf84af
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll
new file mode 100644
index 0000000000..94913a4021
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll
new file mode 100644
index 0000000000..02388213c6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll
new file mode 100644
index 0000000000..d212f76efe
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll
new file mode 100644
index 0000000000..01351ea53f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll
new file mode 100644
index 0000000000..3bcbdf86d2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll
new file mode 100644
index 0000000000..2f9ba0dd89
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll
new file mode 100644
index 0000000000..8a21ca83ad
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll
new file mode 100644
index 0000000000..18d0639ae9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll
new file mode 100644
index 0000000000..aa3f0fccb5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.dll
new file mode 100644
index 0000000000..a3a1f45197
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll
new file mode 100644
index 0000000000..77d2cdda43
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll
new file mode 100644
index 0000000000..7da87e3740
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll
new file mode 100644
index 0000000000..e4393e6752
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll
new file mode 100644
index 0000000000..636963cac0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll
new file mode 100644
index 0000000000..9509f21237
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll
new file mode 100644
index 0000000000..29188f8f9a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll
new file mode 100644
index 0000000000..326355dabf
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll
new file mode 100644
index 0000000000..328bc5f46e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll
new file mode 100644
index 0000000000..d8e5c3a5d6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll
new file mode 100644
index 0000000000..37c48e1e8c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll
new file mode 100644
index 0000000000..a2871b03c4
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll
new file mode 100644
index 0000000000..fd0a20b76a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll
new file mode 100644
index 0000000000..0ac5ac2d0d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll
new file mode 100644
index 0000000000..04a01f819b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll
new file mode 100644
index 0000000000..6d21c31724
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll
new file mode 100644
index 0000000000..0938326a2a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll
new file mode 100644
index 0000000000..911e8133df
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll
new file mode 100644
index 0000000000..5856ef1860
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll
new file mode 100644
index 0000000000..f4a8e21c93
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll
new file mode 100644
index 0000000000..64e386ab2e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll
new file mode 100644
index 0000000000..acb7768759
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll
new file mode 100644
index 0000000000..82232ac154
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll
new file mode 100644
index 0000000000..04beba2523
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll
new file mode 100644
index 0000000000..e94210ef1b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll
new file mode 100644
index 0000000000..d9c687bcc9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll
new file mode 100644
index 0000000000..1f9e6df91a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll
new file mode 100644
index 0000000000..82bc088c3c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll
new file mode 100644
index 0000000000..a12ad00d9b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll
new file mode 100644
index 0000000000..d3ee172b1d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll
new file mode 100644
index 0000000000..11cf232098
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll
new file mode 100644
index 0000000000..547b51da9b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll
new file mode 100644
index 0000000000..97649b05d8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll
new file mode 100644
index 0000000000..aa05364448
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll
new file mode 100644
index 0000000000..ab69e12842
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll
new file mode 100644
index 0000000000..a9cf60b6db
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll
new file mode 100644
index 0000000000..73950b85bd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll
new file mode 100644
index 0000000000..2f8858f663
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll
new file mode 100644
index 0000000000..c6d291ba30
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll
new file mode 100644
index 0000000000..c40c10f8a6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll
new file mode 100644
index 0000000000..6795902430
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll
new file mode 100644
index 0000000000..bc71ada005
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll
new file mode 100644
index 0000000000..2bd8e0d741
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll
new file mode 100644
index 0000000000..d727c910ca
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll
new file mode 100644
index 0000000000..a03b1a6f1d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll
new file mode 100644
index 0000000000..837a99c035
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll
new file mode 100644
index 0000000000..37df042a74
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll
new file mode 100644
index 0000000000..e715c212cd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll
new file mode 100644
index 0000000000..25380f2ed1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll
new file mode 100644
index 0000000000..0ea2110aae
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll
new file mode 100644
index 0000000000..ed7c938cac
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll
new file mode 100644
index 0000000000..84a3e36faf
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll
new file mode 100644
index 0000000000..319c0d5944
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll
new file mode 100644
index 0000000000..290b36ab27
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll
new file mode 100644
index 0000000000..12bee9bb6e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll
new file mode 100644
index 0000000000..0a7b19a8d7
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll
new file mode 100644
index 0000000000..c206ec806e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll
new file mode 100644
index 0000000000..65323a1662
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll
new file mode 100644
index 0000000000..295838d658
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll
new file mode 100644
index 0000000000..0d0c3ae91d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll
new file mode 100644
index 0000000000..d3ab8e17c9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll
new file mode 100644
index 0000000000..1e5067d955
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll
new file mode 100644
index 0000000000..252b80c246
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll
new file mode 100644
index 0000000000..23f957e836
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dll
new file mode 100644
index 0000000000..99215bb1df
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll
new file mode 100644
index 0000000000..b91dc9c114
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dll
new file mode 100644
index 0000000000..b380d0856e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll
new file mode 100644
index 0000000000..a6353d473c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll
new file mode 100644
index 0000000000..44ef9ee6ee
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll
new file mode 100644
index 0000000000..92c09d098c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll
new file mode 100644
index 0000000000..e958ac5c9c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll
new file mode 100644
index 0000000000..0fcea369c1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dll
new file mode 100644
index 0000000000..9074d56d58
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll
new file mode 100644
index 0000000000..a8a70761fb
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll
new file mode 100644
index 0000000000..9fbf6011d0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll
new file mode 100644
index 0000000000..373a39f93b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll
new file mode 100644
index 0000000000..9b7a4c0eac
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll
new file mode 100644
index 0000000000..b200a7b437
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll
new file mode 100644
index 0000000000..c7b337a6c2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll
new file mode 100644
index 0000000000..7faf7c1d55
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dll
new file mode 100644
index 0000000000..49d43249f0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll
new file mode 100644
index 0000000000..1959e050e9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll
new file mode 100644
index 0000000000..9c19e78ac5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll
new file mode 100644
index 0000000000..54983b20df
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll
new file mode 100644
index 0000000000..91e7719fb7
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll
new file mode 100644
index 0000000000..45651b24a8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll
new file mode 100644
index 0000000000..bc84d5a36c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll
new file mode 100644
index 0000000000..f4e3352ab3
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll
new file mode 100644
index 0000000000..697af93c2c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll
new file mode 100644
index 0000000000..d1ba57bf67
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll
new file mode 100644
index 0000000000..134e38ecdb
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll
new file mode 100644
index 0000000000..b207cd0417
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll
new file mode 100644
index 0000000000..3cc5173a0a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll
new file mode 100644
index 0000000000..c21dd6c06b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll
new file mode 100644
index 0000000000..ced26d15f1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll
new file mode 100644
index 0000000000..a9c50e5a10
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dll
new file mode 100644
index 0000000000..ab82e8395a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll
new file mode 100644
index 0000000000..b11be78695
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll
new file mode 100644
index 0000000000..bcd2122844
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll
new file mode 100644
index 0000000000..83a00174e7
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll
new file mode 100644
index 0000000000..5497f03eff
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll
new file mode 100644
index 0000000000..f643007fe0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll
new file mode 100644
index 0000000000..f371876149
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll
new file mode 100644
index 0000000000..03e3fb685d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll
new file mode 100644
index 0000000000..2d0f5d884c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll
new file mode 100644
index 0000000000..80e5f69e35
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll
new file mode 100644
index 0000000000..52a37de8d6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dll
new file mode 100644
index 0000000000..6f8837770d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll
new file mode 100644
index 0000000000..84d7856f8b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dll
new file mode 100644
index 0000000000..779c378e98
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dll
new file mode 100644
index 0000000000..dd5a2cf1ac
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dll
new file mode 100644
index 0000000000..d3876f9c68
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dll
new file mode 100644
index 0000000000..9a311a06ee
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dll
new file mode 100644
index 0000000000..9c1cdb24e2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dll
new file mode 100644
index 0000000000..97189f2494
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dll
new file mode 100644
index 0000000000..f85edc04fc
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dll
new file mode 100644
index 0000000000..d4c53a90a8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dll
new file mode 100644
index 0000000000..128fa35e4d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dll
new file mode 100644
index 0000000000..bd1a637721
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dll
new file mode 100644
index 0000000000..4e5a595be2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dll
new file mode 100644
index 0000000000..16b450ac85
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dll
new file mode 100644
index 0000000000..0b162ee0f1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dll
new file mode 100644
index 0000000000..c790187d65
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dll
new file mode 100644
index 0000000000..0d8aa9b209
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dll
new file mode 100644
index 0000000000..efaf87cee0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dll
new file mode 100644
index 0000000000..a95cd5b172
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dll
new file mode 100644
index 0000000000..4a9af92c83
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dll
new file mode 100644
index 0000000000..fb6733b074
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dll
new file mode 100644
index 0000000000..4f7d5e27c4
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dll
new file mode 100644
index 0000000000..11d95be913
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dll
new file mode 100644
index 0000000000..6a55ee74f3
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dll
new file mode 100644
index 0000000000..9fed7ef08c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dll
new file mode 100644
index 0000000000..1c9ac4ca96
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dll
new file mode 100644
index 0000000000..3516fec483
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dll
new file mode 100644
index 0000000000..c3ab5763f4
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dll
new file mode 100644
index 0000000000..d503f25196
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dll
new file mode 100644
index 0000000000..d3fbc883e2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dll
new file mode 100644
index 0000000000..d67a4264b0
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dll
new file mode 100644
index 0000000000..51e6ccd72e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dll
new file mode 100644
index 0000000000..a7b06ae008
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dll
new file mode 100644
index 0000000000..46f9aac028
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dll
new file mode 100644
index 0000000000..b90fdd77cf
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dll
new file mode 100644
index 0000000000..d40d70010e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dll
new file mode 100644
index 0000000000..d9ac672f8f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dll
new file mode 100644
index 0000000000..39141736ce
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dll
new file mode 100644
index 0000000000..83488ea089
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dll
new file mode 100644
index 0000000000..d18b79b28e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dll
new file mode 100644
index 0000000000..639610b3c9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dll
new file mode 100644
index 0000000000..ba595515cd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dll
new file mode 100644
index 0000000000..2b4e367d00
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll
new file mode 100644
index 0000000000..c900f4a816
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll
new file mode 100644
index 0000000000..a3c8dfb053
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll
new file mode 100644
index 0000000000..c1494a2c55
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll
new file mode 100644
index 0000000000..7f113519cd
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exe b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exe
new file mode 100644
index 0000000000..c66264ad34
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exe
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..4b72058de6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..43acdf3d4c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll
new file mode 100644
index 0000000000..3569641c9c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..55d6b391fa
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..698f08e5e2
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..e770ccc2e8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..62e2e9a98b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..f605e75a4d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..a5aec6aa4e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll
new file mode 100644
index 0000000000..7595b4cd83
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll
new file mode 100644
index 0000000000..87ce55dbe9
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..5aedc4b83b
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..0ecca4c37d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..2437ed9332
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..0b985d837c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..c908377e1f
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..bdb9eb5248
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mi.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mi.dll
new file mode 100644
index 0000000000..f169cbe4b8
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mi.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/miutils.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/miutils.dll
new file mode 100644
index 0000000000..f9c9d3f2e7
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/miutils.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll
new file mode 100644
index 0000000000..65e8b8da0e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll
new file mode 100644
index 0000000000..257792282e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll
new file mode 100644
index 0000000000..cae3ce0bb5
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll
new file mode 100644
index 0000000000..482261960c
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll
new file mode 100644
index 0000000000..f75271c522
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll
new file mode 100644
index 0000000000..4166bf4d61
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..8f2b775300
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..b287bd94de
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..4c64afcfda
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..10a885e034
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dll
new file mode 100644
index 0000000000..f7368e471a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..2b8db7b639
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..cb414f7bb6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..87c1ca2c76
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..5b1ff67570
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dll
new file mode 100644
index 0000000000..5109f1d7f1
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..8b19e6492a
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..32204d4633
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..2acfeed16e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..57283cf4f6
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/vccorlib140.dll b/distro/ruby_bin_folder/AMD64/vccorlib140.dll
new file mode 100644
index 0000000000..bd5e97837d
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/vccorlib140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/vcruntime140.dll b/distro/ruby_bin_folder/AMD64/vcruntime140.dll
new file mode 100644
index 0000000000..e6f0a40170
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/vcruntime140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/vcruntime140_1.dll b/distro/ruby_bin_folder/AMD64/vcruntime140_1.dll
new file mode 100644
index 0000000000..a46461a37e
--- /dev/null
+++ b/distro/ruby_bin_folder/AMD64/vcruntime140_1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/Chef.PowerShell.Wrapper.dll b/distro/ruby_bin_folder/Chef.PowerShell.Wrapper.dll
deleted file mode 100644
index bdf9ef4125..0000000000
--- a/distro/ruby_bin_folder/Chef.PowerShell.Wrapper.dll
+++ /dev/null
Binary files differ
diff --git a/distro/ruby_bin_folder/Chef.PowerShell.dll b/distro/ruby_bin_folder/Chef.PowerShell.dll
deleted file mode 100644
index 568f9f43cd..0000000000
--- a/distro/ruby_bin_folder/Chef.PowerShell.dll
+++ /dev/null
Binary files differ
diff --git a/distro/ruby_bin_folder/msvcp140.dll b/distro/ruby_bin_folder/msvcp140.dll
deleted file mode 100644
index 8050a8838b..0000000000
--- a/distro/ruby_bin_folder/msvcp140.dll
+++ /dev/null
Binary files differ
diff --git a/distro/ruby_bin_folder/vcruntime140.dll b/distro/ruby_bin_folder/vcruntime140.dll
deleted file mode 100644
index ddd0db4f9e..0000000000
--- a/distro/ruby_bin_folder/vcruntime140.dll
+++ /dev/null
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/Chef.PowerShell.dll b/distro/ruby_bin_folder/x86/Chef.PowerShell.dll
new file mode 100644
index 0000000000..8a528ad226
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/Chef.PowerShell.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll b/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll
new file mode 100644
index 0000000000..203d243b37
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/Ijwhost.dll b/distro/ruby_bin_folder/x86/Ijwhost.dll
new file mode 100644
index 0000000000..333cb4dcd8
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/Ijwhost.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/Newtonsoft.Json.dll b/distro/ruby_bin_folder/x86/Newtonsoft.Json.dll
new file mode 100644
index 0000000000..1971a35679
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/Newtonsoft.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/concrt140.dll b/distro/ruby_bin_folder/x86/concrt140.dll
new file mode 100644
index 0000000000..1d75093197
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/concrt140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/host/fxr/5.0.0/hostfxr.dll b/distro/ruby_bin_folder/x86/host/fxr/5.0.0/hostfxr.dll
new file mode 100644
index 0000000000..9074a6c2a1
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/host/fxr/5.0.0/hostfxr.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140.dll b/distro/ruby_bin_folder/x86/msvcp140.dll
new file mode 100644
index 0000000000..76529d554a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/msvcp140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_1.dll b/distro/ruby_bin_folder/x86/msvcp140_1.dll
new file mode 100644
index 0000000000..4dfe3ee783
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/msvcp140_1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_2.dll b/distro/ruby_bin_folder/x86/msvcp140_2.dll
new file mode 100644
index 0000000000..8f251b32cc
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/msvcp140_2.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll b/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll
new file mode 100644
index 0000000000..4c758375f7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll b/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll
new file mode 100644
index 0000000000..efa73e134b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/API-MS-Win-core-xstate-l2-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/API-MS-Win-core-xstate-l2-1-0.dll
new file mode 100644
index 0000000000..7c9413ee34
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/API-MS-Win-core-xstate-l2-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll
new file mode 100644
index 0000000000..879df9ab6e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll
new file mode 100644
index 0000000000..ff50126c80
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb
new file mode 100644
index 0000000000..5c979f1750
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json
new file mode 100644
index 0000000000..9d0500cd16
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Wrapper.Core.runtimeconfig.json
@@ -0,0 +1,9 @@
+{
+ "runtimeOptions": {
+ "tfm": "net5.0",
+ "framework": {
+ "name": "Microsoft.NETCore.App",
+ "version": "5.0.0"
+ }
+ }
+} \ No newline at end of file
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll
new file mode 100644
index 0000000000..333cb4dcd8
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dll
new file mode 100644
index 0000000000..2a70d37424
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Markdig.Signed.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dll
new file mode 100644
index 0000000000..f1d216624a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.ApplicationInsights.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll
new file mode 100644
index 0000000000..a00c560168
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dll
new file mode 100644
index 0000000000..8b6f598975
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.CSharp.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dll
new file mode 100644
index 0000000000..bfdf0b004b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CodeAnalysis.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.x86.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.x86.dll
new file mode 100644
index 0000000000..5ebef7fe29
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.DiaSymReader.Native.x86.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
new file mode 100644
index 0000000000..434e1f4130
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dll
new file mode 100644
index 0000000000..e1819d5fe4
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.Native.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dll
new file mode 100644
index 0000000000..13d9f3b430
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Management.Infrastructure.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json
new file mode 100644
index 0000000000..08ea0aaff0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json
@@ -0,0 +1,2579 @@
+{
+ "runtimeTarget": {
+ "name": ".NETCoreApp,Version=v5.0/win10-x86",
+ "signature": ""
+ },
+ "compilationOptions": {},
+ "targets": {
+ ".NETCoreApp,Version=v5.0": {},
+ ".NETCoreApp,Version=v5.0/win10-x86": {
+ "Chef.Powershell.Core/1.0.0": {
+ "dependencies": {
+ "Microsoft.PowerShell.Commands.Diagnostics": "7.1.0",
+ "Microsoft.PowerShell.Commands.Management": "7.1.0",
+ "Microsoft.PowerShell.Commands.Utility": "7.1.0",
+ "Microsoft.PowerShell.ConsoleHost": "7.1.0",
+ "Microsoft.WSMan.Management": "7.1.0",
+ "Microsoft.WSMan.Runtime": "7.1.0",
+ "Newtonsoft.Json": "12.0.3",
+ "System.Management.Automation": "7.1.0",
+ "runtimepack.Microsoft.NETCore.App.Runtime.win-x86": "5.0.0"
+ },
+ "runtime": {
+ "Chef.Powershell.Core.dll": {}
+ }
+ },
+ "runtimepack.Microsoft.NETCore.App.Runtime.win-x86/5.0.0": {
+ "runtime": {
+ "Microsoft.CSharp.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "Microsoft.VisualBasic.Core.dll": {
+ "assemblyVersion": "10.0.6.0",
+ "fileVersion": "11.0.20.51904"
+ },
+ "Microsoft.VisualBasic.dll": {
+ "assemblyVersion": "10.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "Microsoft.Win32.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "Microsoft.Win32.Registry.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.AppContext.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Buffers.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.Concurrent.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.Immutable.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.NonGeneric.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.Specialized.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Collections.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.Annotations.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.DataAnnotations.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.EventBasedAsync.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.TypeConverter.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ComponentModel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Configuration.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Console.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Core.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Data.Common.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Data.DataSetExtensions.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Data.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Contracts.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Debug.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.DiagnosticSource.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.FileVersionInfo.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Process.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.StackTrace.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.TextWriterTraceListener.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Tools.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.TraceSource.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Diagnostics.Tracing.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Drawing.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Drawing.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Dynamic.Runtime.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Formats.Asn1.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Globalization.Calendars.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Globalization.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Globalization.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.Brotli.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.FileSystem.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.ZipFile.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Compression.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.DriveInfo.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.Watcher.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.FileSystem.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.IsolatedStorage.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.MemoryMappedFiles.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Pipes.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.Pipes.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.UnmanagedMemoryStream.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.IO.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.Expressions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.Parallel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.Queryable.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Linq.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Memory.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Http.Json.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Http.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.HttpListener.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Mail.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.NameResolution.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.NetworkInformation.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Ping.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Requests.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Security.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.ServicePoint.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.Sockets.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebClient.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebHeaderCollection.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebProxy.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebSockets.Client.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.WebSockets.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Net.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Numerics.Vectors.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Numerics.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ObjectModel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.DataContractSerialization.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.Uri.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.Xml.Linq.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.Xml.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.DispatchProxy.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Emit.ILGeneration.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Emit.Lightweight.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Emit.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Metadata.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.TypeExtensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Reflection.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Resources.Reader.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Resources.ResourceManager.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Resources.Writer.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.CompilerServices.Unsafe.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.CompilerServices.VisualC.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Handles.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.InteropServices.RuntimeInformation.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.InteropServices.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Intrinsics.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Loader.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Numerics.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Formatters.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Json.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.Xml.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.Serialization.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Runtime.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Claims.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Algorithms.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Cng.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Csp.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Encoding.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.OpenSsl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.Primitives.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Cryptography.X509Certificates.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Principal.Windows.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.Principal.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.SecureString.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Security.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ServiceModel.Web.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ServiceProcess.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encoding.CodePages.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encoding.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encoding.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Encodings.Web.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.Json.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Text.RegularExpressions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Channels.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Overlapped.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.Dataflow.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.Parallel.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Tasks.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Thread.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.ThreadPool.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.Timer.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Threading.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Transactions.Local.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Transactions.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.ValueTuple.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Web.HttpUtility.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Web.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Windows.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.Linq.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.ReaderWriter.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.Serialization.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XDocument.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XPath.XDocument.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XPath.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XmlDocument.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.XmlSerializer.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Xml.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "WindowsBase.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscorlib.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "netstandard.dll": {
+ "assemblyVersion": "2.1.0.0",
+ "fileVersion": "5.0.20.51904"
+ },
+ "System.Private.CoreLib.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ },
+ "native": {
+ "API-MS-Win-core-xstate-l2-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "Microsoft.DiaSymReader.Native.x86.dll": {
+ "fileVersion": "14.12.25830.2"
+ },
+ "api-ms-win-core-console-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-console-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-datetime-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-debug-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-errorhandling-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-file-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-file-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-file-l2-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-handle-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-heap-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-interlocked-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-libraryloader-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-localization-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-memory-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-namedpipe-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-processenvironment-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-processthreads-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-processthreads-l1-1-1.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-profile-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-rtlsupport-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-string-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-synch-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-synch-l1-2-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-sysinfo-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-timezone-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-core-util-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-conio-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-convert-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-environment-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-filesystem-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-heap-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-locale-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-math-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-multibyte-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-private-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-process-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-runtime-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-stdio-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-string-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-time-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "api-ms-win-crt-utility-l1-1-0.dll": {
+ "fileVersion": "10.0.19041.1"
+ },
+ "clrcompression.dll": {
+ "fileVersion": "42.42.42.42424"
+ },
+ "clretwrc.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "clrjit.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "coreclr.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "createdump.exe": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "dbgshim.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "hostfxr.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "hostpolicy.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscordaccore.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscordaccore_x86_x86_5.0.20.51904.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscordbi.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "mscorrc.dll": {
+ "fileVersion": "5.0.20.51904"
+ },
+ "ucrtbase.dll": {
+ "fileVersion": "10.0.19041.1"
+ }
+ }
+ },
+ "Markdig.Signed/0.21.1": {
+ "runtime": {
+ "lib/netcoreapp3.1/Markdig.Signed.dll": {
+ "assemblyVersion": "0.21.1.0",
+ "fileVersion": "0.21.1.0"
+ }
+ }
+ },
+ "Microsoft.ApplicationInsights/2.15.0": {
+ "dependencies": {
+ "System.Diagnostics.DiagnosticSource": "4.6.0",
+ "System.Memory": "4.5.4"
+ },
+ "runtime": {
+ "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": {
+ "assemblyVersion": "2.15.0.44797",
+ "fileVersion": "2.15.0.44797"
+ }
+ }
+ },
+ "Microsoft.CodeAnalysis.Analyzers/3.0.0": {},
+ "Microsoft.CodeAnalysis.Common/3.7.0": {
+ "dependencies": {
+ "Microsoft.CodeAnalysis.Analyzers": "3.0.0",
+ "System.Collections.Immutable": "1.5.0",
+ "System.Memory": "4.5.4",
+ "System.Reflection.Metadata": "1.6.0",
+ "System.Runtime.CompilerServices.Unsafe": "5.0.0",
+ "System.Text.Encoding.CodePages": "5.0.0",
+ "System.Threading.Tasks.Extensions": "4.5.3"
+ },
+ "runtime": {
+ "lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": {
+ "assemblyVersion": "3.7.0.0",
+ "fileVersion": "3.700.20.37502"
+ }
+ },
+ "resources": {
+ "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "cs"
+ },
+ "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "de"
+ },
+ "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "es"
+ },
+ "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "fr"
+ },
+ "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "it"
+ },
+ "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "ja"
+ },
+ "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "ko"
+ },
+ "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "pl"
+ },
+ "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "pt-BR"
+ },
+ "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "ru"
+ },
+ "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "tr"
+ },
+ "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "zh-Hans"
+ },
+ "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
+ "locale": "zh-Hant"
+ }
+ }
+ },
+ "Microsoft.CodeAnalysis.CSharp/3.7.0": {
+ "dependencies": {
+ "Microsoft.CodeAnalysis.Common": "3.7.0"
+ },
+ "runtime": {
+ "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": {
+ "assemblyVersion": "3.7.0.0",
+ "fileVersion": "3.700.20.37502"
+ }
+ },
+ "resources": {
+ "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "cs"
+ },
+ "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "de"
+ },
+ "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "es"
+ },
+ "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "fr"
+ },
+ "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "it"
+ },
+ "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "ja"
+ },
+ "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "ko"
+ },
+ "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "pl"
+ },
+ "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "pt-BR"
+ },
+ "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "ru"
+ },
+ "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "tr"
+ },
+ "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "zh-Hans"
+ },
+ "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
+ "locale": "zh-Hant"
+ }
+ }
+ },
+ "Microsoft.CSharp/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Dynamic.Runtime": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.Linq.Expressions": "4.3.0",
+ "System.ObjectModel": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Extensions": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Reflection.TypeExtensions": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/Microsoft.CSharp.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "Microsoft.Management.Infrastructure/2.0.0": {
+ "dependencies": {
+ "Microsoft.Management.Infrastructure.Runtime.Unix": "2.0.0",
+ "Microsoft.Management.Infrastructure.Runtime.Win": "2.0.0"
+ }
+ },
+ "Microsoft.Management.Infrastructure.Runtime.Unix/2.0.0": {},
+ "Microsoft.Management.Infrastructure.Runtime.Win/2.0.0": {
+ "runtime": {
+ "runtimes/win10-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll": {
+ "assemblyVersion": "1.0.0.0",
+ "fileVersion": "10.0.18362.1"
+ },
+ "runtimes/win10-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll": {
+ "assemblyVersion": "1.0.0.0",
+ "fileVersion": "10.0.18362.1"
+ }
+ },
+ "native": {
+ "runtimes/win10-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll": {
+ "fileVersion": "10.0.18362.1"
+ },
+ "runtimes/win10-x86/native/mi.dll": {
+ "fileVersion": "10.0.18362.1"
+ },
+ "runtimes/win10-x86/native/miutils.dll": {
+ "fileVersion": "10.0.18362.1"
+ }
+ }
+ },
+ "Microsoft.NETCore.Platforms/5.0.0": {},
+ "Microsoft.NETCore.Targets/1.1.0": {},
+ "Microsoft.PowerShell.Commands.Diagnostics/7.1.0": {
+ "dependencies": {
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Commands.Diagnostics.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Commands.Management/7.1.0": {
+ "dependencies": {
+ "Microsoft.PowerShell.Security": "7.1.0",
+ "System.ServiceProcess.ServiceController": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Commands.Management.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Commands.Utility/7.1.0": {
+ "dependencies": {
+ "Microsoft.CodeAnalysis.CSharp": "3.7.0",
+ "Microsoft.PowerShell.MarkdownRender": "7.1.0",
+ "NJsonSchema": "10.2.2",
+ "System.Drawing.Common": "5.0.0",
+ "System.Management.Automation": "7.1.0",
+ "System.Threading.AccessControl": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Commands.Utility.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.ConsoleHost/7.1.0": {
+ "dependencies": {
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.ConsoleHost.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.CoreCLR.Eventing/7.1.0": {
+ "dependencies": {
+ "System.Diagnostics.EventLog": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.CoreCLR.Eventing.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.MarkdownRender/7.1.0": {
+ "dependencies": {
+ "Markdig.Signed": "0.21.1",
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.MarkdownRender.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Native/7.1.0": {
+ "native": {
+ "runtimes/win-x86/native/PowerShell.Core.Instrumentation.dll": {
+ "fileVersion": "10.0.10011.16384"
+ },
+ "runtimes/win-x86/native/pwrshplugin.dll": {
+ "fileVersion": "10.0.10011.16384"
+ }
+ }
+ },
+ "Microsoft.PowerShell.Security/7.1.0": {
+ "dependencies": {
+ "System.Management.Automation": "7.1.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.PowerShell.Security.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.Win32.Registry/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "Microsoft.Win32.Registry.AccessControl/5.0.0": {
+ "dependencies": {
+ "Microsoft.Win32.Registry": "5.0.0",
+ "System.Security.AccessControl": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "Microsoft.Win32.SystemEvents/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "Microsoft.WSMan.Management/7.1.0": {
+ "dependencies": {
+ "Microsoft.WSMan.Runtime": "7.1.0",
+ "System.Management.Automation": "7.1.0",
+ "System.ServiceProcess.ServiceController": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.WSMan.Management.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Microsoft.WSMan.Runtime/7.1.0": {
+ "runtime": {
+ "runtimes/win/lib/net5.0/Microsoft.WSMan.Runtime.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "Namotion.Reflection/1.0.14": {
+ "dependencies": {
+ "Microsoft.CSharp": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard2.0/Namotion.Reflection.dll": {
+ "assemblyVersion": "1.0.14.0",
+ "fileVersion": "1.0.14.0"
+ }
+ }
+ },
+ "Newtonsoft.Json/12.0.3": {
+ "runtime": {
+ "lib/netstandard2.0/Newtonsoft.Json.dll": {
+ "assemblyVersion": "12.0.0.0",
+ "fileVersion": "12.0.3.23909"
+ }
+ }
+ },
+ "NJsonSchema/10.2.2": {
+ "dependencies": {
+ "Namotion.Reflection": "1.0.14",
+ "Newtonsoft.Json": "12.0.3"
+ },
+ "runtime": {
+ "lib/netstandard2.0/NJsonSchema.dll": {
+ "assemblyVersion": "10.2.2.0",
+ "fileVersion": "10.2.2.0"
+ }
+ }
+ },
+ "runtime.any.System.Collections/4.3.0": {
+ "dependencies": {
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Collections.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Globalization/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Globalization.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.IO/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.5/System.IO.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Reflection/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.5/System.Reflection.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Reflection.Extensions/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Extensions.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Reflection.Primitives/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Primitives.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Resources.ResourceManager/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Resources.ResourceManager.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Runtime/4.3.0": {
+ "dependencies": {
+ "System.Private.Uri": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.5/System.Runtime.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Runtime.Handles/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Runtime.Handles.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Runtime.InteropServices/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.6/System.Runtime.InteropServices.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Text.Encoding/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Text.Encoding.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.any.System.Threading.Tasks/4.3.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Threading.Tasks.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.win.System.Diagnostics.Debug/4.3.0": {
+ "runtime": {
+ "runtimes/win/lib/netstandard1.3/System.Diagnostics.Debug.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.win.System.Runtime.Extensions/4.3.0": {
+ "dependencies": {
+ "System.Private.Uri": "4.3.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard1.5/System.Runtime.Extensions.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "runtime.win7.System.Private.Uri/4.3.0": {
+ "runtime": {
+ "runtimes/win/lib/netstandard1.0/System.Private.Uri.dll": {
+ "assemblyVersion": "4.0.3.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.CodeDom/5.0.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.CodeDom.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Collections/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Collections": "4.3.0"
+ }
+ },
+ "System.Collections.Immutable/1.5.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.Collections.Immutable.dll": {
+ "assemblyVersion": "1.2.3.0",
+ "fileVersion": "4.6.26515.6"
+ }
+ }
+ },
+ "System.Configuration.ConfigurationManager/5.0.0": {
+ "dependencies": {
+ "System.Security.Cryptography.ProtectedData": "5.0.0",
+ "System.Security.Permissions": "5.0.0"
+ },
+ "runtime": {
+ "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Diagnostics.Debug/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.win.System.Diagnostics.Debug": "4.3.0"
+ }
+ },
+ "System.Diagnostics.DiagnosticSource/4.6.0": {
+ "runtime": {
+ "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": {
+ "assemblyVersion": "4.0.4.0",
+ "fileVersion": "4.700.19.46214"
+ }
+ }
+ },
+ "System.Diagnostics.EventLog/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.Win32.Registry": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.DirectoryServices/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "System.IO.FileSystem.AccessControl": "5.0.0",
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Permissions": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.DirectoryServices.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Drawing.Common/5.0.0": {
+ "dependencies": {
+ "Microsoft.Win32.SystemEvents": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Dynamic.Runtime/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.Linq.Expressions": "4.3.0",
+ "System.ObjectModel": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Reflection.TypeExtensions": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Dynamic.Runtime.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Formats.Asn1/5.0.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.Formats.Asn1.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Globalization/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Globalization": "4.3.0"
+ }
+ },
+ "System.IO/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading.Tasks": "4.3.0",
+ "runtime.any.System.IO": "4.3.0"
+ }
+ },
+ "System.IO.FileSystem.AccessControl/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.IO.FileSystem.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Linq/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.6/System.Linq.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Linq.Expressions/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.ObjectModel": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Emit.Lightweight": "4.3.0",
+ "System.Reflection.Extensions": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Reflection.TypeExtensions": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.6/System.Linq.Expressions.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Management/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.Win32.Registry": "5.0.0",
+ "System.CodeDom": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Management.dll": {
+ "assemblyVersion": "4.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Management.Automation/7.1.0": {
+ "dependencies": {
+ "Microsoft.ApplicationInsights": "2.15.0",
+ "Microsoft.Management.Infrastructure": "2.0.0",
+ "Microsoft.PowerShell.CoreCLR.Eventing": "7.1.0",
+ "Microsoft.PowerShell.Native": "7.1.0",
+ "Microsoft.Win32.Registry.AccessControl": "5.0.0",
+ "Newtonsoft.Json": "12.0.3",
+ "System.Configuration.ConfigurationManager": "5.0.0",
+ "System.DirectoryServices": "5.0.0",
+ "System.IO.FileSystem.AccessControl": "5.0.0",
+ "System.Management": "5.0.0",
+ "System.Runtime.CompilerServices.Unsafe": "5.0.0",
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Cryptography.Pkcs": "5.0.0",
+ "System.Security.Permissions": "5.0.0",
+ "System.Text.Encoding.CodePages": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/net5.0/System.Management.Automation.dll": {
+ "assemblyVersion": "7.1.0.0",
+ "fileVersion": "7.1.0.0"
+ }
+ }
+ },
+ "System.Memory/4.5.4": {},
+ "System.ObjectModel/4.3.0": {
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Threading": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.ObjectModel.dll": {
+ "assemblyVersion": "4.0.13.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Private.Uri/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "runtime.win7.System.Private.Uri": "4.3.0"
+ }
+ },
+ "System.Reflection/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.IO": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Reflection": "4.3.0"
+ }
+ },
+ "System.Reflection.Emit/4.3.0": {
+ "dependencies": {
+ "System.IO": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Emit.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Reflection.Emit.ILGeneration/4.3.0": {
+ "dependencies": {
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Reflection.Emit.Lightweight/4.3.0": {
+ "dependencies": {
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Emit.ILGeneration": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": {
+ "assemblyVersion": "4.0.2.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Reflection.Extensions/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Reflection.Extensions": "4.3.0"
+ }
+ },
+ "System.Reflection.Metadata/1.6.0": {
+ "runtime": {
+ "lib/netstandard2.0/System.Reflection.Metadata.dll": {
+ "assemblyVersion": "1.4.3.0",
+ "fileVersion": "4.6.26515.6"
+ }
+ }
+ },
+ "System.Reflection.Primitives/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Reflection.Primitives": "4.3.0"
+ }
+ },
+ "System.Reflection.TypeExtensions/4.3.0": {
+ "dependencies": {
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": {
+ "assemblyVersion": "4.1.1.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Resources.ResourceManager/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Globalization": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Resources.ResourceManager": "4.3.0"
+ }
+ },
+ "System.Runtime/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "runtime.any.System.Runtime": "4.3.0"
+ }
+ },
+ "System.Runtime.CompilerServices.Unsafe/5.0.0": {
+ "runtime": {
+ "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Runtime.Extensions/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.win.System.Runtime.Extensions": "4.3.0"
+ }
+ },
+ "System.Runtime.Handles/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Runtime.Handles": "4.3.0"
+ }
+ },
+ "System.Runtime.InteropServices/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "runtime.any.System.Runtime.InteropServices": "4.3.0"
+ }
+ },
+ "System.Security.AccessControl/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Cryptography.Cng/5.0.0": {
+ "dependencies": {
+ "System.Formats.Asn1": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Cryptography.Pkcs/5.0.0": {
+ "dependencies": {
+ "System.Formats.Asn1": "5.0.0",
+ "System.Security.Cryptography.Cng": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Pkcs.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Cryptography.ProtectedData/5.0.0": {
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Permissions/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Windows.Extensions": "5.0.0"
+ },
+ "runtime": {
+ "lib/net5.0/System.Security.Permissions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Security.Principal.Windows/5.0.0": {
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.ServiceProcess.ServiceController/5.0.0": {
+ "dependencies": {
+ "System.Diagnostics.EventLog": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.ServiceProcess.ServiceController.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Text.Encoding/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Text.Encoding": "4.3.0"
+ }
+ },
+ "System.Text.Encoding.CodePages/5.0.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Threading/4.3.0": {
+ "dependencies": {
+ "System.Runtime": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ },
+ "runtime": {
+ "lib/netstandard1.3/System.Threading.dll": {
+ "assemblyVersion": "4.0.12.0",
+ "fileVersion": "4.6.24705.1"
+ }
+ }
+ },
+ "System.Threading.AccessControl/5.0.0": {
+ "dependencies": {
+ "System.Security.AccessControl": "5.0.0",
+ "System.Security.Principal.Windows": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netstandard2.0/System.Threading.AccessControl.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ },
+ "System.Threading.Tasks/4.3.0": {
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "runtime.any.System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.Threading.Tasks.Extensions/4.5.3": {},
+ "System.Windows.Extensions/5.0.0": {
+ "dependencies": {
+ "System.Drawing.Common": "5.0.0"
+ },
+ "runtime": {
+ "runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll": {
+ "assemblyVersion": "5.0.0.0",
+ "fileVersion": "5.0.20.51904"
+ }
+ }
+ }
+ }
+ },
+ "libraries": {
+ "Chef.Powershell.Core/1.0.0": {
+ "type": "project",
+ "serviceable": false,
+ "sha512": ""
+ },
+ "runtimepack.Microsoft.NETCore.App.Runtime.win-x86/5.0.0": {
+ "type": "runtimepack",
+ "serviceable": false,
+ "sha512": ""
+ },
+ "Markdig.Signed/0.21.1": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Lg0FPQdKUXai4/XZpQGlQ/HldpHsGnsU6Jd+udJgHj/R7i3ngM2TtR+SZqdHRtgItIHe3dFh2DS/M5qXGSPRiQ==",
+ "path": "markdig.signed/0.21.1",
+ "hashPath": "markdig.signed.0.21.1.nupkg.sha512"
+ },
+ "Microsoft.ApplicationInsights/2.15.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-tG9WZoFc0BTbkj+UjH4IUp8qkT9NA5st8zvPzlHbU8rJDgPFqZDJ3SSAQajl42jet1ghhJ5ZixsjjqVvwi4kaQ==",
+ "path": "microsoft.applicationinsights/2.15.0",
+ "hashPath": "microsoft.applicationinsights.2.15.0.nupkg.sha512"
+ },
+ "Microsoft.CodeAnalysis.Analyzers/3.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-ojG5pGAhTPmjxRGTNvuszO3H8XPZqksDwr9xLd4Ae/JBjZZdl6GuoLk7uLMf+o7yl5wO0TAqoWcEKkEWqrZE5g==",
+ "path": "microsoft.codeanalysis.analyzers/3.0.0",
+ "hashPath": "microsoft.codeanalysis.analyzers.3.0.0.nupkg.sha512"
+ },
+ "Microsoft.CodeAnalysis.Common/3.7.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SFEdnbw8204hTlde3JePYSIpNX58h/MMXa7LctUsUDigWMR8Ar9gE8LnsLqAIFM0O33JEuQbJ0G4Sat+cPGldw==",
+ "path": "microsoft.codeanalysis.common/3.7.0",
+ "hashPath": "microsoft.codeanalysis.common.3.7.0.nupkg.sha512"
+ },
+ "Microsoft.CodeAnalysis.CSharp/3.7.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-sKi5PIVy9nVDerkbplY6OQhJBNzEO4XJsMGrnmb6KFEa6K1ulGCHIv6NtDjdUQ/dGrouU3OExc3yzww0COD76w==",
+ "path": "microsoft.codeanalysis.csharp/3.7.0",
+ "hashPath": "microsoft.codeanalysis.csharp.3.7.0.nupkg.sha512"
+ },
+ "Microsoft.CSharp/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==",
+ "path": "microsoft.csharp/4.3.0",
+ "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512"
+ },
+ "Microsoft.Management.Infrastructure/2.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-IaKZRNBBv3sdrmBWd+aqwHq8cVHk/3WgWFAN/dt40MRY9rbtHiDfTTmaEN0tGTmQqGCGDo/ncntA8MvFMvcsRw==",
+ "path": "microsoft.management.infrastructure/2.0.0",
+ "hashPath": "microsoft.management.infrastructure.2.0.0.nupkg.sha512"
+ },
+ "Microsoft.Management.Infrastructure.Runtime.Unix/2.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-p0lslMX5bdWLxO2P7ao+rjAMOB0LEwPYpzvdCQ2OEYgX2NxFpQ8ILvqPGnYlTAb53rT8gu5DyIol1HboHFYfxQ==",
+ "path": "microsoft.management.infrastructure.runtime.unix/2.0.0",
+ "hashPath": "microsoft.management.infrastructure.runtime.unix.2.0.0.nupkg.sha512"
+ },
+ "Microsoft.Management.Infrastructure.Runtime.Win/2.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-vjBWQeDOjgernkrOdbEgn7M70SF7hof7ORdKPSlL06Uc15+oYdth5dZju9KsgUoti/cwnkZTiwtDx/lRtay0sA==",
+ "path": "microsoft.management.infrastructure.runtime.win/2.0.0",
+ "hashPath": "microsoft.management.infrastructure.runtime.win.2.0.0.nupkg.sha512"
+ },
+ "Microsoft.NETCore.Platforms/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
+ "path": "microsoft.netcore.platforms/5.0.0",
+ "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.NETCore.Targets/1.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==",
+ "path": "microsoft.netcore.targets/1.1.0",
+ "hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Commands.Diagnostics/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Hipqx38QOv1xWXbV4yGWHOmFIV8zp0O15z2H+Vx0Z0cOnzu4eb+MUblb4Dc1FA3S7ZE56qplC3XBK3hs0EsvYA==",
+ "path": "microsoft.powershell.commands.diagnostics/7.1.0",
+ "hashPath": "microsoft.powershell.commands.diagnostics.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Commands.Management/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-3S5CU0Zq8ecdywaI3NoKyzjyaLaS7OKAi6z2AfiyKDG5IZfoLTBgIzNQElNFag8UALTNRlKGD8cumVtM3myAQA==",
+ "path": "microsoft.powershell.commands.management/7.1.0",
+ "hashPath": "microsoft.powershell.commands.management.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Commands.Utility/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-6BXJ7NRCs8xCHqspv1VoijXKLfLrM6O8rJwyTk0mPc5BZvpC2NSQq1NAJHAlk60ENFTu0vtxK2IzWkbFvJ/BUQ==",
+ "path": "microsoft.powershell.commands.utility/7.1.0",
+ "hashPath": "microsoft.powershell.commands.utility.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.ConsoleHost/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-vfs4i5cViK5YsiIveuFv7OTrN2m5vPfOXj3XBkrQHtlMb2u0mkIsqVMTDHRMAyopcpp0ZJ1H+4ZsZ9z1bcpagQ==",
+ "path": "microsoft.powershell.consolehost/7.1.0",
+ "hashPath": "microsoft.powershell.consolehost.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.CoreCLR.Eventing/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-TCTaoyysnTHUErm0w8W50CVB5Mzwj1PQyb740K1DLvbw8Ba607Q1HCSzBHClEDlG+Cphuv9ie2pbvEWcUKslVg==",
+ "path": "microsoft.powershell.coreclr.eventing/7.1.0",
+ "hashPath": "microsoft.powershell.coreclr.eventing.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.MarkdownRender/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-FD8ARPyKg22yRhU3gUk6NKZtmtSk5uekqufjJCiTu8A5lvWF9A0mCr/OUYE7+HQLnJoBu8BR19vwnED0Jpd1WQ==",
+ "path": "microsoft.powershell.markdownrender/7.1.0",
+ "hashPath": "microsoft.powershell.markdownrender.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Native/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-PJ/ei1HnYC+CMVDdUMT96PgWFONwVv/ZaJ5j//qLdk073alzdzOPWZiGsxYimJaRLP0TW4uomgIsR9q6jrf48A==",
+ "path": "microsoft.powershell.native/7.1.0",
+ "hashPath": "microsoft.powershell.native.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.PowerShell.Security/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-I4ab6z1Vlu25c33jc0gG0Val6YpSgyOyxNsNOENcBGue9TDJQ+d6ppw1IKcCILefpVAo/UWiE4xrWxO04KUc3g==",
+ "path": "microsoft.powershell.security/7.1.0",
+ "hashPath": "microsoft.powershell.security.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.Win32.Registry/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
+ "path": "microsoft.win32.registry/5.0.0",
+ "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.Win32.Registry.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-rwF501ZS/xKGWz5H3RLBvwta6E5kcMLB0UYGTgrZ8nL5bvrbGmtEcEObgMC/qRFhA3og/0Zh+eacrcA+0FBXJA==",
+ "path": "microsoft.win32.registry.accesscontrol/5.0.0",
+ "hashPath": "microsoft.win32.registry.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.Win32.SystemEvents/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Bh6blKG8VAKvXiLe2L+sEsn62nc1Ij34MrNxepD2OCrS5cpCwQa9MeLyhVQPQ/R4Wlzwuy6wMK8hLb11QPDRsQ==",
+ "path": "microsoft.win32.systemevents/5.0.0",
+ "hashPath": "microsoft.win32.systemevents.5.0.0.nupkg.sha512"
+ },
+ "Microsoft.WSMan.Management/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-noQxoEaJW5W4vbRfwIB1l+ecERA+K4ZygZBv1YNu0IwdDos0mIiPY+YpFKz2uHyeNSk1Z3j1fsXV0b/r+eRT1Q==",
+ "path": "microsoft.wsman.management/7.1.0",
+ "hashPath": "microsoft.wsman.management.7.1.0.nupkg.sha512"
+ },
+ "Microsoft.WSMan.Runtime/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-DVtFU3QQ12w5ej86Gw/vNtJjCXPd7r9fLJs9tzYqptEO6WtJX+vH65qPacP0DN/LEuc+93+iRVfNjjf/EMuNBQ==",
+ "path": "microsoft.wsman.runtime/7.1.0",
+ "hashPath": "microsoft.wsman.runtime.7.1.0.nupkg.sha512"
+ },
+ "Namotion.Reflection/1.0.14": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-wuJGiFvGfehH2w7jAhMbCJt0/rvUuHyqSZn0sMhNTviDfBZRyX8LFlR/ndQcofkGWulPDfH5nKYTeGXE8xBHPA==",
+ "path": "namotion.reflection/1.0.14",
+ "hashPath": "namotion.reflection.1.0.14.nupkg.sha512"
+ },
+ "Newtonsoft.Json/12.0.3": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==",
+ "path": "newtonsoft.json/12.0.3",
+ "hashPath": "newtonsoft.json.12.0.3.nupkg.sha512"
+ },
+ "NJsonSchema/10.2.2": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-s6oNUrjw5Ix5WVkYdU0vgyzoutZdi7p+uQqTGYa3QbLtjDYrkD4ahfGnfyCpHNoJUXun9pHKGy6AD0LJNcSgjQ==",
+ "path": "njsonschema/10.2.2",
+ "hashPath": "njsonschema.10.2.2.nupkg.sha512"
+ },
+ "runtime.any.System.Collections/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-23g6rqftKmovn2cLeGsuHUYm0FD7pdutb0uQMJpZ3qTvq+zHkgmt6J65VtRry4WDGYlmkMa4xDACtaQ94alNag==",
+ "path": "runtime.any.system.collections/4.3.0",
+ "hashPath": "runtime.any.system.collections.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Globalization/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-sMDBnad4rp4t7GY442Jux0MCUuKL4otn5BK6Ni0ARTXTSpRNBzZ7hpMfKSvnVSED5kYJm96YOWsqV0JH0d2uuw==",
+ "path": "runtime.any.system.globalization/4.3.0",
+ "hashPath": "runtime.any.system.globalization.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.IO/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SDZ5AD1DtyRoxYtEcqQ3HDlcrorMYXZeCt7ZhG9US9I5Vva+gpIWDGMkcwa5XiKL0ceQKRZIX2x0XEjLX7PDzQ==",
+ "path": "runtime.any.system.io/4.3.0",
+ "hashPath": "runtime.any.system.io.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Reflection/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-hLC3A3rI8jipR5d9k7+f0MgRCW6texsAp0MWkN/ci18FMtQ9KH7E2vDn/DH2LkxsszlpJpOn9qy6Z6/69rH6eQ==",
+ "path": "runtime.any.system.reflection/4.3.0",
+ "hashPath": "runtime.any.system.reflection.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Reflection.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-cPhT+Vqu52+cQQrDai/V91gubXUnDKNRvlBnH+hOgtGyHdC17aQIU64EaehwAQymd7kJA5rSrVRNfDYrbhnzyA==",
+ "path": "runtime.any.system.reflection.extensions/4.3.0",
+ "hashPath": "runtime.any.system.reflection.extensions.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Reflection.Primitives/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Nrm1p3armp6TTf2xuvaa+jGTTmncALWFq22CpmwRvhDf6dE9ZmH40EbOswD4GnFLrMRS0Ki6Kx5aUPmKK/hZBg==",
+ "path": "runtime.any.system.reflection.primitives/4.3.0",
+ "hashPath": "runtime.any.system.reflection.primitives.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Resources.ResourceManager/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Lxb89SMvf8w9p9+keBLyL6H6x/TEmc6QVsIIA0T36IuyOY3kNvIdyGddA2qt35cRamzxF8K5p0Opq4G4HjNbhQ==",
+ "path": "runtime.any.system.resources.resourcemanager/4.3.0",
+ "hashPath": "runtime.any.system.resources.resourcemanager.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Runtime/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-fRS7zJgaG9NkifaAxGGclDDoRn9HC7hXACl52Or06a/fxdzDajWb5wov3c6a+gVSlekRoexfjwQSK9sh5um5LQ==",
+ "path": "runtime.any.system.runtime/4.3.0",
+ "hashPath": "runtime.any.system.runtime.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Runtime.Handles/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-GG84X6vufoEzqx8PbeBKheE4srOhimv+yLtGb/JkR3Y2FmoqmueLNFU4Xx8Y67plFpltQSdK74x0qlEhIpv/CQ==",
+ "path": "runtime.any.system.runtime.handles/4.3.0",
+ "hashPath": "runtime.any.system.runtime.handles.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Runtime.InteropServices/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-lBoFeQfxe/4eqjPi46E0LU/YaCMdNkQ8B4MZu/mkzdIAZh8RQ1NYZSj0egrQKdgdvlPFtP4STtob40r4o2DBAw==",
+ "path": "runtime.any.system.runtime.interopservices/4.3.0",
+ "hashPath": "runtime.any.system.runtime.interopservices.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Text.Encoding/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-+ihI5VaXFCMVPJNstG4O4eo1CfbrByLxRrQQTqOTp1ttK0kUKDqOdBSTaCB2IBk/QtjDrs6+x4xuezyMXdm0HQ==",
+ "path": "runtime.any.system.text.encoding/4.3.0",
+ "hashPath": "runtime.any.system.text.encoding.4.3.0.nupkg.sha512"
+ },
+ "runtime.any.System.Threading.Tasks/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-OhBAVBQG5kFj1S+hCEQ3TUHBAEtZ3fbEMgZMRNdN8A0Pj4x+5nTELEqL59DU0TjKVE6II3dqKw4Dklb3szT65w==",
+ "path": "runtime.any.system.threading.tasks/4.3.0",
+ "hashPath": "runtime.any.system.threading.tasks.4.3.0.nupkg.sha512"
+ },
+ "runtime.win.System.Diagnostics.Debug/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-hHHP0WCStene2jjeYcuDkETozUYF/3sHVRHAEOgS3L15hlip24ssqCTnJC28Z03Wpo078oMcJd0H4egD2aJI8g==",
+ "path": "runtime.win.system.diagnostics.debug/4.3.0",
+ "hashPath": "runtime.win.system.diagnostics.debug.4.3.0.nupkg.sha512"
+ },
+ "runtime.win.System.Runtime.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-RkgHVhUPvzZxuUubiZe8yr/6CypRVXj0VBzaR8hsqQ8f+rUo7e4PWrHTLOCjd8fBMGWCrY//fi7Ku3qXD7oHRw==",
+ "path": "runtime.win.system.runtime.extensions/4.3.0",
+ "hashPath": "runtime.win.system.runtime.extensions.4.3.0.nupkg.sha512"
+ },
+ "runtime.win7.System.Private.Uri/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-Q+IBgaPYicSQs2tBlmXqbS25c/JLIthWrgrpMwxKSOobW/OqIMVFruUGfuaz4QABVzV8iKdCAbN7APY7Tclbnw==",
+ "path": "runtime.win7.system.private.uri/4.3.0",
+ "hashPath": "runtime.win7.system.private.uri.4.3.0.nupkg.sha512"
+ },
+ "System.CodeDom/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ==",
+ "path": "system.codedom/5.0.0",
+ "hashPath": "system.codedom.5.0.0.nupkg.sha512"
+ },
+ "System.Collections/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==",
+ "path": "system.collections/4.3.0",
+ "hashPath": "system.collections.4.3.0.nupkg.sha512"
+ },
+ "System.Collections.Immutable/1.5.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==",
+ "path": "system.collections.immutable/1.5.0",
+ "hashPath": "system.collections.immutable.1.5.0.nupkg.sha512"
+ },
+ "System.Configuration.ConfigurationManager/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-aM7cbfEfVNlEEOj3DsZP+2g9NRwbkyiAv2isQEzw7pnkDg9ekCU2m1cdJLM02Uq691OaCS91tooaxcEn8d0q5w==",
+ "path": "system.configuration.configurationmanager/5.0.0",
+ "hashPath": "system.configuration.configurationmanager.5.0.0.nupkg.sha512"
+ },
+ "System.Diagnostics.Debug/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==",
+ "path": "system.diagnostics.debug/4.3.0",
+ "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512"
+ },
+ "System.Diagnostics.DiagnosticSource/4.6.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==",
+ "path": "system.diagnostics.diagnosticsource/4.6.0",
+ "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512"
+ },
+ "System.Diagnostics.EventLog/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-FHkCwUfsTs+/5tsK+c0egLfacUgbhvcwi3wUFWSEEArSXao343mYqcpOVVFMlcCkdNtjU4YwAWaKYwal6f02og==",
+ "path": "system.diagnostics.eventlog/5.0.0",
+ "hashPath": "system.diagnostics.eventlog.5.0.0.nupkg.sha512"
+ },
+ "System.DirectoryServices/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-lAS54Y3KO1XV68akGa0/GJeddkkuuiv2CtcSkMiTmLHQ6o6kFbKpw4DmJZADF7a6KjPwYxmZnH4D3eGicrJdcg==",
+ "path": "system.directoryservices/5.0.0",
+ "hashPath": "system.directoryservices.5.0.0.nupkg.sha512"
+ },
+ "System.Drawing.Common/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SztFwAnpfKC8+sEKXAFxCBWhKQaEd97EiOL7oZJZP56zbqnLpmxACWA8aGseaUExciuEAUuR9dY8f7HkTRAdnw==",
+ "path": "system.drawing.common/5.0.0",
+ "hashPath": "system.drawing.common.5.0.0.nupkg.sha512"
+ },
+ "System.Dynamic.Runtime/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==",
+ "path": "system.dynamic.runtime/4.3.0",
+ "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512"
+ },
+ "System.Formats.Asn1/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==",
+ "path": "system.formats.asn1/5.0.0",
+ "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512"
+ },
+ "System.Globalization/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==",
+ "path": "system.globalization/4.3.0",
+ "hashPath": "system.globalization.4.3.0.nupkg.sha512"
+ },
+ "System.IO/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==",
+ "path": "system.io/4.3.0",
+ "hashPath": "system.io.4.3.0.nupkg.sha512"
+ },
+ "System.IO.FileSystem.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==",
+ "path": "system.io.filesystem.accesscontrol/5.0.0",
+ "hashPath": "system.io.filesystem.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "System.Linq/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==",
+ "path": "system.linq/4.3.0",
+ "hashPath": "system.linq.4.3.0.nupkg.sha512"
+ },
+ "System.Linq.Expressions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==",
+ "path": "system.linq.expressions/4.3.0",
+ "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512"
+ },
+ "System.Management/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==",
+ "path": "system.management/5.0.0",
+ "hashPath": "system.management.5.0.0.nupkg.sha512"
+ },
+ "System.Management.Automation/7.1.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-WjmMs8kNETGWUmbE2A87cTcAGRz0WJ24TOZm5xkhop/93fIINK8TEcghEr2I0mSgXb7t0pWkPdKdEA5vizFQPA==",
+ "path": "system.management.automation/7.1.0",
+ "hashPath": "system.management.automation.7.1.0.nupkg.sha512"
+ },
+ "System.Memory/4.5.4": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==",
+ "path": "system.memory/4.5.4",
+ "hashPath": "system.memory.4.5.4.nupkg.sha512"
+ },
+ "System.ObjectModel/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==",
+ "path": "system.objectmodel/4.3.0",
+ "hashPath": "system.objectmodel.4.3.0.nupkg.sha512"
+ },
+ "System.Private.Uri/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-I4SwANiUGho1esj4V4oSlPllXjzCZDE+5XXso2P03LW2vOda2Enzh8DWOxwN6hnrJyp314c7KuVu31QYhRzOGg==",
+ "path": "system.private.uri/4.3.0",
+ "hashPath": "system.private.uri.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==",
+ "path": "system.reflection/4.3.0",
+ "hashPath": "system.reflection.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Emit/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==",
+ "path": "system.reflection.emit/4.3.0",
+ "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Emit.ILGeneration/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==",
+ "path": "system.reflection.emit.ilgeneration/4.3.0",
+ "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Emit.Lightweight/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==",
+ "path": "system.reflection.emit.lightweight/4.3.0",
+ "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==",
+ "path": "system.reflection.extensions/4.3.0",
+ "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.Metadata/1.6.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==",
+ "path": "system.reflection.metadata/1.6.0",
+ "hashPath": "system.reflection.metadata.1.6.0.nupkg.sha512"
+ },
+ "System.Reflection.Primitives/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==",
+ "path": "system.reflection.primitives/4.3.0",
+ "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512"
+ },
+ "System.Reflection.TypeExtensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==",
+ "path": "system.reflection.typeextensions/4.3.0",
+ "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512"
+ },
+ "System.Resources.ResourceManager/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==",
+ "path": "system.resources.resourcemanager/4.3.0",
+ "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==",
+ "path": "system.runtime/4.3.0",
+ "hashPath": "system.runtime.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime.CompilerServices.Unsafe/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==",
+ "path": "system.runtime.compilerservices.unsafe/5.0.0",
+ "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512"
+ },
+ "System.Runtime.Extensions/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==",
+ "path": "system.runtime.extensions/4.3.0",
+ "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime.Handles/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==",
+ "path": "system.runtime.handles/4.3.0",
+ "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512"
+ },
+ "System.Runtime.InteropServices/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==",
+ "path": "system.runtime.interopservices/4.3.0",
+ "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512"
+ },
+ "System.Security.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
+ "path": "system.security.accesscontrol/5.0.0",
+ "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Cryptography.Cng/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==",
+ "path": "system.security.cryptography.cng/5.0.0",
+ "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Cryptography.Pkcs/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-9TPLGjBCGKmNvG8pjwPeuYy0SMVmGZRwlTZvyPHDbYv/DRkoeumJdfumaaDNQzVGMEmbWtg07zUpSW9q70IlDQ==",
+ "path": "system.security.cryptography.pkcs/5.0.0",
+ "hashPath": "system.security.cryptography.pkcs.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Cryptography.ProtectedData/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-HGxMSAFAPLNoxBvSfW08vHde0F9uh7BjASwu6JF9JnXuEPhCY3YUqURn0+bQV/4UWeaqymmrHWV+Aw9riQCtCA==",
+ "path": "system.security.cryptography.protecteddata/5.0.0",
+ "hashPath": "system.security.cryptography.protecteddata.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Permissions/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-uE8juAhEkp7KDBCdjDIE3H9R1HJuEHqeqX8nLX9gmYKWwsqk3T5qZlPx8qle5DPKimC/Fy3AFTdV7HamgCh9qQ==",
+ "path": "system.security.permissions/5.0.0",
+ "hashPath": "system.security.permissions.5.0.0.nupkg.sha512"
+ },
+ "System.Security.Principal.Windows/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
+ "path": "system.security.principal.windows/5.0.0",
+ "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512"
+ },
+ "System.ServiceProcess.ServiceController/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-p2yX167GW1pr2DCR6cW+cBKrvhli4thckXk108faFaTPHnoudb0AYPcIPq3nmrwn7IQj9FEmjpyJlXzcOmIjjw==",
+ "path": "system.serviceprocess.servicecontroller/5.0.0",
+ "hashPath": "system.serviceprocess.servicecontroller.5.0.0.nupkg.sha512"
+ },
+ "System.Text.Encoding/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==",
+ "path": "system.text.encoding/4.3.0",
+ "hashPath": "system.text.encoding.4.3.0.nupkg.sha512"
+ },
+ "System.Text.Encoding.CodePages/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-NyscU59xX6Uo91qvhOs2Ccho3AR2TnZPomo1Z0K6YpyztBPM/A5VbkzOO19sy3A3i1TtEnTxA7bCe3Us+r5MWg==",
+ "path": "system.text.encoding.codepages/5.0.0",
+ "hashPath": "system.text.encoding.codepages.5.0.0.nupkg.sha512"
+ },
+ "System.Threading/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==",
+ "path": "system.threading/4.3.0",
+ "hashPath": "system.threading.4.3.0.nupkg.sha512"
+ },
+ "System.Threading.AccessControl/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-WJ9w9m4iHJVq0VoH7hZvYAccbRq95itYRhAAXd6M4kVCzLmT6NqTwmSXKwp3oQilWHhYTXgqaIXxBfg8YaqtmA==",
+ "path": "system.threading.accesscontrol/5.0.0",
+ "hashPath": "system.threading.accesscontrol.5.0.0.nupkg.sha512"
+ },
+ "System.Threading.Tasks/4.3.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==",
+ "path": "system.threading.tasks/4.3.0",
+ "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512"
+ },
+ "System.Threading.Tasks.Extensions/4.5.3": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==",
+ "path": "system.threading.tasks.extensions/4.5.3",
+ "hashPath": "system.threading.tasks.extensions.4.5.3.nupkg.sha512"
+ },
+ "System.Windows.Extensions/5.0.0": {
+ "type": "package",
+ "serviceable": true,
+ "sha512": "sha512-c1ho9WU9ZxMZawML+ssPKZfdnrg/OjR3pe0m9v8230z3acqphwvPJqzAkH54xRYm5ntZHGG1EPP3sux9H3qSPg==",
+ "path": "system.windows.extensions/5.0.0",
+ "hashPath": "system.windows.extensions.5.0.0.nupkg.sha512"
+ }
+ },
+ "runtimes": {
+ "win10-x86": [
+ "win10",
+ "win81-x86",
+ "win81",
+ "win8-x86",
+ "win8",
+ "win7-x86",
+ "win7",
+ "win-x86",
+ "win",
+ "any",
+ "base"
+ ],
+ "win10-x86-aot": [
+ "win10-aot",
+ "win10-x86",
+ "win10",
+ "win81-x86-aot",
+ "win81-aot",
+ "win81-x86",
+ "win81",
+ "win8-x86-aot",
+ "win8-aot",
+ "win8-x86",
+ "win8",
+ "win7-x86-aot",
+ "win7-aot",
+ "win7-x86",
+ "win7",
+ "win-x86-aot",
+ "win-aot",
+ "win-x86",
+ "win",
+ "aot",
+ "any",
+ "base"
+ ]
+ }
+} \ No newline at end of file
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll
new file mode 100644
index 0000000000..9ada03f00f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll
new file mode 100644
index 0000000000..7d8d5afcd3
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll
new file mode 100644
index 0000000000..b63f889771
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll
new file mode 100644
index 0000000000..96fa29deea
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll
new file mode 100644
index 0000000000..1dc32290ac
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll
new file mode 100644
index 0000000000..6af4347c1d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll
new file mode 100644
index 0000000000..fd06cf702f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll
new file mode 100644
index 0000000000..ef7985f068
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll
new file mode 100644
index 0000000000..f4169868c0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll
new file mode 100644
index 0000000000..d33a2ffd25
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll
new file mode 100644
index 0000000000..5644be0dfd
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll
new file mode 100644
index 0000000000..8b3954033a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dll
new file mode 100644
index 0000000000..934802f5c2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll
new file mode 100644
index 0000000000..4dbe1ef978
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dll
new file mode 100644
index 0000000000..b5aa0c4cd3
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.SystemEvents.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dll
new file mode 100644
index 0000000000..36ecf91055
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/NJsonSchema.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dll
new file mode 100644
index 0000000000..8cbfb13909
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Namotion.Reflection.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll
new file mode 100644
index 0000000000..b501fb6a29
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dll
new file mode 100644
index 0000000000..f592b9a511
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/PowerShell.Core.Instrumentation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll
new file mode 100644
index 0000000000..b1a20b58c8
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll
new file mode 100644
index 0000000000..b881d20368
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dll
new file mode 100644
index 0000000000..873495d3bd
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.CodeDom.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll
new file mode 100644
index 0000000000..a56d0897b4
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll
new file mode 100644
index 0000000000..9a6816af59
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll
new file mode 100644
index 0000000000..371f7e96cb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll
new file mode 100644
index 0000000000..4007eecec0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll
new file mode 100644
index 0000000000..1d38f28b98
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll
new file mode 100644
index 0000000000..9371560992
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll
new file mode 100644
index 0000000000..848ff822f6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll
new file mode 100644
index 0000000000..beb02a9fb6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll
new file mode 100644
index 0000000000..25950c2e76
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll
new file mode 100644
index 0000000000..3f7c1962f9
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll
new file mode 100644
index 0000000000..bcfd36f18e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dll
new file mode 100644
index 0000000000..1644e5d6d6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.ConfigurationManager.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll
new file mode 100644
index 0000000000..336518895c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll
new file mode 100644
index 0000000000..caf6502e59
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll
new file mode 100644
index 0000000000..733ec59349
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll
new file mode 100644
index 0000000000..37a2d2cb3b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll
new file mode 100644
index 0000000000..c1e4676375
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll
new file mode 100644
index 0000000000..96d612a6e5
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll
new file mode 100644
index 0000000000..aee8520460
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll
new file mode 100644
index 0000000000..b682fa66e0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll
new file mode 100644
index 0000000000..cef5d89e43
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll
new file mode 100644
index 0000000000..bb76446a5e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll
new file mode 100644
index 0000000000..466d54c708
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll
new file mode 100644
index 0000000000..3eff2da950
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll
new file mode 100644
index 0000000000..533ccde2bd
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll
new file mode 100644
index 0000000000..b991388669
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll
new file mode 100644
index 0000000000..437a872743
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll
new file mode 100644
index 0000000000..3edfc46ee2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll
new file mode 100644
index 0000000000..05ec366f23
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dll
new file mode 100644
index 0000000000..e43577d592
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.DirectoryServices.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll
new file mode 100644
index 0000000000..87fe0ae8bb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll
new file mode 100644
index 0000000000..536cff8bc8
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll
new file mode 100644
index 0000000000..80ff7228c1
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll
new file mode 100644
index 0000000000..a99a2e9644
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll
new file mode 100644
index 0000000000..f194c14ec7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll
new file mode 100644
index 0000000000..06078378ef
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll
new file mode 100644
index 0000000000..bdd86cbb93
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll
new file mode 100644
index 0000000000..fb7a3d39c4
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll
new file mode 100644
index 0000000000..1993116705
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll
new file mode 100644
index 0000000000..f5531bb397
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll
new file mode 100644
index 0000000000..bec719f635
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll
new file mode 100644
index 0000000000..f71aef8973
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll
new file mode 100644
index 0000000000..23f159eebb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll
new file mode 100644
index 0000000000..7d29ca9574
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll
new file mode 100644
index 0000000000..bc8964043d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll
new file mode 100644
index 0000000000..17b00763f1
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll
new file mode 100644
index 0000000000..5f8557523f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll
new file mode 100644
index 0000000000..78cbb117ec
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll
new file mode 100644
index 0000000000..ca78c89331
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll
new file mode 100644
index 0000000000..927ee75b92
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll
new file mode 100644
index 0000000000..eb52591f57
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll
new file mode 100644
index 0000000000..a5dfd8faa7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll
new file mode 100644
index 0000000000..5299140cee
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll
new file mode 100644
index 0000000000..0a04617ef0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll
new file mode 100644
index 0000000000..0226ed41fb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll
new file mode 100644
index 0000000000..1693c4fca5
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll
new file mode 100644
index 0000000000..5d0beaec5b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll
new file mode 100644
index 0000000000..aa3f0fccb5
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.dll
new file mode 100644
index 0000000000..a3a1f45197
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll
new file mode 100644
index 0000000000..47ed8149bc
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll
new file mode 100644
index 0000000000..1f979b0376
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll
new file mode 100644
index 0000000000..2f028f3609
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll
new file mode 100644
index 0000000000..c754ea8d90
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll
new file mode 100644
index 0000000000..6d0c9971b4
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll
new file mode 100644
index 0000000000..43c577bbed
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll
new file mode 100644
index 0000000000..7838d83930
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll
new file mode 100644
index 0000000000..f1ec22bbcd
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll
new file mode 100644
index 0000000000..be0bcda333
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll
new file mode 100644
index 0000000000..03f5ad8e42
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll
new file mode 100644
index 0000000000..24aabd0bc7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll
new file mode 100644
index 0000000000..b34797f854
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll
new file mode 100644
index 0000000000..ac67d5483f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll
new file mode 100644
index 0000000000..0754ba93e2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll
new file mode 100644
index 0000000000..05473da99f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll
new file mode 100644
index 0000000000..31d311d8e0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll
new file mode 100644
index 0000000000..dba7236e6b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll
new file mode 100644
index 0000000000..b3745f3113
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll
new file mode 100644
index 0000000000..425660b794
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll
new file mode 100644
index 0000000000..22dcbb47fd
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll
new file mode 100644
index 0000000000..52e5f9ec9c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll
new file mode 100644
index 0000000000..89643fc28c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll
new file mode 100644
index 0000000000..9bdc5cdbe6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll
new file mode 100644
index 0000000000..30a3cbb29a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll
new file mode 100644
index 0000000000..9c008e9963
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll
new file mode 100644
index 0000000000..b560c635d2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll
new file mode 100644
index 0000000000..2a1dd23e85
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll
new file mode 100644
index 0000000000..8ae5a39086
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll
new file mode 100644
index 0000000000..6f2e202809
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll
new file mode 100644
index 0000000000..a974e21555
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll
new file mode 100644
index 0000000000..b06bfefa06
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll
new file mode 100644
index 0000000000..c8c12d3437
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll
new file mode 100644
index 0000000000..cc1425439f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll
new file mode 100644
index 0000000000..1eb8399956
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll
new file mode 100644
index 0000000000..7b192b6be0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll
new file mode 100644
index 0000000000..4724275c88
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll
new file mode 100644
index 0000000000..9a9a3701bf
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll
new file mode 100644
index 0000000000..18a0279be7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll
new file mode 100644
index 0000000000..7312dfe471
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll
new file mode 100644
index 0000000000..91ce3a40f2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll
new file mode 100644
index 0000000000..bab432741f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll
new file mode 100644
index 0000000000..252595deb0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll
new file mode 100644
index 0000000000..af7abdd805
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll
new file mode 100644
index 0000000000..55522e818e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll
new file mode 100644
index 0000000000..2026dfa90e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll
new file mode 100644
index 0000000000..d352c5f6d3
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll
new file mode 100644
index 0000000000..cd16e3f1bc
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll
new file mode 100644
index 0000000000..8a88bc72ae
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll
new file mode 100644
index 0000000000..c7913c1c97
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll
new file mode 100644
index 0000000000..57d39b6f8c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll
new file mode 100644
index 0000000000..2840880115
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll
new file mode 100644
index 0000000000..39d120a5fb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll
new file mode 100644
index 0000000000..85be088af7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll
new file mode 100644
index 0000000000..96d92a7e51
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll
new file mode 100644
index 0000000000..5a58cc15ab
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll
new file mode 100644
index 0000000000..3c913a3694
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll
new file mode 100644
index 0000000000..da6d3e1ada
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll
new file mode 100644
index 0000000000..7f53360c71
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll
new file mode 100644
index 0000000000..7f2c2e1f04
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll
new file mode 100644
index 0000000000..473e5c5d32
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll
new file mode 100644
index 0000000000..097e377e33
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll
new file mode 100644
index 0000000000..252b80c246
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll
new file mode 100644
index 0000000000..3c7a2e881a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dll
new file mode 100644
index 0000000000..99215bb1df
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.ProtectedData.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll
new file mode 100644
index 0000000000..9c73368356
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dll
new file mode 100644
index 0000000000..b380d0856e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Permissions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll
new file mode 100644
index 0000000000..6333081398
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll
new file mode 100644
index 0000000000..5696a1fa42
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll
new file mode 100644
index 0000000000..5a41c8dcd4
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll
new file mode 100644
index 0000000000..87fbd3dced
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll
new file mode 100644
index 0000000000..f903215cb9
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dll
new file mode 100644
index 0000000000..9074d56d58
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.ServiceController.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll
new file mode 100644
index 0000000000..3812b90902
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll
new file mode 100644
index 0000000000..f05265e306
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll
new file mode 100644
index 0000000000..76abcaa617
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll
new file mode 100644
index 0000000000..86835aaaa8
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll
new file mode 100644
index 0000000000..efaa0493ba
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll
new file mode 100644
index 0000000000..a24fa22007
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll
new file mode 100644
index 0000000000..92f48821d3
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dll
new file mode 100644
index 0000000000..49d43249f0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.AccessControl.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll
new file mode 100644
index 0000000000..a6654dccee
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll
new file mode 100644
index 0000000000..c7d1fcabee
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll
new file mode 100644
index 0000000000..717e007115
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll
new file mode 100644
index 0000000000..cb1414526e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll
new file mode 100644
index 0000000000..377d88013a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll
new file mode 100644
index 0000000000..d7c4a35567
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll
new file mode 100644
index 0000000000..318d2ab8fb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll
new file mode 100644
index 0000000000..da11a9984e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll
new file mode 100644
index 0000000000..e67577e288
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll
new file mode 100644
index 0000000000..cdf5081b53
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll
new file mode 100644
index 0000000000..baea5d453b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll
new file mode 100644
index 0000000000..701406c8d7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll
new file mode 100644
index 0000000000..28240172ac
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll
new file mode 100644
index 0000000000..cc2f0e1f7a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll
new file mode 100644
index 0000000000..681076e2ed
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dll
new file mode 100644
index 0000000000..ab82e8395a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.Extensions.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll
new file mode 100644
index 0000000000..0d75104c0f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll
new file mode 100644
index 0000000000..57b6ed9cfb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll
new file mode 100644
index 0000000000..2d6130a1f4
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll
new file mode 100644
index 0000000000..13c8818672
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll
new file mode 100644
index 0000000000..55b27bb917
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll
new file mode 100644
index 0000000000..5e148afeaf
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll
new file mode 100644
index 0000000000..a0d0aa8032
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll
new file mode 100644
index 0000000000..e6a15313ee
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll
new file mode 100644
index 0000000000..94cd19d1e7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll
new file mode 100644
index 0000000000..8e7b9a6df3
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.dll
new file mode 100644
index 0000000000..cca1ec8420
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll
new file mode 100644
index 0000000000..0a3f0a784a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dll
new file mode 100644
index 0000000000..e825ac47fb
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dll
new file mode 100644
index 0000000000..acc6988e6b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-console-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dll
new file mode 100644
index 0000000000..ca6284ed4b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-datetime-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dll
new file mode 100644
index 0000000000..2a3eef142e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-debug-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dll
new file mode 100644
index 0000000000..691f086cf0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-errorhandling-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dll
new file mode 100644
index 0000000000..8870d27b04
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dll
new file mode 100644
index 0000000000..bf151884b0
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dll
new file mode 100644
index 0000000000..627d9a2e29
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-file-l2-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dll
new file mode 100644
index 0000000000..5f73df1b6c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-handle-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dll
new file mode 100644
index 0000000000..d347d553e6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-heap-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dll
new file mode 100644
index 0000000000..8a5f4a284d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-interlocked-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dll
new file mode 100644
index 0000000000..b8106634fd
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-libraryloader-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dll
new file mode 100644
index 0000000000..4a1cdaa438
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-localization-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dll
new file mode 100644
index 0000000000..30767ccf60
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-memory-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dll
new file mode 100644
index 0000000000..93622f475b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-namedpipe-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dll
new file mode 100644
index 0000000000..ff47ce3988
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processenvironment-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dll
new file mode 100644
index 0000000000..4190813a31
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dll
new file mode 100644
index 0000000000..c29fe9deaa
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-processthreads-l1-1-1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dll
new file mode 100644
index 0000000000..a045613703
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-profile-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dll
new file mode 100644
index 0000000000..8f5b40d7b3
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-rtlsupport-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dll
new file mode 100644
index 0000000000..dd307ec66a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-string-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dll
new file mode 100644
index 0000000000..cd9b68e6e2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dll
new file mode 100644
index 0000000000..d1b372c487
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-synch-l1-2-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dll
new file mode 100644
index 0000000000..2ca7c75533
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-sysinfo-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dll
new file mode 100644
index 0000000000..629b637338
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-timezone-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dll
new file mode 100644
index 0000000000..d5e82ecb23
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-core-util-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dll
new file mode 100644
index 0000000000..7cfcdc8c0c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-conio-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dll
new file mode 100644
index 0000000000..bda798b407
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-convert-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dll
new file mode 100644
index 0000000000..8b4aba3947
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-environment-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dll
new file mode 100644
index 0000000000..628bdb55ae
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-filesystem-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dll
new file mode 100644
index 0000000000..7de5fff618
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-heap-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dll
new file mode 100644
index 0000000000..4c8770d0a6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-locale-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dll
new file mode 100644
index 0000000000..0e80796d12
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-math-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dll
new file mode 100644
index 0000000000..b549546cc5
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-multibyte-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dll
new file mode 100644
index 0000000000..cae53b9940
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-private-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dll
new file mode 100644
index 0000000000..b9055e120d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-process-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dll
new file mode 100644
index 0000000000..e2e29a026f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-runtime-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dll
new file mode 100644
index 0000000000..3e35079771
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-stdio-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dll
new file mode 100644
index 0000000000..e1dbc43573
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-string-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dll
new file mode 100644
index 0000000000..3157c9e0e5
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-time-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dll
new file mode 100644
index 0000000000..e7e806212d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/api-ms-win-crt-utility-l1-1-0.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll
new file mode 100644
index 0000000000..3db37f23a6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll
new file mode 100644
index 0000000000..380f9daa52
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll
new file mode 100644
index 0000000000..8f6d97266f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll
new file mode 100644
index 0000000000..e4fc1030a5
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/createdump.exe b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/createdump.exe
new file mode 100644
index 0000000000..62fd3acb3e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/createdump.exe
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..4b72058de6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..43acdf3d4c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/cs/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll
new file mode 100644
index 0000000000..ff7bda2d5f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..55d6b391fa
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..698f08e5e2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/de/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..e770ccc2e8
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..62e2e9a98b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/es/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..f605e75a4d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..a5aec6aa4e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/fr/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll
new file mode 100644
index 0000000000..9074a6c2a1
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll
new file mode 100644
index 0000000000..ad628e6986
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..5aedc4b83b
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..0ecca4c37d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/it/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..2437ed9332
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..0b985d837c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ja/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..c908377e1f
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..bdb9eb5248
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ko/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mi.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mi.dll
new file mode 100644
index 0000000000..cfa384604d
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mi.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/miutils.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/miutils.dll
new file mode 100644
index 0000000000..6a6fdd1bb2
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/miutils.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll
new file mode 100644
index 0000000000..be9218e86c
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_x86_x86_5.0.20.51904.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_x86_x86_5.0.20.51904.dll
new file mode 100644
index 0000000000..0fdf537711
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_x86_x86_5.0.20.51904.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll
new file mode 100644
index 0000000000..3f17afda6e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll
new file mode 100644
index 0000000000..607a8cb582
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll
new file mode 100644
index 0000000000..d1e73f7cef
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll
new file mode 100644
index 0000000000..cbecb91ced
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..8f2b775300
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..b287bd94de
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pl/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..4c64afcfda
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..10a885e034
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pt-BR/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dll
new file mode 100644
index 0000000000..93ef54cd98
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/pwrshplugin.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..2b8db7b639
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..cb414f7bb6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ru/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..87c1ca2c76
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..5b1ff67570
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/tr/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dll
new file mode 100644
index 0000000000..0f10704112
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/ucrtbase.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..8b19e6492a
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..32204d4633
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll
new file mode 100644
index 0000000000..2acfeed16e
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll
new file mode 100644
index 0000000000..57283cf4f6
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/vccorlib140.dll b/distro/ruby_bin_folder/x86/vccorlib140.dll
new file mode 100644
index 0000000000..f9933d56ac
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/vccorlib140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/vcruntime140.dll b/distro/ruby_bin_folder/x86/vcruntime140.dll
new file mode 100644
index 0000000000..dc526fc062
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/vcruntime140.dll
Binary files differ
diff --git a/distro/templates/powershell/chef/chef.psm1.erb b/distro/templates/powershell/chef/chef.psm1.erb
index f8b24dc54b..35344d907d 100644
--- a/distro/templates/powershell/chef/chef.psm1.erb
+++ b/distro/templates/powershell/chef/chef.psm1.erb
@@ -412,40 +412,40 @@ function Run-RubyCommand($command, $argList) {
}
-function <%= Chef::Dist::APPLY %> {
- Run-RubyCommand '<%= Chef::Dist::APPLY %>' $args
+function <%= ChefUtils::Dist::Apply::EXEC %> {
+ Run-RubyCommand '<%= ChefUtils::Dist::Apply::EXEC %>' $args
}
-function <%= Chef::Dist::CLIENT %> {
- Run-RubyCommand '<%= Chef::Dist::CLIENT %>' $args
+function <%= ChefUtils::Dist::Infra::CLIENT %> {
+ Run-RubyCommand '<%= ChefUtils::Dist::Infra::CLIENT %>' $args
}
-function <%= Chef::Dist::EXEC %>-service-manager {
- Run-RubyCommand '<%= Chef::Dist::EXEC %>-service-manager' $args
+function <%= ChefUtils::Dist::Infra::EXEC %>-service-manager {
+ Run-RubyCommand '<%= ChefUtils::Dist::Infra::EXEC %>-service-manager' $args
}
-function <%= Chef::Dist::SHELL %> {
- Run-RubyCommand '<%= Chef::Dist::SHELL %>' $args
+function <%= ChefUtils::Dist::Infra::SHELL %> {
+ Run-RubyCommand '<%= ChefUtils::Dist::Infra::SHELL %>' $args
}
-function <%= Chef::Dist::SOLOEXEC %> {
- Run-RubyCommand '<%= Chef::Dist::SOLOEXEC %>' $args
+function <%= ChefUtils::Dist::Solo::EXEC %> {
+ Run-RubyCommand '<%= ChefUtils::Dist::Solo::EXEC %>' $args
}
-function <%= Chef::Dist::EXEC %>-windows-service {
- Run-RubyCommand '<%= Chef::Dist::EXEC %>-windows-service' $args
+function <%= ChefUtils::Dist::Infra::EXEC %>-windows-service {
+ Run-RubyCommand '<%= ChefUtils::Dist::Infra::EXEC %>-windows-service' $args
}
function knife {
Run-RubyCommand 'knife' $args
}
-Export-ModuleMember -function <%= Chef::Dist::APPLY %>
-Export-ModuleMember -function <%= Chef::Dist::CLIENT %>
-Export-ModuleMember -function <%= Chef::Dist::EXEC %>-service-manager
-Export-ModuleMember -function <%= Chef::Dist::SHELL %>
-Export-ModuleMember -function <%= Chef::Dist::SOLOEXEC %>
-Export-ModuleMember -function <%= Chef::Dist::EXEC %>-windows-service
+Export-ModuleMember -function <%= ChefUtils::Dist::Apply::EXEC %>
+Export-ModuleMember -function <%= ChefUtils::Dist::Infra::CLIENT %>
+Export-ModuleMember -function <%= ChefUtils::Dist::Infra::EXEC %>-service-manager
+Export-ModuleMember -function <%= ChefUtils::Dist::Infra::SHELL %>
+Export-ModuleMember -function <%= ChefUtils::Dist::Solo::EXEC %>
+Export-ModuleMember -function <%= ChefUtils::Dist::Infra::EXEC %>-windows-service
Export-ModuleMember -function knife
# To debug this module, uncomment the line below
diff --git a/docs/dev/design_documents/client_release_cadence.md b/docs/dev/design_documents/client_release_cadence.md
index b3a9f741ec..21fa5546d9 100644
--- a/docs/dev/design_documents/client_release_cadence.md
+++ b/docs/dev/design_documents/client_release_cadence.md
@@ -1,17 +1,15 @@
-# Chef Release Cadence
+# Chef Infra Client Release Cadence
-Chef follows [Semantic Versioning](https://semver.org/) for releases. Major versions (eg. 11.x -> 12.x) will include backwards-incompatible changes. Minor versions (eg 12.1 -> 12.2) will include new features and bug fixes, but will be backwards-compatible to the best of our ability. Patch releases will contain bug and security fixes only.
+Chef Infra Client follows [Semantic Versioning](https://semver.org/) for releases. Major versions (eg. 16.x -> 17.x) will include backwards-incompatible changes. Minor versions (eg 16.7 -> 16.8) will include new features and bug fixes, but will be backwards-compatible to the best of our ability. Patch releases will contain bug and security fixes only.
-Chef feature releases are promoted to the stable channel once per month. It is expected that this occur during the second week of the month unless circumstances intervene. Additional patch releases for a given feature release may be promoted if critical issues are found.
+Chef Infra Client feature releases are promoted to the stable channel once per month. It is expected that this occur during the second week of the month unless circumstances intervene. Additional patch releases for a given feature release may be promoted if critical issues are found.
-ChefDK is released once per month. It is expected that this occur during the fourth week of the month unless circumstances intervene.
-
-Both Chef and ChefDK will prepare a release candidate before the target release date, usually in the week before but at least three business days before release.
+Chef Workstation is released once per month in order to pull in the latest Chef Infra Client. It is expected that this occur during the fourth week of the month unless circumstances intervene.
The Chef release in April of each year is a major version release, which will contain backwards-incompatible changes. A reminder notice will be sent via Discourse and Slack in March that will summarize the changes slated for the release.
## Rationale
-Monthly releases help ensure we get new features and minor bug fixes out to Chef users in a timely fashion while not overloading the maintainer teams. Similarly, offsetting the Chef and ChefDK releases allows the full attention of the Chef development team on each of those releases, and leaves time for any potential hot fixes or follow-up.
+Monthly releases help ensure we get new features and minor bug fixes out to Chef Infra users in a timely fashion while not overloading the maintainer teams. Similarly, offsetting the Chef Infra Client and Chef Workstation releases allows Workstation to ship with current Chef Infra Client releases.
Major releases in April avoids releasing during winter holidays, summer vacations, ChefConf, and Chef Summits.
diff --git a/docs/dev/design_documents/data_collector.md b/docs/dev/design_documents/data_collector.md
index 889306e026..67782ed9ba 100644
--- a/docs/dev/design_documents/data_collector.md
+++ b/docs/dev/design_documents/data_collector.md
@@ -507,11 +507,12 @@ Chef::Config[:data_collector][:token] = "mytoken"
This works for chef-clients, which are configured to hit a Chef server, but use a custom non-Chef-Automate endpoint for reporting, or for chef-solo/zero users.
-XXX: There is also the `Chef::Config[:data_collector][:output_locations] = { uri: [ "https://chef.acme.local/myendpoint.html" ] }` method, which will behave differently, particularly on non-chef-solo use cases.
+XXX: There is also the `Chef::Config[:data_collector][:output_locations] = { urls: [ "https://chef.acme.local/myendpoint.html" ] }` method, which will behave differently, particularly on non-chef-solo use cases.
In that case, the Data Collector `server_url` will still be automatically derived from the `chef_server_url` and the Data Collector will attempt to contact that endpoint.
But with the token being supplied, the Data Collector will use that token and will not use Chef Server authentication.
Thus, the server should 403 back.
-Also, if `raise_on_failure` is left to the default of `false`, then the Data Collector will simply drop that failure and continue without raising, which will appear to work, and output will be send to the configured `output_locations`.
+Also, if `raise_on_failure` is left to the default of `false`, then the Data Collector will simply drop that failure and continue without raising, which will appear to work, and output will be send to the configured `output_locations`.
+
Note that the presence of a token flips all external URIs to using the token. So it is **not** possible to use this feature to talk to both a Chef Automate endpoint and a custom URI reporting endpoint.
This would seem to be the most useful of an incredibly marginally useful feature and it does not work.
But given how hopelessly complicated this is, the recommendation is to use the `server_url` and to avoid using any `url` options in the `output_locations` since that feature is fairly poorly designed at this point in time.
diff --git a/docs/dev/how_to/bumping_the_major_version.md b/docs/dev/how_to/bumping_the_major_version.md
index ff93f5bcf6..ca739d9f31 100644
--- a/docs/dev/how_to/bumping_the_major_version.md
+++ b/docs/dev/how_to/bumping_the_major_version.md
@@ -8,20 +8,28 @@ Chef consumes Ohai from GitHub as both a runtime dependency and a testing depend
### Create a new stable branch of Ohai
-On your local machine fork the current master branch to a new stable branch. For example: `git checkout -b 15-stable`. You'll then want to edit the Expeditor config.yml file to update the branch configs like this:
+1. Edit the Expeditor config for the new branch, which you'll create shortly:
-https://github.com/chef/ohai/commit/ad208165619425dd7886b2de3f168b49ded25146
+ - Example config change commit: https://github.com/chef/ohai/commit/1ad8c5946606a7f08ffb841e3682ae2d4991077f
-With the expeditor config complete push the branch `git push --set-upstream origin 15-stable`
+2. On your local machine fork the current master branch to a new stable branch. For example: `git checkout -b 16-stable`.
+
+3. Push the branch `git push --set-upstream origin 16-stable`
### Bump Ohai master to the new major version
-Create a PR which:
+Starting from the master branch create a PR which:
- Edits the `VERSION` file in the root of the repository to the new major release
-- Updates the `chef-config` dependency to allow for the new major release of Chef Infra in `ohai.gemspec`
+- Updates the `chef-config` and `chef-utils` dependencies to allow for the new major release of Chef Infra in `ohai.gemspec`
+
+## Update chef/chef
+
+### Prep master branch for forking
-## Fork Chef master to a stable branch
+- In ./expeditor/config.yml add the version_constraint for the new branch, update the version_constraint for master to match the new planned major version and add a constraint for the new stable version / branch
+
+### Fork Chef master to a stable branch
Before bumping the major version of Chef Infra we want to fork off the current master to a new stable branch, which will be used to build hotfix releases. We support the N-1 version of Chef Infra Client for a year after the release of a new major version. For example Chef Infra Client 16 was released in April 2020, at which point Chef Infra Client 15 became the N-1 release. Chef Infra Client 15 will then be maintained with critical bug and security fixes until April 2021.
@@ -31,7 +39,7 @@ On your local machine fork the current master branch to a new stable branch. For
Once you've forked to a new stable branch such as `chef-15` you'll want to create a new branch so you can build a PR, which will get this branch ready for release:
-- In ./expeditor/config.yml add the version_constraint for the new branch, update the version_constraint for master to match the new major version, and remove all the update_dep.sh subscriptions which don't work against stable branches.
+- In ./expeditor/config.yml remove all the update_dep.sh subscriptions which don't work against stable branches.
- In readme.md update the buildkite badge to point to the new stable branch image and link instead of pointing to master.
- In kitchen-tests/Gemfile update the Ohai branch to point to the new Ohai stable
- In kitchen-tests/kitchen.yml update chef_version to be your new stable version and not current. Ex: 15
@@ -41,11 +49,12 @@ Once you've forked to a new stable branch such as `chef-15` you'll want to creat
Example PR for Chef 15: https://github.com/chef/chef/pull/9236
+Note: Make sure you're making this PR against the new stable branch and not master!
+
## Bump master for the new major release
Create a PR that performs the following:
- Update the version in the VERSION file
- Update chef.gemspec to point to the new ohai major release
-- Update .expeditor/config.yml to include the new version_constraints you setup on your stable branch and an updated project alias
- run `rake dependencies:update`
diff --git a/ext/win32-eventlog/Rakefile b/ext/win32-eventlog/Rakefile
index 2cf1a40896..6addd36091 100644
--- a/ext/win32-eventlog/Rakefile
+++ b/ext/win32-eventlog/Rakefile
@@ -2,7 +2,7 @@ require "rubygems"
require "rake"
require "mkmf"
require "erb"
-require_relative "../../lib/chef/dist"
+require "chef-utils/dist"
desc "Building event log dll"
@@ -51,7 +51,7 @@ task register: EVT_SHARED_OBJECT do
begin
Win32::EventLog.add_event_source(
source: "Application",
- key_name: Chef::Dist::SHORT,
+ key_name: ChefUtils::Dist::Infra::SHORT,
event_message_file: dll_file,
category_message_file: dll_file
)
diff --git a/ext/win32-eventlog/chef-log.man.erb b/ext/win32-eventlog/chef-log.man.erb
index 2e767a8cfe..83be49b4d2 100644
--- a/ext/win32-eventlog/chef-log.man.erb
+++ b/ext/win32-eventlog/chef-log.man.erb
@@ -1,25 +1,25 @@
MessageId=10000
SymbolicName=RUN_START
Language=English
-Starting <%= Chef::Dist::PRODUCT %> run v%1
+Starting <%= ChefUtils::Dist::Infra::PRODUCT %> run v%1
.
MessageId=10001
SymbolicName=RUN_STARTED
Language=English
-Started <%= Chef::Dist::PRODUCT %> run %1
+Started <%= ChefUtils::Dist::Infra::PRODUCT %> run %1
.
MessageId=10002
SymbolicName=RUN_COMPLETED
Language=English
-Completed <%= Chef::Dist::PRODUCT %> run %1 in %2 seconds
+Completed <%= ChefUtils::Dist::Infra::PRODUCT %> run %1 in %2 seconds
.
MessageId=10003
SymbolicName=RUN_FAILED
Language=English
-Failed <%= Chef::Dist::PRODUCT %> run %1 in %2 seconds.%n
+Failed <%= ChefUtils::Dist::Infra::PRODUCT %> run %1 in %2 seconds.%n
Exception type: %3%n
Exception message: %4%n
Exception backtrace: %5%n
diff --git a/habitat/tests/spec.ps1 b/habitat/tests/spec.ps1
index 6cbdd406c2..34b3a07beb 100644
--- a/habitat/tests/spec.ps1
+++ b/habitat/tests/spec.ps1
@@ -18,7 +18,7 @@ try {
SETX GEM_PATH $($gemPath.Split("=")[1]) /m
hab pkg binlink --force $PackageIdentifier
- /hab/bin/rspec --format documentation --tag ~executables --tag ~choco_installed spec/functional
+ /hab/bin/rspec --tag ~executables --tag ~choco_installed spec/functional
if (-not $?) { throw "functional testing failed"}
} finally {
Pop-Location
diff --git a/habitat/tests/test.pester.ps1 b/habitat/tests/test.pester.ps1
index a5f665c9de..56f31e9a2f 100644
--- a/habitat/tests/test.pester.ps1
+++ b/habitat/tests/test.pester.ps1
@@ -12,8 +12,21 @@ Describe "chef-infra-client" {
$? | Should be $true
}
+ <#
+ At some point hab's argument parsing changed and it started interpreting the trailing `--version` as being
+ an argument passed to hab instead of an argument to the command passed to `hab pkg exec`.
+
+ Powershell 5.1 and 7 appear to differ in how they treat following arguments as well, such that these two
+ versions of the command fail in powershell 5.1 (which is currently what is running in the windows machines
+ in Buildkite) but pass in powershell 7 (which is currently what is running in a stock Windows 10 VM).
+
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat '--version' | Out-String).split(':')[1].Trim()
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat --version | Out-String).split(':')[1].Trim()
+
+ This version of the command passes in powershell 5.1 but fails in powershell 7.
+ #>
It "is the expected version" {
- $the_version = (hab pkg exec $PackageIdentifier chef-client.bat --version | Out-String).split(':')[1].Trim()
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat -- --version | Out-String).split(':')[1].Trim()
$the_version | Should be $PackageVersion
}
}
@@ -52,4 +65,4 @@ Describe "chef-infra-client" {
$? | Should be $true
}
}
-} \ No newline at end of file
+}
diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh
index 2fcd7dafd5..c28ab8b2cf 100755
--- a/habitat/tests/test.sh
+++ b/habitat/tests/test.sh
@@ -34,4 +34,4 @@ for executable in 'chef-client' 'ohai' 'chef-shell' 'chef-apply' 'knife' 'chef-s
done
echo "--- :mag_right: Testing ${pkg_ident} functionality"
-hab pkg exec "${pkg_ident}" rspec -f documentation --tag ~executables spec/functional || error 'failures during rspec tests'
+hab pkg exec "${pkg_ident}" rspec --tag ~executables spec/functional || error 'failures during rspec tests'
diff --git a/kitchen-tests/Gemfile b/kitchen-tests/Gemfile
index c70cf97f90..bc100ffb62 100644
--- a/kitchen-tests/Gemfile
+++ b/kitchen-tests/Gemfile
@@ -8,7 +8,4 @@ gem "kitchen-dokken", "~> 2.0"
gem "kitchen-inspec", git: "https://github.com/chef/kitchen-inspec.git", branch: "master"
gem "inspec"
gem "test-kitchen", git: "https://github.com/test-kitchen/test-kitchen.git", branch: "master"
-gem "kitchen-azurerm", git: "https://github.com/test-kitchen/kitchen-azurerm.git", branch: "master"
-
-# avoid Ruby 2.7 warnings
-gem "docker-api", git: "https://github.com/chef/docker-api.git", branch: "master"
+gem "kitchen-azurerm", git: "https://github.com/test-kitchen/kitchen-azurerm.git", branch: "master" \ No newline at end of file
diff --git a/kitchen-tests/cookbooks/end_to_end/metadata.rb b/kitchen-tests/cookbooks/end_to_end/metadata.rb
index c0c36063ae..fca8dc9c9f 100644
--- a/kitchen-tests/cookbooks/end_to_end/metadata.rb
+++ b/kitchen-tests/cookbooks/end_to_end/metadata.rb
@@ -5,7 +5,6 @@ version "1.0.0"
gem "chef-sugar"
-depends "chef-client"
depends "logrotate"
depends "multipackage"
depends "nscd"
@@ -23,6 +22,6 @@ supports "opensuseleap"
supports "fedora"
supports "amazon"
-chef_version ">= 14"
+chef_version ">= 16"
issues_url "https://github.com/chef/chef/issues"
source_url "https://github.com/chef/chef"
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb
new file mode 100644
index 0000000000..0e68582af0
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb
@@ -0,0 +1,11 @@
+chef_client_config "Create chef-client's client.rb" do
+ chef_server_url "https://localhost"
+ chef_license "accept"
+ additional_config <<~CONFIG
+ begin
+ require 'aws-sdk'
+ rescue LoadError
+ Chef::Log.warn "Failed to load aws-sdk."
+ end
+ CONFIG
+end
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_ifconfig.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_ifconfig.rb
new file mode 100644
index 0000000000..2a02636ac2
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/_ifconfig.rb
@@ -0,0 +1,15 @@
+return if fedora? && node["platform_version"] >= "33" # ifconfig does not support the new network manager keyfile format
+
+execute "create virtual interface for testing" do
+ command "ifconfig eth0:0 123.123.22.22"
+end
+
+ifconfig "33.33.33.80" do
+ bootproto "dhcp"
+ device "eth0:0"
+end
+
+ifconfig "Set eth1 to DHCP" do
+ device "eth0:0"
+ bootproto "dhcp"
+end \ No newline at end of file
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
index ba1f5e84f7..8991cf1594 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
@@ -48,10 +48,6 @@ end
ssh_known_hosts_entry "github.com"
-include_recipe "chef-client::delete_validation"
-include_recipe "chef-client::config"
-include_recipe "::_chef_client_trusted_certificate"
-
include_recipe "openssh"
include_recipe "nscd"
@@ -87,6 +83,9 @@ user_ulimit "tomcat" do
rtprio_hard_limit 60
end
+include_recipe "::_chef_client_config"
+include_recipe "::_chef_client_trusted_certificate"
+
chef_client_cron "Run chef-client as a cron job"
chef_client_cron "Run chef-client with base recipe" do
@@ -100,6 +99,7 @@ end
chef_client_systemd_timer "Run chef-client as a systemd timer" do
interval "1hr"
+ cpu_quota 50
only_if { systemd? }
end
@@ -123,6 +123,7 @@ include_recipe "::_ohai_hint"
include_recipe "::_openssl"
include_recipe "::_tests"
include_recipe "::_mount"
+include_recipe "::_ifconfig"
# at the moment these do not run properly in docker
# we need to investigate if this is a snap on docker issue or a chef issue
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
index 14b61e4da3..5f2278538b 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
@@ -39,8 +39,7 @@ end
ssh_known_hosts_entry "github.com"
-include_recipe "chef-client::delete_validation"
-include_recipe "chef-client::config"
+include_recipe "::_chef_client_config"
include_recipe "::_chef_client_trusted_certificate"
chef_client_launchd "Every 30 mins Infra Client run" do
@@ -74,6 +73,16 @@ launchd "io.chef.testing.fake" do
action "enable"
end
+homebrew_update "update" do
+ action :update
+end
+
+homebrew_package "nethack"
+
+homebrew_package "nethack" do
+ action :purge
+end
+
include_recipe "::_dmg_package"
include_recipe "::_macos_userdefaults"
include_recipe "::_ohai_hint"
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index 3e069a43b0..58ccec9b26 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -32,6 +32,40 @@ windows_security_policy "EnableGuestAccount" do
secvalue "1"
end
+windows_firewall_profile "Domain" do
+ default_inbound_action "Allow"
+ default_outbound_action "Allow"
+ action :enable
+end
+
+windows_firewall_profile "Public" do
+ action :disable
+end
+
+windows_audit_policy "Update Some Advanced Audit Policies to Success and Failure" do
+ subcategory ["Application Generated", "Application Group Management", "Audit Policy Change"]
+ success true
+ failure true
+end
+
+windows_audit_policy "Update Some Advanced Audit Policies to Success only" do
+ subcategory ["Authentication Policy Change", "Authorization Policy Change"]
+ success true
+ failure false
+end
+
+windows_audit_policy "Update Some Advanced Audit Policies to Failure only" do
+ subcategory ["Central Policy Staging", "Certification Services", "Computer Account Management"]
+ success false
+ failure true
+end
+
+windows_audit_policy "Update Some Advanced Audit Policies to No Auditing" do
+ subcategory ["Credential Validation", "DPAPI Activity", "Detailed File Share"]
+ success false
+ failure false
+end
+
users_manage "remove sysadmin" do
group_name "sysadmin"
group_id 2300
@@ -45,8 +79,7 @@ users_manage "create sysadmin" do
action [:create]
end
-include_recipe "chef-client::delete_validation"
-include_recipe "chef-client::config"
+include_recipe "::_chef_client_config"
include_recipe "::_chef_client_trusted_certificate"
include_recipe "git"
diff --git a/kitchen-tests/kitchen.yml b/kitchen-tests/kitchen.yml
index c2aff0e6cb..53641a6602 100644
--- a/kitchen-tests/kitchen.yml
+++ b/kitchen-tests/kitchen.yml
@@ -20,7 +20,6 @@ lifecycle:
- remote: echo "Chef container's Chef / Ohai release:"
- remote: /opt/chef/bin/chef-client -v
- remote: /opt/chef/bin/ohai -v
- - remote: /opt/chef/embedded/bin/rake --version
- remote: /opt/chef/embedded/bin/bundle -v
- remote: /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc
- remote: /opt/chef/embedded/bin/appbundle-updater chef ohai <%= File.readlines('../Gemfile.lock', File.expand_path(File.dirname(__FILE__))).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; 'v' + $1 %> --tarball --github chef/ohai
@@ -48,19 +47,13 @@ platforms:
intermediate_instructions:
- RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers
-- name: debian-8
- driver:
- image: dokken/debian-8
- pid_one_command: /bin/systemd
- intermediate_instructions:
- - RUN /usr/bin/apt-get update
-
- name: debian-9
driver:
image: dokken/debian-9
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
+ - RUN /usr/bin/apt-get install ifupdown -y # we need this for /etc/network/interfaces & ifconfig resource
- name: debian-10
driver:
@@ -68,6 +61,7 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
+ - RUN /usr/bin/apt-get install ifupdown -y # we need this for /etc/network/interfaces & ifconfig resource
- name: centos-6
driver:
@@ -110,6 +104,7 @@ platforms:
intermediate_instructions:
- RUN yum -y install e2fsprogs
- RUN yum -y reinstall systemd
+ - RUN mkdir /etc/sysconfig/network-scripts # missing from the oracle image
- RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers
- name: fedora-latest
@@ -132,6 +127,7 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
+ - RUN /usr/bin/apt-get install ifupdown -y # we need this for /etc/network/interfaces & ifconfig resource
- name: ubuntu-20.04
driver:
@@ -139,6 +135,15 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
+ - RUN /usr/bin/apt-get install ifupdown -y # we need this for /etc/network/interfaces & ifconfig resource testing
+
+- name: ubuntu-20.10
+ driver:
+ image: dokken/ubuntu-20.10
+ pid_one_command: /bin/systemd
+ intermediate_instructions:
+ - RUN /usr/bin/apt-get update
+ - RUN /usr/bin/apt-get install ifupdown -y # we need this for /etc/network/interfaces & ifconfig resource testing
- name: opensuse-leap-15
driver:
@@ -146,8 +151,7 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/zypper --non-interactive update
- - RUN /usr/bin/zypper --non-interactive install cron
- - RUN /usr/bin/zypper --non-interactive install insserv-compat
+ - RUN /usr/bin/zypper --non-interactive install net-tools-deprecated # we need this for /etc/network/interfaces & ifconfig resource testing
suites:
- name: end-to-end
diff --git a/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb b/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb
new file mode 100644
index 0000000000..4cc1459b7b
--- /dev/null
+++ b/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb
@@ -0,0 +1,11 @@
+client_rb = if os.windows?
+ 'C:\chef\client.rb'
+ else
+ "/etc/chef/client.rb"
+ end
+
+describe file(client_rb) do
+ its("content") { should match(%r{chef_server_url "https://localhost"}) }
+ its("content") { should match(/chef_license "accept"/) }
+ its("content") { should match(/require 'aws-sdk'/) }
+end
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index 257f993bbe..117f498831 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -27,8 +27,10 @@ require "mixlib/cli" unless defined?(Mixlib::CLI)
require "tmpdir" unless defined?(Dir.mktmpdir)
require "rbconfig" unless defined?(RbConfig)
require_relative "application/exit_code"
-require_relative "dist"
-require "license_acceptance/acceptor"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
+module LicenseAcceptance
+ autoload :Acceptor, "license_acceptance/acceptor"
+end
class Chef
class Application
@@ -39,9 +41,6 @@ class Chef
@chef_client = nil
@chef_client_json = nil
-
- # Always switch to a readable directory. Keeps subsequent Dir.chdir() {}
- # from failing due to permissions when launched as a less privileged user.
end
# Configure mixlib-cli to always separate defaults from user-supplied CLI options
@@ -173,7 +172,7 @@ class Chef
def configure_logging
configure_log_location
logger.init(MonoLogger.new(chef_config[:log_location][0]))
- chef_config[:log_location][1..-1].each do |log_location|
+ chef_config[:log_location][1..].each do |log_location|
logger.loggers << MonoLogger.new(log_location)
end
logger.level = resolve_log_level
@@ -308,7 +307,7 @@ class Chef
end
def fork_chef_client
- logger.info "Forking #{Chef::Dist::PRODUCT} instance to converge..."
+ logger.info "Forking #{ChefUtils::Dist::Infra::PRODUCT} instance to converge..."
pid = fork do
# Want to allow forked processes to finish converging when
# TERM singal is received (exit gracefully)
@@ -317,7 +316,7 @@ class Chef
" finishing converge to exit normally (send SIGINT to terminate immediately)")
end
- client_solo = chef_config[:solo] ? "#{Chef::Dist::SOLOEXEC}" : "#{Chef::Dist::CLIENT}"
+ client_solo = chef_config[:solo] ? ChefUtils::Dist::Solo::EXEC : ChefUtils::Dist::Infra::CLIENT
$0 = "#{client_solo} worker: ppid=#{Process.ppid};start=#{Time.new.strftime("%R:%S")};"
begin
logger.trace "Forked instance now converging"
@@ -329,7 +328,7 @@ class Chef
exit 0
end
end
- logger.trace "Fork successful. Waiting for new #{Chef::Dist::CLIENT} pid: #{pid}"
+ logger.trace "Fork successful. Waiting for new #{ChefUtils::Dist::Infra::CLIENT} pid: #{pid}"
result = Process.waitpid2(pid)
handle_child_exit(result)
logger.trace "Forked instance successfully reaped (pid: #{pid})"
@@ -341,9 +340,9 @@ class Chef
return true if status.success?
message = if status.signaled?
- "#{Chef::Dist::PRODUCT} run process terminated by signal #{status.termsig} (#{Signal.list.invert[status.termsig]})"
+ "#{ChefUtils::Dist::Infra::PRODUCT} run process terminated by signal #{status.termsig} (#{Signal.list.invert[status.termsig]})"
else
- "#{Chef::Dist::PRODUCT} run process exited unsuccessfully (exit code #{status.exitstatus})"
+ "#{ChefUtils::Dist::Infra::PRODUCT} run process exited unsuccessfully (exit code #{status.exitstatus})"
end
raise Exceptions::ChildConvergeError, message
end
@@ -376,8 +375,8 @@ class Chef
chef_stacktrace_out = "Generated at #{Time.now}\n"
chef_stacktrace_out += message
- Chef::FileCache.store("#{Chef::Dist::SHORT}-stacktrace.out", chef_stacktrace_out)
- logger.fatal("Stacktrace dumped to #{Chef::FileCache.load("#{Chef::Dist::SHORT}-stacktrace.out", false)}")
+ Chef::FileCache.store("#{ChefUtils::Dist::Infra::SHORT}-stacktrace.out", chef_stacktrace_out)
+ logger.fatal("Stacktrace dumped to #{Chef::FileCache.load("#{ChefUtils::Dist::Infra::SHORT}-stacktrace.out", false)}")
logger.fatal("Please provide the contents of the stacktrace.out file if you file a bug report")
if Chef::Config[:always_dump_stacktrace]
logger.fatal(message)
diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb
index 8d64c48102..3559f8e416 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -27,13 +27,13 @@ require "fileutils" unless defined?(FileUtils)
require "tempfile" unless defined?(Tempfile)
require_relative "../providers"
require_relative "../resources"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require "license_acceptance/cli_flags/mixlib_cli"
class Chef::Application::Apply < Chef::Application
include LicenseAcceptance::CLIFlags::MixlibCLI
- banner "Usage: #{Chef::Dist::APPLY} [RECIPE_FILE | -e RECIPE_TEXT | -s] [OPTIONS]"
+ banner "Usage: #{ChefUtils::Dist::Apply::EXEC} [RECIPE_FILE | -e RECIPE_TEXT | -s] [OPTIONS]"
option :execute,
short: "-e RECIPE_TEXT",
@@ -77,6 +77,11 @@ class Chef::Application::Apply < Chef::Application
description: "Set the log level (trace, debug, info, warn, error, fatal).",
proc: lambda { |l| l.to_sym }
+ option :log_location_cli,
+ short: "-L LOGLOCATION",
+ long: "--logfile LOGLOCATION",
+ description: "Set the log file location, defaults to STDOUT - recommended for daemonizing."
+
option :always_dump_stacktrace,
long: "--[no-]always-dump-stacktrace",
boolean: true,
@@ -95,9 +100,9 @@ class Chef::Application::Apply < Chef::Application
option :version,
short: "-v",
long: "--version",
- description: "Show #{Chef::Dist::PRODUCT} version.",
+ description: "Show #{ChefUtils::Dist::Infra::PRODUCT} version.",
boolean: true,
- proc: lambda { |v| puts "#{Chef::Dist::PRODUCT}: #{::Chef::VERSION}" },
+ proc: lambda { |v| puts "#{ChefUtils::Dist::Infra::PRODUCT}: #{::Chef::VERSION}" },
exit: 0
option :why_run,
@@ -114,7 +119,7 @@ class Chef::Application::Apply < Chef::Application
option :profile_ruby,
long: "--[no-]profile-ruby",
- description: "Dump complete Ruby call graph stack of entire #{Chef::Dist::PRODUCT} run (expert only).",
+ description: "Dump complete Ruby call graph stack of entire #{ChefUtils::Dist::Infra::PRODUCT} run (expert only).",
boolean: true,
default: false
@@ -126,7 +131,7 @@ class Chef::Application::Apply < Chef::Application
option :minimal_ohai,
long: "--minimal-ohai",
- description: "Only run the bare minimum Ohai plugins #{Chef::Dist::PRODUCT} needs to function.",
+ description: "Only run the bare minimum Ohai plugins #{ChefUtils::Dist::Infra::PRODUCT} needs to function.",
boolean: true
attr_reader :json_attribs
@@ -176,7 +181,7 @@ class Chef::Application::Apply < Chef::Application
else
Chef::RunContext.new(@chef_client.node, {}, @chef_client.events)
end
- recipe = Chef::Recipe.new("(#{Chef::Dist::APPLY} cookbook)", "(#{Chef::Dist::APPLY} recipe)", run_context)
+ recipe = Chef::Recipe.new("(#{ChefUtils::Dist::Apply::EXEC} cookbook)", "(#{ChefUtils::Dist::Apply::EXEC} recipe)", run_context)
[recipe, run_context]
end
diff --git a/lib/chef/application/base.rb b/lib/chef/application/base.rb
index 1749284ea2..ad8e8b69c2 100644
--- a/lib/chef/application/base.rb
+++ b/lib/chef/application/base.rb
@@ -20,11 +20,13 @@ require_relative "../log"
require_relative "../config"
require_relative "../mixin/shell_out"
require_relative "../config_fetcher"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require_relative "../daemon"
require "chef-config/mixin/dot_d"
require "license_acceptance/cli_flags/mixlib_cli"
-require "mixlib/archive" unless defined?(Mixlib::Archive)
+module Mixlib
+ autoload :Archive, "mixlib/archive"
+end
# This is a temporary class being used as a part of an effort to reduce duplication
# between Chef::Application::Client and Chef::Application::Solo.
@@ -55,7 +57,7 @@ class Chef::Application::Base < Chef::Application
option :once,
long: "--once",
- description: "Cancel any interval or splay options, run #{Chef::Dist::PRODUCT} once and exit.",
+ description: "Cancel any interval or splay options, run #{ChefUtils::Dist::Infra::PRODUCT} once and exit.",
boolean: true
option :formatter,
@@ -78,7 +80,7 @@ class Chef::Application::Base < Chef::Application
option :profile_ruby,
long: "--[no-]profile-ruby",
- description: "Dump complete Ruby call graph stack of entire #{Chef::Dist::PRODUCT} run (expert only).",
+ description: "Dump complete Ruby call graph stack of entire #{ChefUtils::Dist::Infra::PRODUCT} run (expert only).",
boolean: true,
default: false
@@ -134,7 +136,7 @@ class Chef::Application::Base < Chef::Application
option :interval,
short: "-i SECONDS",
long: "--interval SECONDS",
- description: "Run #{Chef::Dist::PRODUCT} periodically, in seconds.",
+ description: "Run #{ChefUtils::Dist::Infra::PRODUCT} periodically, in seconds.",
proc: lambda { |s| s.to_i }
option :json_attribs,
@@ -158,12 +160,12 @@ class Chef::Application::Base < Chef::Application
option :environment,
short: "-E ENVIRONMENT",
long: "--environment ENVIRONMENT",
- description: "Set the #{Chef::Dist::PRODUCT} environment on the node."
+ description: "Set the #{ChefUtils::Dist::Infra::PRODUCT} environment on the node."
option :client_fork,
short: "-f",
long: "--[no-]fork",
- description: "Fork #{Chef::Dist::PRODUCT} process."
+ description: "Fork #{ChefUtils::Dist::Infra::PRODUCT} process."
option :why_run,
short: "-W",
@@ -190,14 +192,14 @@ class Chef::Application::Base < Chef::Application
option :version,
short: "-v",
long: "--version",
- description: "Show #{Chef::Dist::PRODUCT} version.",
+ description: "Show #{ChefUtils::Dist::Infra::PRODUCT} version.",
boolean: true,
- proc: lambda { |v| puts "#{Chef::Dist::PRODUCT}: #{::Chef::VERSION}" },
+ proc: lambda { |v| puts "#{ChefUtils::Dist::Infra::PRODUCT}: #{::Chef::VERSION}" },
exit: 0
option :minimal_ohai,
long: "--minimal-ohai",
- description: "Only run the bare minimum Ohai plugins #{Chef::Dist::PRODUCT} needs to function.",
+ description: "Only run the bare minimum Ohai plugins #{ChefUtils::Dist::Infra::PRODUCT} needs to function.",
boolean: true
option :delete_entire_chef_repo,
@@ -213,7 +215,7 @@ class Chef::Application::Base < Chef::Application
option :target,
short: "-t TARGET",
long: "--target TARGET",
- description: "Target #{Chef::Dist::PRODUCT} against a remote system or device",
+ description: "Target #{ChefUtils::Dist::Infra::PRODUCT} against a remote system or device",
proc: lambda { |target|
Chef::Log.warn "-- EXPERIMENTAL -- Target mode activated, resources and dsl may change without warning -- EXPERIMENTAL --"
target
@@ -228,7 +230,7 @@ class Chef::Application::Base < Chef::Application
option :fatal_windows_admin_check,
short: "-A",
long: "--fatal-windows-admin-check",
- description: "Fail the run when #{Chef::Dist::CLIENT} doesn't have administrator privileges on Windows.",
+ description: "Fail the run when #{ChefUtils::Dist::Infra::CLIENT} doesn't have administrator privileges on Windows.",
boolean: true
end
@@ -245,7 +247,7 @@ class Chef::Application::Base < Chef::Application
option :chef_server_url,
short: "-S CHEFSERVERURL",
long: "--server CHEFSERVERURL",
- description: "The #{Chef::Dist::SERVER_PRODUCT} URL.",
+ description: "The #{ChefUtils::Dist::Server::PRODUCT} URL.",
proc: nil
option :validation_key,
@@ -263,7 +265,7 @@ class Chef::Application::Base < Chef::Application
option :enable_reporting,
short: "-R",
long: "--enable-reporting",
- description: "(#{Chef::Dist::CLIENT} only) reporting data collection for runs.",
+ description: "(#{ChefUtils::Dist::Infra::CLIENT} only) reporting data collection for runs.",
boolean: true
option :local_mode,
@@ -274,11 +276,11 @@ class Chef::Application::Base < Chef::Application
option :chef_zero_host,
long: "--chef-zero-host HOST",
- description: "Host to start #{Chef::Dist::ZERO} on."
+ description: "Host to start #{ChefUtils::Dist::Zero::PRODUCT} on."
option :chef_zero_port,
long: "--chef-zero-port PORT",
- description: "Port (or port range) to start #{Chef::Dist::ZERO} on. Port ranges like 1000,1010 or 8889-9999 will try all given ports until one works."
+ description: "Port (or port range) to start #{ChefUtils::Dist::Zero::PRODUCT} on. Port ranges like 1000,1010 or 8889-9999 will try all given ports until one works."
option :listen,
long: "--[no-]listen",
@@ -287,7 +289,7 @@ class Chef::Application::Base < Chef::Application
option :skip_cookbook_sync,
long: "--[no-]skip-cookbook-sync",
- description: "(#{Chef::Dist::CLIENT} only) Use cached cookbooks without overwriting local differences from the #{Chef::Dist::SERVER_PRODUCT}.",
+ description: "(#{ChefUtils::Dist::Infra::CLIENT} only) Use cached cookbooks without overwriting local differences from the #{ChefUtils::Dist::Server::PRODUCT}.",
boolean: false
option :named_run_list,
@@ -326,7 +328,7 @@ class Chef::Application::Base < Chef::Application
# Run the chef client, optionally daemonizing or looping at intervals.
def run_application
if Chef::Config[:version]
- puts "#{Chef::Dist::PRODUCT} version: #{::Chef::VERSION}"
+ puts "#{ChefUtils::Dist::Infra::PRODUCT} version: #{::Chef::VERSION}"
end
if !Chef::Config[:client_fork] || Chef::Config[:once]
@@ -346,24 +348,25 @@ class Chef::Application::Base < Chef::Application
private
def windows_interval_error_message
- "Windows #{Chef::Dist::PRODUCT} interval runs are not supported in #{Chef::Dist::PRODUCT} 15 and later." +
+ "Windows #{ChefUtils::Dist::Infra::PRODUCT} interval runs are not supported in #{ChefUtils::Dist::Infra::PRODUCT} 15 and later." +
"\nConfiguration settings:" +
("\n interval = #{Chef::Config[:interval]} seconds" if Chef::Config[:interval]).to_s +
- "\nPlease manage #{Chef::Dist::PRODUCT} as a scheduled task instead."
+ "\nPlease manage #{ChefUtils::Dist::Infra::PRODUCT} as a scheduled task instead."
end
def unforked_interval_error_message
- "Unforked #{Chef::Dist::PRODUCT} interval runs are disabled by default." +
+ "Unforked #{ChefUtils::Dist::Infra::PRODUCT} interval runs are disabled by default." +
"\nConfiguration settings:" +
("\n interval = #{Chef::Config[:interval]} seconds" if Chef::Config[:interval]).to_s +
- "\nEnable #{Chef::Dist::PRODUCT} interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options."
+ "\nEnable #{ChefUtils::Dist::Infra::PRODUCT} interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options."
end
def fetch_recipe_tarball(url, path)
+ require "open-uri" unless defined?(OpenURI)
Chef::Log.trace("Download recipes tarball from #{url} to #{path}")
if File.exist?(url)
FileUtils.cp(url, path)
- elsif URI.regexp.match?(url)
+ elsif URI::DEFAULT_PARSER.make_regexp.match?(url)
File.open(path, "wb") do |f|
open(url) do |r|
f.write(r.read)
@@ -377,7 +380,7 @@ class Chef::Application::Base < Chef::Application
def interval_run_chef_client
if Chef::Config[:daemonize]
- Chef::Daemon.daemonize(Chef::Dist::PRODUCT)
+ Chef::Daemon.daemonize(ChefUtils::Dist::Infra::PRODUCT)
# Start first daemonized run after configured number of seconds
if Chef::Config[:daemonize].is_a?(Integer)
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index af942c0254..39ae7adaac 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -20,7 +20,14 @@
require_relative "base"
require_relative "../handler/error_report"
require_relative "../workstation_config_loader"
-require "uri" unless defined?(URI)
+autoload :URI, "uri"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
+module Mixlib
+ module Authentication
+ autoload :Log, "mixlib/authentication"
+ end
+end
+autoload :Train, "train"
# DO NOT MAKE EDITS, see Chef::Application::Base
#
@@ -45,7 +52,7 @@ class Chef::Application::Client < Chef::Application::Base
option :pid_file,
short: "-P PID_FILE",
long: "--pid PIDFILE",
- description: "Set the PID file location, for the #{Chef::Dist::CLIENT} daemon process. Defaults to /tmp/chef-client.pid.",
+ description: "Set the PID file location, for the #{ChefUtils::Dist::Infra::CLIENT} daemon process. Defaults to /tmp/chef-client.pid.",
proc: nil
option :runlist,
@@ -100,7 +107,7 @@ class Chef::Application::Client < Chef::Application::Base
tarball_path = File.join(Chef::Config.chef_repo_path, "recipes.tgz")
fetch_recipe_tarball(Chef::Config[:recipe_url], tarball_path)
Mixlib::Archive.new(tarball_path).extract(Chef::Config.chef_repo_path, perms: false, ignore: /^\.$/)
- config_path = File.join(Chef::Config.chef_repo_path, "#{Chef::Dist::USER_CONF_DIR}/config.rb")
+ config_path = File.join(Chef::Config.chef_repo_path, "#{ChefUtils::Dist::Infra::USER_CONF_DIR}/config.rb")
Chef::Config.from_string(IO.read(config_path), config_path) if File.file?(config_path)
end
end
@@ -109,8 +116,12 @@ class Chef::Application::Client < Chef::Application::Base
Chef::Config.chef_zero.port = config[:chef_zero_port] if config[:chef_zero_port]
if config[:target] || Chef::Config.target
- Chef::Config.target_mode.enabled = true
Chef::Config.target_mode.host = config[:target] || Chef::Config.target
+ if URI.parse(Chef::Config.target_mode.host).scheme
+ train_config = Train.unpack_target_from_uri(Chef::Config.target_mode.host)
+ Chef::Config.target_mode = train_config
+ end
+ Chef::Config.target_mode.enabled = true
Chef::Config.node_name = Chef::Config.target_mode.host unless Chef::Config.node_name
end
@@ -147,7 +158,7 @@ class Chef::Application::Client < Chef::Application::Base
if config[:local_mode]
config[:config_file] = Chef::WorkstationConfigLoader.new(nil, Chef::Log).config_location
else
- config[:config_file] = Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/client.rb")
+ config[:config_file] = Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/client.rb")
end
end
diff --git a/lib/chef/application/exit_code.rb b/lib/chef/application/exit_code.rb
index ee0621f5ce..26c181fa3d 100644
--- a/lib/chef/application/exit_code.rb
+++ b/lib/chef/application/exit_code.rb
@@ -22,7 +22,7 @@ class Chef
# These are the exit codes defined in Chef RFC 062
# https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md
class ExitCode
- require_relative "../dist"
+ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
# -1 is defined as DEPRECATED_FAILURE in RFC 062, so it is
# not enumerated in an active constant.
@@ -153,9 +153,9 @@ class Chef
end
def non_standard_exit_code_warning(exit_code)
- "#{Chef::Dist::CLIENT} attempted to exit with a non-standard exit code of #{exit_code}." \
- " The #{Chef::Dist::PRODUCT} Exit Codes design document (https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md)" \
- " defines the exit codes that should be used with #{Chef::Dist::CLIENT}. Chef::Application::ExitCode defines" \
+ "#{ChefUtils::Dist::Infra::CLIENT} attempted to exit with a non-standard exit code of #{exit_code}." \
+ " The #{ChefUtils::Dist::Infra::PRODUCT} Exit Codes design document (https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md)" \
+ " defines the exit codes that should be used with #{ChefUtils::Dist::Infra::CLIENT}. Chef::Application::ExitCode defines" \
" valid exit codes Non-standard exit codes are redefined as GENERIC_FAILURE."
end
diff --git a/lib/chef/application/knife.rb b/lib/chef/application/knife.rb
index c719768f11..7906ce6eaa 100644
--- a/lib/chef/application/knife.rb
+++ b/lib/chef/application/knife.rb
@@ -19,8 +19,10 @@ require_relative "../knife"
require_relative "../application"
require "mixlib/log"
require "ohai/config"
-require "chef/monkey_patches/net_http.rb"
-require_relative "../dist"
+module Net
+ autoload :HTTP, "net/http"
+end
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef::Application::Knife < Chef::Application
@@ -59,7 +61,7 @@ class Chef::Application::Knife < Chef::Application
option :environment,
short: "-E ENVIRONMENT",
long: "--environment ENVIRONMENT",
- description: "Set the #{Chef::Dist::PRODUCT} environment (except for in searches, where this will be flagrantly ignored)."
+ description: "Set the #{ChefUtils::Dist::Infra::PRODUCT} environment (except for in searches, where this will be flagrantly ignored)."
option :editor,
short: "-e EDITOR",
@@ -84,18 +86,18 @@ class Chef::Application::Knife < Chef::Application
option :node_name,
short: "-u USER",
long: "--user USER",
- description: "#{Chef::Dist::SERVER_PRODUCT} API client username."
+ description: "#{ChefUtils::Dist::Server::PRODUCT} API client username."
option :client_key,
short: "-k KEY",
long: "--key KEY",
- description: "#{Chef::Dist::SERVER_PRODUCT} API client key.",
+ description: "#{ChefUtils::Dist::Server::PRODUCT} API client key.",
proc: lambda { |path| File.expand_path(path, Dir.pwd) }
option :chef_server_url,
short: "-s URL",
long: "--server-url URL",
- description: "#{Chef::Dist::SERVER_PRODUCT} URL."
+ description: "#{ChefUtils::Dist::Server::PRODUCT} URL."
option :yes,
short: "-y",
@@ -120,16 +122,16 @@ class Chef::Application::Knife < Chef::Application
option :local_mode,
short: "-z",
long: "--local-mode",
- description: "Point knife commands at local repository instead of #{Chef::Dist::SERVER_PRODUCT}.",
+ description: "Point knife commands at local repository instead of #{ChefUtils::Dist::Server::PRODUCT}.",
boolean: true
option :chef_zero_host,
long: "--chef-zero-host HOST",
- description: "Host to start #{Chef::Dist::ZERO} on."
+ description: "Host to start #{ChefUtils::Dist::Zero::PRODUCT} on."
option :chef_zero_port,
long: "--chef-zero-port PORT",
- description: "Port (or port range) to start #{Chef::Dist::ZERO} on. Port ranges like 1000,1010 or 8889-9999 will try all given ports until one works."
+ description: "Port (or port range) to start #{ChefUtils::Dist::Zero::PRODUCT} on. Port ranges like 1000,1010 or 8889-9999 will try all given ports until one works."
option :listen,
long: "--[no-]listen",
@@ -139,9 +141,9 @@ class Chef::Application::Knife < Chef::Application
option :version,
short: "-v",
long: "--version",
- description: "Show #{Chef::Dist::PRODUCT} version.",
+ description: "Show #{ChefUtils::Dist::Infra::PRODUCT} version.",
boolean: true,
- proc: lambda { |v| puts "#{Chef::Dist::PRODUCT}: #{::Chef::VERSION}" },
+ proc: lambda { |v| puts "#{ChefUtils::Dist::Infra::PRODUCT}: #{::Chef::VERSION}" },
exit: 0
option :fips,
@@ -214,6 +216,15 @@ class Chef::Application::Knife < Chef::Application
rescue OptionParser::InvalidOption => e
puts "#{e}\n"
end
+
+ if want_help?
+ puts "#{ChefUtils::Dist::Infra::PRODUCT}: #{Chef::VERSION}"
+ puts
+ puts "Docs: #{ChefUtils::Dist::Org::KNIFE_DOCS}"
+ puts "Patents: #{ChefUtils::Dist::Org::PATENTS}"
+ puts
+ end
+
puts opt_parser
puts
Chef::Knife.list_commands
diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb
index 9953d298a2..8264393bb9 100644
--- a/lib/chef/application/solo.rb
+++ b/lib/chef/application/solo.rb
@@ -21,6 +21,7 @@ require_relative "../../chef"
require_relative "client"
require "fileutils" unless defined?(FileUtils)
require "pathname" unless defined?(Pathname)
+require "chef-utils" unless defined?(ChefUtils::CANARY)
# DO NOT MAKE EDITS, see Chef::Application::Base
#
@@ -33,7 +34,7 @@ class Chef::Application::Solo < Chef::Application::Base
option :config_file,
short: "-c CONFIG",
long: "--config CONFIG",
- default: Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/solo.rb"),
+ default: Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/solo.rb"),
description: "The configuration file to use."
unless ChefUtils.windows?
diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb
index 770a5644ca..8975556f75 100644
--- a/lib/chef/application/windows_service.rb
+++ b/lib/chef/application/windows_service.rb
@@ -29,7 +29,7 @@ require "socket" unless defined?(Socket)
require "uri" unless defined?(URI)
require "win32/daemon"
require_relative "../mixin/shell_out"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Application
@@ -41,7 +41,7 @@ class Chef
short: "-c CONFIG",
long: "--config CONFIG",
default: "#{Chef::Config.etc_chef_dir}/client.rb",
- description: "The configuration file to use for #{Chef::Dist::PRODUCT} runs."
+ description: "The configuration file to use for #{ChefUtils::Dist::Infra::PRODUCT} runs."
option :log_location,
short: "-L LOGLOCATION",
@@ -57,7 +57,7 @@ class Chef
option :interval,
short: "-i SECONDS",
long: "--interval SECONDS",
- description: "Set the number of seconds to wait between #{Chef::Dist::PRODUCT} runs.",
+ description: "Set the number of seconds to wait between #{ChefUtils::Dist::Infra::PRODUCT} runs.",
proc: lambda { |s| s.to_i }
DEFAULT_LOG_LOCATION ||= "#{Chef::Config.c_chef_dir}/client.log".freeze
@@ -67,7 +67,7 @@ class Chef
@service_signal = ConditionVariable.new
reconfigure
- Chef::Log.info("#{Chef::Dist::CLIENT} Service initialized")
+ Chef::Log.info("#{ChefUtils::Dist::Infra::CLIENT} Service initialized")
end
def service_main(*startup_parameters)
@@ -79,7 +79,7 @@ class Chef
# Grab the service_action_mutex to make a chef-client run
@service_action_mutex.synchronize do
- Chef::Log.info("Next #{Chef::Dist::CLIENT} run will happen in #{timeout} seconds")
+ Chef::Log.info("Next #{ChefUtils::Dist::Infra::CLIENT} run will happen in #{timeout} seconds")
@service_signal.wait(@service_action_mutex, timeout)
# Continue only if service is RUNNING
@@ -96,7 +96,7 @@ class Chef
# run chef-client only if service is in RUNNING state
next if state != RUNNING
- Chef::Log.info("#{Chef::Dist::CLIENT} service is starting a #{Chef::Dist::CLIENT} run...")
+ Chef::Log.info("#{ChefUtils::Dist::Infra::CLIENT} service is starting a #{ChefUtils::Dist::Infra::CLIENT} run...")
run_chef_client
rescue SystemExit => e
# Do not raise any of the errors here in order to
@@ -131,12 +131,12 @@ class Chef
break
else
unless run_warning_displayed
- Chef::Log.info("Currently a #{Chef::Dist::PRODUCT} run is happening on this system.")
+ Chef::Log.info("Currently a #{ChefUtils::Dist::Infra::PRODUCT} run is happening on this system.")
Chef::Log.info("Service will stop when run is completed.")
run_warning_displayed = true
end
- Chef::Log.trace("Waiting for #{Chef::Dist::PRODUCT} run...")
+ Chef::Log.trace("Waiting for #{ChefUtils::Dist::Infra::PRODUCT} run...")
sleep 1
end
end
@@ -150,7 +150,7 @@ class Chef
# since this is a PAUSE signal.
if @service_action_mutex.locked?
- Chef::Log.info("Currently a #{Chef::Dist::PRODUCT} run is happening.")
+ Chef::Log.info("Currently a #{ChefUtils::Dist::Infra::PRODUCT} run is happening.")
Chef::Log.info("Service will pause once it's completed.")
else
Chef::Log.info("Service is pausing....")
@@ -185,7 +185,7 @@ class Chef
# The log_location and config_file of the parent process is passed to the new chef-client process.
# We need to add the --no-fork, as by default it is set to fork=true.
- Chef::Log.info "Starting #{Chef::Dist::CLIENT} in a new process"
+ Chef::Log.info "Starting #{ChefUtils::Dist::Infra::CLIENT} in a new process"
# Pass config params to the new process
config_params = " --no-fork"
config_params += " -c #{Chef::Config[:config_file]}" unless Chef::Config[:config_file].nil?
@@ -197,20 +197,20 @@ class Chef
# Starts a new process and waits till the process exits
result = shell_out(
- "#{Chef::Dist::CLIENT}.bat #{config_params}",
+ "#{ChefUtils::Dist::Infra::CLIENT}.bat #{config_params}",
timeout: Chef::Config[:windows_service][:watchdog_timeout],
logger: Chef::Log
)
Chef::Log.trace (result.stdout).to_s
Chef::Log.trace (result.stderr).to_s
rescue Mixlib::ShellOut::CommandTimeout => e
- Chef::Log.error "#{Chef::Dist::CLIENT} timed out\n(#{e})"
+ Chef::Log.error "#{ChefUtils::Dist::Infra::CLIENT} timed out\n(#{e})"
Chef::Log.error(<<-EOF)
- Your #{Chef::Dist::CLIENT} run timed out. You can increase the time #{Chef::Dist::CLIENT} is given
+ Your #{ChefUtils::Dist::Infra::CLIENT} run timed out. You can increase the time #{ChefUtils::Dist::Infra::CLIENT} is given
to complete by configuring windows_service.watchdog_timeout in your client.rb.
EOF
rescue Mixlib::ShellOut::ShellCommandFailed => e
- Chef::Log.warn "Not able to start #{Chef::Dist::CLIENT} in new process (#{e})"
+ Chef::Log.warn "Not able to start #{ChefUtils::Dist::Infra::CLIENT} in new process (#{e})"
rescue => e
Chef::Log.error e
ensure
diff --git a/lib/chef/application/windows_service_manager.rb b/lib/chef/application/windows_service_manager.rb
index 25ac72e014..4f0de26411 100644
--- a/lib/chef/application/windows_service_manager.rb
+++ b/lib/chef/application/windows_service_manager.rb
@@ -21,7 +21,7 @@ if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
end
require_relative "../config"
require "mixlib/cli" unless defined?(Mixlib::CLI)
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Application
@@ -41,18 +41,18 @@ class Chef
short: "-a ACTION",
long: "--action ACTION",
default: "status",
- description: "Action to carry out on #{Chef::Dist::SHORT}-service (install, uninstall, status, start, stop, pause, or resume)."
+ description: "Action to carry out on #{ChefUtils::Dist::Infra::SHORT}-service (install, uninstall, status, start, stop, pause, or resume)."
option :config_file,
short: "-c CONFIG",
long: "--config CONFIG",
default: "#{ChefConfig::Config.c_chef_dir}/client.rb",
- description: "The configuration file to use for #{Chef::Dist::PRODUCT} runs."
+ description: "The configuration file to use for #{ChefUtils::Dist::Infra::PRODUCT} runs."
option :log_location,
short: "-L LOGLOCATION",
long: "--logfile LOGLOCATION",
- description: "Set the log file location for #{Chef::Dist::SHORT}-service."
+ description: "Set the log file location for #{ChefUtils::Dist::Infra::SHORT}-service."
option :help,
short: "-h",
@@ -66,9 +66,9 @@ class Chef
option :version,
short: "-v",
long: "--version",
- description: "Show #{Chef::Dist::PRODUCT} version.",
+ description: "Show #{ChefUtils::Dist::Infra::PRODUCT} version.",
boolean: true,
- proc: lambda { |v| puts "#{Chef::Dist::PRODUCT}: #{::Chef::VERSION}" },
+ proc: lambda { |v| puts "#{ChefUtils::Dist::Infra::PRODUCT}: #{::Chef::VERSION}" },
exit: 0
def initialize(service_options)
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb
index d7541a592e..eeeb96e38b 100644
--- a/lib/chef/chef_fs/chef_fs_data_store.rb
+++ b/lib/chef/chef_fs/chef_fs_data_store.rb
@@ -265,7 +265,7 @@ class Chef
@memory_store.get(path)
elsif path[0] == "file_store" && path[1] == "repo"
- entry = Chef::ChefFS::FileSystem.resolve_path(chef_fs, path[2..-1].join("/"))
+ entry = Chef::ChefFS::FileSystem.resolve_path(chef_fs, path[2..].join("/"))
begin
entry.read
rescue Chef::ChefFS::FileSystem::NotFoundError => e
diff --git a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
index 222e6069f3..ee1480c62e 100644
--- a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
+++ b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
@@ -24,7 +24,7 @@ class Chef
end
def preserve_key?(key)
- key == "cookbook_name" || key == "version"
+ %w{cookbook_name version}.include?(key)
end
def chef_class
diff --git a/lib/chef/chef_fs/file_pattern.rb b/lib/chef/chef_fs/file_pattern.rb
index 163319032b..37e72f379b 100644
--- a/lib/chef/chef_fs/file_pattern.rb
+++ b/lib/chef/chef_fs/file_pattern.rb
@@ -204,7 +204,7 @@ class Chef
end
# Skip // and /./ (pretend it's not there)
- if exact == "" || exact == "."
+ if ["", "."].include?(exact)
next
end
diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb
index d01d24c360..d28bb65db6 100644
--- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb
+++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb
@@ -64,7 +64,7 @@ class Chef
if is_dir
return recursive && name != "." && name != ".."
elsif ruby_only
- return false if name[-3..-1] != ".rb"
+ return false if name[-3..] != ".rb"
end
# Check chefignore
diff --git a/lib/chef/chef_fs/knife.rb b/lib/chef/chef_fs/knife.rb
index 1e5f786b1d..ba993beee4 100644
--- a/lib/chef/chef_fs/knife.rb
+++ b/lib/chef/chef_fs/knife.rb
@@ -18,7 +18,7 @@
require_relative "../knife"
require "pathname" unless defined?(Pathname)
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
module ChefFS
@@ -49,7 +49,7 @@ class Chef
option :chef_repo_path,
long: "--chef-repo-path PATH",
- description: "Overrides the location of #{Chef::Dist::PRODUCT} repo. Default is specified by chef_repo_path in the config"
+ description: "Overrides the location of #{ChefUtils::Dist::Infra::PRODUCT} repo. Default is specified by chef_repo_path in the config"
option :concurrency,
long: "--concurrency THREADS",
diff --git a/lib/chef/chef_fs/parallelizer.rb b/lib/chef/chef_fs/parallelizer.rb
index be7d93c669..c4d17a842d 100644
--- a/lib/chef/chef_fs/parallelizer.rb
+++ b/lib/chef/chef_fs/parallelizer.rb
@@ -1,4 +1,3 @@
-require "thread"
require_relative "parallelizer/parallel_enumerable"
class Chef
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index 91d1758f70..094b59fc35 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -29,7 +29,7 @@ require_relative "api_client/registration"
require_relative "node"
require_relative "role"
require_relative "file_cache"
-require_relative "run_context"
+Chef.autoload :RunContext, File.expand_path("run_context", __dir__)
require_relative "runner"
require_relative "run_status"
require_relative "cookbook/cookbook_collection"
@@ -48,16 +48,17 @@ require_relative "action_collection"
require_relative "resource_reporter"
require_relative "data_collector"
require_relative "run_lock"
-require_relative "policy_builder"
+Chef.autoload :PolicyBuilder, File.expand_path("policy_builder", __dir__)
require_relative "request_id"
require_relative "platform/rebooter"
require_relative "mixin/deprecation"
require "chef-utils" unless defined?(ChefUtils::CANARY)
require "ohai" unless defined?(Ohai::System)
require "rbconfig" unless defined?(RbConfig)
-require_relative "dist"
require "forwardable" unless defined?(Forwardable)
+require_relative "compliance/runner"
+
class Chef
# == Chef::Client
# The main object in a Chef run. Preps a Chef::Node and Chef::RunContext,
@@ -236,6 +237,7 @@ class Chef
events.register(Chef::DataCollector::Reporter.new(events))
events.register(Chef::ActionCollection.new(events))
+ events.register(Chef::Compliance::Runner.new)
run_status.run_id = request_id = Chef::RequestID.instance.request_id
@@ -244,19 +246,15 @@ class Chef
run_status.run_context = run_context
events.run_start(Chef::VERSION, run_status)
-
- logger.info("*** #{Chef::Dist::PRODUCT} #{Chef::VERSION} ***")
+ logger.info("*** #{ChefUtils::Dist::Infra::PRODUCT} #{Chef::VERSION} ***")
logger.info("Platform: #{RUBY_PLATFORM}")
- logger.info "#{Chef::Dist::CLIENT.capitalize} pid: #{Process.pid}"
+ logger.info "#{ChefUtils::Dist::Infra::CLIENT.capitalize} pid: #{Process.pid}"
logger.info "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
- logger.debug("#{Chef::Dist::CLIENT.capitalize} request_id: #{request_id}")
+ logger.debug("#{ChefUtils::Dist::Infra::CLIENT.capitalize} request_id: #{request_id}")
+ logger.warn("`enforce_path_sanity` is deprecated, please use `enforce_default_paths` instead!") if Chef::Config[:enforce_path_sanity]
ENV["PATH"] = ChefUtils::DSL::DefaultPaths.default_paths if Chef::Config[:enforce_default_paths] || Chef::Config[:enforce_path_sanity]
- if Chef::Config.target_mode?
- get_ohai_data_remotely
- else
- run_ohai
- end
+ run_ohai
unless Chef::Config[:solo_legacy_mode]
register
@@ -273,7 +271,7 @@ class Chef
build_node
run_status.start_clock
- logger.info("Starting #{Chef::Dist::PRODUCT} Run for #{node.name}")
+ logger.info("Starting #{ChefUtils::Dist::Infra::PRODUCT} Run for #{node.name}")
run_started
do_windows_admin_check
@@ -288,7 +286,7 @@ class Chef
converge_and_save(run_context)
run_status.stop_clock
- logger.info("#{Chef::Dist::PRODUCT} Run complete in #{run_status.elapsed_time} seconds")
+ logger.info("#{ChefUtils::Dist::Infra::PRODUCT} Run complete in #{run_status.elapsed_time} seconds")
run_completed_successfully
events.run_completed(node, run_status)
@@ -334,7 +332,7 @@ class Chef
eol_year = 2006 + Gem::Version.new(Chef::VERSION).segments.first
if Time.now > Time.new(eol_year, 5, 01)
- logger.warn("This release of #{Chef::Dist::PRODUCT} became end of life (EOL) on May 1st #{eol_year}. Please update to a supported release to receive new features, bug fixes, and security updates.")
+ logger.warn("This release of #{ChefUtils::Dist::Infra::PRODUCT} became end of life (EOL) on May 1st #{eol_year}. Please update to a supported release to receive new features, bug fixes, and security updates.")
end
end
@@ -577,32 +575,6 @@ class Chef
end
#
- # Populate the minimal ohai attributes defined in #run_ohai with data train collects.
- #
- # Eventually ohai may support colleciton of data.
- #
- def get_ohai_data_remotely
- ohai.data[:fqdn] = if transport_connection.respond_to?(:hostname)
- transport_connection.hostname
- else
- Chef::Config[:target_mode][:host]
- end
- if transport_connection.respond_to?(:os)
- ohai.data[:platform] = transport_connection.os.name
- ohai.data[:platform_version] = transport_connection.os.release
- ohai.data[:os] = transport_connection.os.family_hierarchy[1]
- ohai.data[:platform_family] = transport_connection.os.family
- end
- # train does not collect these specifically
- # ohai.data[:machinename] = nil
- # ohai.data[:hostname] = nil
- # ohai.data[:os_version] = nil # kernel version
-
- ohai.data[:ohai_time] = Time.now.to_f
- events.ohai_completed(node)
- end
-
- #
# Run ohai plugins. Runs all ohai plugins unless minimal_ohai is specified.
#
# Sends the ohai_completed event when finished.
@@ -614,6 +586,7 @@ class Chef
#
def run_ohai
filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version ohai_time os os_version init_package} : nil
+ ohai.transport_connection = transport_connection if Chef::Config.target_mode?
ohai.all_plugins(filter)
events.ohai_completed(node)
end
@@ -763,7 +736,7 @@ class Chef
logger.trace("Checking for administrator privileges....")
if !has_admin_privileges?
- message = "#{Chef::Dist::CLIENT} doesn't have administrator privileges on node #{node_name}."
+ message = "#{ChefUtils::Dist::Infra::CLIENT} doesn't have administrator privileges on node #{node_name}."
if Chef::Config[:fatal_windows_admin_check]
logger.fatal(message)
logger.fatal("fatal_windows_admin_check is set to TRUE.")
@@ -772,7 +745,7 @@ class Chef
logger.warn("#{message} This might cause unexpected resource failures.")
end
else
- logger.trace("#{Chef::Dist::CLIENT} has administrator privileges on node #{node_name}.")
+ logger.trace("#{ChefUtils::Dist::Infra::CLIENT} has administrator privileges on node #{node_name}.")
end
end
end
diff --git a/lib/chef/compliance/default_attributes.rb b/lib/chef/compliance/default_attributes.rb
new file mode 100644
index 0000000000..9b368d4f64
--- /dev/null
+++ b/lib/chef/compliance/default_attributes.rb
@@ -0,0 +1,93 @@
+# Author:: Stephan Renatus <srenatus@chef.io>
+# Copyright:: (c) 2016-2019, Chef Software Inc. <legal@chef.io>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require "chef/node/attribute_collections" # for VividMash
+require "chef/util/path_helper"
+
+class Chef
+ module Compliance
+ DEFAULT_ATTRIBUTES = Chef::Node::VividMash.new(
+ # If enabled, a cache is built for all backend calls. This should only be
+ # disabled if you are expecting unique results from the same backend call.
+ # Under the covers, this controls :command and :file caching on Chef InSpec's
+ # Train connection.
+ "inspec_backend_cache" => true,
+
+ # Controls what is done with the resulting report after the Chef InSpec run.
+ # Accepts a single string value or an array of multiple values.
+ # Accepted values: 'chef-server-automate', 'chef-automate', 'json-file', 'audit-enforcer'
+ "reporter" => "json-file",
+
+ # Controls if Chef InSpec profiles should be fetched from Chef Automate or Chef Infra Server
+ # in addition to the default fetch locations provided by Chef Inspec.
+ # Accepted values: nil, 'chef-server', 'chef-automate'
+ "fetcher" => nil,
+
+ # Allow for connections to HTTPS endpoints using self-signed ssl certificates.
+ "insecure" => nil,
+
+ # Controls verbosity of Chef InSpec runner.
+ "quiet" => true,
+
+ # Chef Inspec Compliance profiles to be used for scan of node.
+ # See README.md for details
+ "profiles" => {},
+
+ # Extra inputs passed to Chef InSpec to allow finer-grained control over behavior.
+ # These are mapped to Chef InSpec's inputs, but are named attributes here for legacy reasons.
+ # See Chef Inspec's documentation for more information: https://docs.chef.io/inspec/inputs/
+ "attributes" => {},
+
+ # A string path or an array of paths to Chef InSpec waiver files.
+ # See Chef Inspec's documentation for more information: https://docs.chef.io/inspec/waivers/
+ "waiver_file" => nil,
+
+ "json_file" => {
+ # The location on disk that Chef InSpec's json reports are saved to when using the
+ # 'json-file' reporter. Defaults to:
+ # <chef_cache_path>/compliance_reports/compliance-<timestamp>.json
+ "location" => Chef::Util::PathHelper.join(
+ Chef::Config[:cache_path],
+ "compliance_reports",
+ Time.now.utc.strftime("compliance-%Y%m%d%H%M%S.json")
+ ),
+ },
+
+ # Control results that have a `run_time` below this limit will
+ # be stripped of the `start_time` and `run_time` fields to
+ # reduce the size of the reports being sent to Chef Automate.
+ "run_time_limit" => 1.0,
+
+ # A control result message that exceeds this character limit will be truncated.
+ # This helps keep reports to a reasonable size. On rare occasions, we've seen messages exceeding 9 MB in size,
+ # causing the report to not be ingested in the backend because of the 4 MB report size rpc limitation.
+ # Chef InSpec will append this text at the end of any truncated messages: `[Truncated to 10000 characters]`
+ "result_message_limit" => 10000,
+
+ # When a Chef InSpec resource throws an exception, results will contain a short error message and a
+ # detailed ruby stacktrace of the error. This attribute instructs Chef InSpec not to include the detailed stacktrace in order
+ # to keep the overall report to a manageable size.
+ "result_include_backtrace" => false,
+
+ # The array of results per control will be truncated at this limit to avoid large reports that cannot be
+ # processed by Chef Automate. A summary of removed results will be sent with each impacted control.
+ "control_results_limit" => 50,
+
+ # If enabled, a hash representation of the Chef Infra node object will be sent to Chef InSpec in an input
+ # named `chef_node`.
+ "chef_node_attribute_enabled" => false
+ )
+ end
+end
diff --git a/lib/chef/compliance/fetcher/automate.rb b/lib/chef/compliance/fetcher/automate.rb
new file mode 100644
index 0000000000..b254684280
--- /dev/null
+++ b/lib/chef/compliance/fetcher/automate.rb
@@ -0,0 +1,69 @@
+require "uri" unless defined?(URI)
+require "plugins/inspec-compliance/lib/inspec-compliance"
+
+class Chef
+ module Compliance
+ module Fetcher
+ class Automate < ::InspecPlugins::Compliance::Fetcher
+ name "chef-automate"
+
+ # Positions this fetcher before Chef InSpec's `compliance` fetcher.
+ # Only load this file if you want to use Compliance Phase in Chef Solo with Chef Automate.
+ priority 502
+
+ CONFIG = {
+ "insecure" => true,
+ "token" => nil,
+ "server_type" => "automate",
+ "automate" => {
+ "ent" => "default",
+ "token_type" => "dctoken",
+ },
+ }.freeze
+
+ def self.resolve(target)
+ uri = get_target_uri(target)
+ return nil if uri.nil?
+
+ config = CONFIG.dup
+
+ # we have detailed information available in our lockfile, no need to ask the server
+ if target.respond_to?(:key?) && target.key?(:url)
+ profile_fetch_url = target[:url]
+ else
+ # verifies that the target e.g base/ssh exists
+ base_path = "/compliance/profiles/#{uri.host}#{uri.path}"
+
+ profile_path = if target.respond_to?(:key?) && target.key?(:version)
+ "#{base_path}/version/#{target[:version]}/tar"
+ else
+ "#{base_path}/tar"
+ end
+
+ url = URI(Chef::Config[:data_collector][:server_url])
+ url.path = profile_path
+ profile_fetch_url = url.to_s
+
+ config["token"] = Chef::Config[:data_collector][:token]
+
+ if config["token"].nil?
+ raise Inspec::FetcherFailure,
+ "No data-collector token set, which is required by the chef-automate fetcher. " \
+ "Set the `data_collector.token` configuration parameter in your client.rb " \
+ 'or use the "chef-server-automate" reporter which does not require any ' \
+ "data-collector settings and uses #{ChefUtils::Dist::Server::PRODUCT} to fetch profiles."
+ end
+ end
+
+ new(profile_fetch_url, config)
+ rescue URI::Error => _e
+ nil
+ end
+
+ def to_s
+ "#{ChefUtils::Dist::Automate::PRODUCT} for #{ChefUtils::Dist::Solo::PRODUCT} Fetcher"
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/compliance/fetcher/chef_server.rb b/lib/chef/compliance/fetcher/chef_server.rb
new file mode 100644
index 0000000000..96a2213b69
--- /dev/null
+++ b/lib/chef/compliance/fetcher/chef_server.rb
@@ -0,0 +1,134 @@
+require "uri" unless defined?(URI)
+require "plugins/inspec-compliance/lib/inspec-compliance"
+
+# This class implements an InSpec fetcher for Chef Server. The implementation
+# is based on the Chef Compliance fetcher and only adapts the calls to redirect
+# the requests via Chef Server.
+#
+# This implementation depends on chef-client runtime, therefore it is only executable
+# inside of a chef-client run
+
+class Chef
+ module Compliance
+ module Fetcher
+ class ChefServer < ::InspecPlugins::Compliance::Fetcher
+ name "chef-server"
+
+ # it positions itself before `compliance` fetcher
+ # only load it, if the Chef Server is integrated with Chef Compliance
+ priority 501
+
+ CONFIG = { "insecure" => true }.freeze
+
+ # Accepts URLs to compliance profiles in one of two forms:
+ # * a String URL with a compliance scheme, like "compliance://namespace/profile_name"
+ # * a Hash with a key of `compliance` and a value like "compliance/profile_name" and optionally a `version` key with a String value
+ def self.resolve(target)
+ profile_uri = get_target_uri(target)
+ return nil if profile_uri.nil?
+
+ organization = Chef::Config[:chef_server_url].split("/").last
+ owner = profile_uri.user ? "#{profile_uri.user}@#{profile_uri.host}" : profile_uri.host
+ version = target[:version] if target.respond_to?(:key?)
+
+ path_parts = [""]
+ path_parts << "compliance" if chef_server_reporter? || chef_server_fetcher?
+ path_parts << "organizations"
+ path_parts << organization
+ path_parts << "owners"
+ path_parts << owner
+ path_parts << "compliance"
+ path_parts << profile_uri.path
+ path_parts << "version/#{version}" if version
+ path_parts << "tar"
+
+ target_url = URI(Chef::Config[:chef_server_url])
+ target_url.path = File.join(path_parts)
+ Chef::Log.info("Fetching profile from: #{target_url}")
+
+ new(target_url, CONFIG)
+ rescue URI::Error => _e
+ nil
+ end
+
+ #
+ # We want to save compliance: in the lockfile rather than url: to
+ # make sure we go back through the ComplianceAPI handling.
+ #
+ def resolved_source
+ { compliance: chef_server_url }
+ end
+
+ # Downloads archive to temporary file using a Chef::ServerAPI
+ # client so that Chef Server's header-based authentication can be
+ # used.
+ def download_archive_to_temp
+ return @temp_archive_path unless @temp_archive_path.nil?
+
+ rest = Chef::ServerAPI.new(@target, Chef::Config.merge(ssl_verify_mode: :verify_none))
+ archive = with_http_rescue do
+ rest.streaming_request(@target)
+ end
+ @archive_type = ".tar.gz"
+
+ if archive.nil?
+ path = @target.respond_to?(:path) ? @target.path : path
+ raise Inspec::FetcherFailure, "Unable to find requested profile on path: '#{path}' on the #{ChefUtils::Dist::Automate::PRODUCT} system."
+ end
+
+ Inspec::Log.debug("Archive stored at temporary location: #{archive.path}")
+ @temp_archive_path = archive.path
+ end
+
+ def with_http_rescue
+ response = yield
+ if response.respond_to?(:code)
+ # handle non 200 error codes, they are not raised as Net::HTTPClientException
+ handle_http_error_code(response.code) if response.code.to_i >= 300
+ end
+ response
+ rescue Net::HTTPClientException => e
+ Chef::Log.error e
+ handle_http_error_code(e.response.code)
+ end
+
+ def handle_http_error_code(code)
+ case code
+ when /401|403/
+ Chef::Log.error "Auth issue: see the Compliance Phase troubleshooting documentation (http://docs.chef.io/chef_compliance_phase/#troubleshooting)."
+ when /404/
+ Chef::Log.error "Object does not exist on remote server."
+ when /413/
+ Chef::Log.error "You most likely hit the erchef request size in #{ChefUtils::Dist::Server::PRODUCT} that defaults to ~2MB. To increase this limit see the Compliance Phase troubleshooting documentation (http://docs.chef.io/chef_compliance_phase/#troubleshooting) or the Chef Infra Server configuration documentation (https://docs.chef.io/server/config_rb_server/)"
+ when /429/
+ Chef::Log.error "This error typically means the data sent was larger than #{ChefUtils::Dist::Automate::PRODUCT}'s limit (4 MB). Run InSpec locally to identify any controls producing large diffs."
+ end
+ msg = "Received HTTP error #{code}"
+ Chef::Log.error msg
+ raise Inspec::FetcherFailure, msg
+ end
+
+ def to_s
+ "#{ChefUtils::Dist::Server::PRODUCT}/Compliance Profile Loader"
+ end
+
+ CHEF_SERVER_REPORTERS = %w{chef-server chef-server-compliance chef-server-visibility chef-server-automate}.freeze
+ def self.chef_server_reporter?
+ (Array(Chef.node.attributes["audit"]["reporter"]) & CHEF_SERVER_REPORTERS).any?
+ end
+
+ CHEF_SERVER_FETCHERS = %w{chef-server chef-server-compliance chef-server-visibility chef-server-automate}.freeze
+ def self.chef_server_fetcher?
+ CHEF_SERVER_FETCHERS.include?(Chef.node.attributes["audit"]["fetcher"])
+ end
+
+ private
+
+ def chef_server_url
+ m = %r{^#{@config['server']}/owners/(?<owner>[^/]+)/compliance/(?<id>[^/]+)/tar$}.match(@target)
+ "#{m[:owner]}/#{m[:id]}"
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/compliance/reporter/automate.rb b/lib/chef/compliance/reporter/automate.rb
new file mode 100644
index 0000000000..cae0256085
--- /dev/null
+++ b/lib/chef/compliance/reporter/automate.rb
@@ -0,0 +1,201 @@
+class Chef
+ module Compliance
+ module Reporter
+ #
+ # Used to send inspec reports to Chef Automate via the data_collector service
+ #
+ class Automate
+ def initialize(opts)
+ @entity_uuid = opts[:entity_uuid]
+ @run_id = opts[:run_id]
+ @node_name = opts[:node_info][:node]
+ @environment = opts[:node_info][:environment]
+ @roles = opts[:node_info][:roles]
+ @recipes = opts[:node_info][:recipes]
+ @insecure = opts[:insecure]
+ @chef_tags = opts[:node_info][:chef_tags]
+ @policy_group = opts[:node_info][:policy_group]
+ @policy_name = opts[:node_info][:policy_name]
+ @source_fqdn = opts[:node_info][:source_fqdn]
+ @organization_name = opts[:node_info][:organization_name]
+ @ipaddress = opts[:node_info][:ipaddress]
+ @fqdn = opts[:node_info][:fqdn]
+ @run_time_limit = opts[:run_time_limit]
+ @control_results_limit = opts[:control_results_limit]
+ @timestamp = opts.fetch(:timestamp) { Time.now }
+
+ @url = Chef::Config[:data_collector][:server_url]
+ @token = Chef::Config[:data_collector][:token]
+ end
+
+ # Method used in order to send the inspec report to the data_collector server
+ def send_report(report)
+ unless @entity_uuid && @run_id
+ Chef::Log.error "entity_uuid(#{@entity_uuid}) or run_id(#{@run_id}) can't be nil, not sending report to #{ChefUtils::Dist::Automate::PRODUCT}"
+ return false
+ end
+
+ unless @url && @token
+ Chef::Log.warn "data_collector.token and data_collector.server_url must be defined in client.rb! Further information: https://docs.chef.io/chef_compliance_phase/#direct-reporting-to-chef-automate"
+ return false
+ end
+
+ headers = {
+ "Content-Type" => "application/json",
+ "x-data-collector-auth" => "version=1.0",
+ "x-data-collector-token" => @token,
+ }
+
+ all_report_shas = report[:profiles].map { |p| p[:sha256] }
+ missing_report_shas = missing_automate_profiles(headers, all_report_shas)
+
+ full_report = truncate_controls_results(enriched_report(report), @control_results_limit)
+ full_report = strip_profiles_meta(full_report, missing_report_shas, @run_time_limit)
+ json_report = Chef::JSONCompat.to_json(full_report, validate_utf8: false)
+
+ # Automate GRPC currently has a message limit of ~4MB
+ # https://github.com/chef/automate/issues/1417#issuecomment-541908157
+ if json_report.bytesize > 4 * 1024 * 1024
+ Chef::Log.warn "Generated report size is #{(json_report.bytesize / (1024 * 1024.0)).round(2)} MB. #{ChefUtils::Dist::Automate::PRODUCT} has an internal 4MB limit that is not currently configurable."
+ end
+
+ unless json_report
+ Chef::Log.warn "Something went wrong, report can't be nil"
+ return false
+ end
+
+ begin
+ Chef::Log.info "Report to #{ChefUtils::Dist::Automate::PRODUCT}: #{@url}"
+ Chef::Log.debug "Compliance Report: #{json_report}"
+ http_client.post(nil, json_report, headers)
+ true
+ rescue => e
+ Chef::Log.error "send_report: POST to #{@url} returned: #{e.message}"
+ false
+ end
+ end
+
+ def http_client(url = @url)
+ if @insecure
+ Chef::HTTP.new(url, ssl_verify_mode: :verify_none)
+ else
+ Chef::HTTP.new(url)
+ end
+ end
+
+ def enriched_report(final_report)
+ final_report[:profiles].compact!
+
+ # Label this content as an inspec_report
+ final_report[:type] = "inspec_report"
+
+ final_report[:node_name] = @node_name
+ final_report[:end_time] = @timestamp.utc.strftime("%FT%TZ")
+ final_report[:node_uuid] = @entity_uuid
+ final_report[:environment] = @environment
+ final_report[:roles] = @roles
+ final_report[:recipes] = @recipes
+ final_report[:report_uuid] = @run_id
+ final_report[:source_fqdn] = @source_fqdn
+ final_report[:organization_name] = @organization_name
+ final_report[:policy_group] = @policy_group
+ final_report[:policy_name] = @policy_name
+ final_report[:chef_tags] = @chef_tags
+ final_report[:ipaddress] = @ipaddress
+ final_report[:fqdn] = @fqdn
+
+ final_report
+ end
+
+ CONTROL_RESULT_SORT_ORDER = %w{ failed skipped passed }.freeze
+
+ # Truncates the number of results per control in the report when they exceed max_results.
+ # The truncation prioritizes failed and skipped results over passed ones.
+ # Controls where results have been truncated will get a new object 'removed_results_counts'
+ # with the status counts of the truncated results
+ def truncate_controls_results(report, max_results)
+ return report unless max_results.is_a?(Integer) && max_results > 0
+
+ report.fetch(:profiles, []).each do |profile|
+ profile.fetch(:controls, []).each do |control|
+ # Only bother with truncation if the number of results exceed max_results
+ next unless control[:results].length > max_results
+
+ res = control[:results]
+ res.sort_by! { |r| CONTROL_RESULT_SORT_ORDER.index(r[:status]) }
+
+ # Count the results that will be truncated
+ truncated = { failed: 0, skipped: 0, passed: 0 }
+ (max_results..res.length - 1).each do |i|
+ case res[i][:status]
+ when "failed"
+ truncated[:failed] += 1
+ when "skipped"
+ truncated[:skipped] += 1
+ when "passed"
+ truncated[:passed] += 1
+ end
+ end
+ # Truncate the results array now
+ control[:results] = res[0..max_results - 1]
+ control[:removed_results_counts] = truncated
+ end
+ end
+ report
+ end
+
+ # Contacts the metasearch Automate API to check which of the inspec profile sha256 ids
+ # passed in via `report_shas` are missing from the Automate profiles metadata database.
+ def missing_automate_profiles(headers, report_shas)
+ Chef::Log.debug "Checking the #{ChefUtils::Dist::Automate::PRODUCT} profiles metadata for: #{report_shas}"
+ meta_url = URI(@url)
+ meta_url.path = "/compliance/profiles/metasearch"
+ response_str = http_client(meta_url.to_s).post(nil, "{\"sha256\": #{report_shas}}", headers)
+ missing_shas = Chef::JSONCompat.parse(response_str)["missing_sha256"]
+ unless missing_shas.empty?
+ Chef::Log.info "#{ChefUtils::Dist::Automate::PRODUCT} is missing metadata for the following profile ids: #{missing_shas}"
+ end
+ missing_shas
+ rescue => e
+ Chef::Log.error "missing_automate_profiles error: #{e.message}"
+ # If we get an error it's safer to assume none of the profile shas exist in Automate
+ report_shas
+ end
+
+ # Profile 'name' is a required property.
+ # By not sending it in the report, we make it clear to the ingestion backend that the profile metadata has been stripped from this profile in the report.
+ # Profile 'title' and 'version' are still kept for troubleshooting purposes in the backend.
+ SEEN_PROFILE_UNNECESSARY_FIELDS = %i{ copyright copyright_email groups license maintainer name summary supports}.freeze
+
+ SEEN_PROFILE_UNNECESSARY_CONTROL_FIELDS = %i{ code desc descriptions impact refs source_location tags title }.freeze
+
+ # TODO: This mutates the report and probably doesn't need to.
+ def strip_profiles_meta(report, missing_report_shas, run_time_limit)
+ report[:profiles].each do |p|
+ next if missing_report_shas.include?(p[:sha256])
+
+ p.delete_if { |f| SEEN_PROFILE_UNNECESSARY_FIELDS.include?(f) }
+
+ next unless p[:controls].is_a?(Array)
+
+ p[:controls].each do |c|
+ c.delete_if { |f| SEEN_PROFILE_UNNECESSARY_CONTROL_FIELDS.include?(f) }
+ c.delete(:waiver_data) if c[:waiver_data] == {}
+
+ next unless c[:results].is_a?(Array)
+
+ c[:results].each do |r|
+ if r[:run_time].is_a?(Float) && r[:run_time] < run_time_limit
+ r.delete(:start_time)
+ r.delete(:run_time)
+ end
+ end
+ end
+ end
+ report[:run_time_limit] = run_time_limit
+ report
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/compliance/reporter/chef_server_automate.rb b/lib/chef/compliance/reporter/chef_server_automate.rb
new file mode 100644
index 0000000000..46ca7dc7ba
--- /dev/null
+++ b/lib/chef/compliance/reporter/chef_server_automate.rb
@@ -0,0 +1,94 @@
+require_relative "automate"
+
+class Chef
+ module Compliance
+ module Reporter
+ #
+ # Used to send inspec reports to Chef Automate server via Chef Server
+ #
+ class ChefServerAutomate < Chef::Compliance::Reporter::Automate
+ attr_reader :url
+
+ def initialize(opts)
+ @entity_uuid = opts[:entity_uuid]
+ @run_id = opts[:run_id]
+ @node_name = opts[:node_info][:node]
+ @insecure = opts[:insecure]
+ @environment = opts[:node_info][:environment]
+ @roles = opts[:node_info][:roles]
+ @recipes = opts[:node_info][:recipes]
+ @url = opts[:url]
+ @chef_tags = opts[:node_info][:chef_tags]
+ @policy_group = opts[:node_info][:policy_group]
+ @policy_name = opts[:node_info][:policy_name]
+ @source_fqdn = opts[:node_info][:source_fqdn]
+ @organization_name = opts[:node_info][:organization_name]
+ @ipaddress = opts[:node_info][:ipaddress]
+ @fqdn = opts[:node_info][:fqdn]
+ @control_results_limit = opts[:control_results_limit]
+ @timestamp = opts.fetch(:timestamp) { Time.now }
+ end
+
+ def send_report(report)
+ unless @entity_uuid && @run_id
+ Chef::Log.error "entity_uuid(#{@entity_uuid}) or run_id(#{@run_id}) can't be nil, not sending report to #{ChefUtils::Dist::Automate::PRODUCT}"
+ return false
+ end
+
+ automate_report = truncate_controls_results(enriched_report(report), @control_results_limit)
+
+ report_size = Chef::JSONCompat.to_json(automate_report, validate_utf8: false).bytesize
+ # this is set to slightly less than the oc_erchef limit
+ if report_size > 900 * 1024
+ Chef::Log.warn "Generated report size is #{(report_size / (1024 * 1024.0)).round(2)} MB. #{ChefUtils::Dist::Server::PRODUCT} < 13.0 defaults to a limit of ~1MB, 13.0+ defaults to a limit of ~2MB."
+ end
+
+ Chef::Log.info "Report to #{ChefUtils::Dist::Automate::PRODUCT} via #{ChefUtils::Dist::Server::PRODUCT}: #{@url}"
+ with_http_rescue do
+ http_client.post(@url, automate_report)
+ return true
+ end
+ false
+ end
+
+ def http_client
+ config = if @insecure
+ Chef::Config.merge(ssl_verify_mode: :verify_none)
+ else
+ Chef::Config
+ end
+
+ Chef::ServerAPI.new(@url, config)
+ end
+
+ def with_http_rescue
+ response = yield
+ if response.respond_to?(:code)
+ # handle non 200 error codes, they are not raised as Net::HTTPClientException
+ handle_http_error_code(response.code) if response.code.to_i >= 300
+ end
+ response
+ rescue Net::HTTPClientException => e
+ Chef::Log.error e
+ handle_http_error_code(e.response.code)
+ end
+
+ def handle_http_error_code(code)
+ case code
+ when /401|403/
+ Chef::Log.error "Auth issue: see the Compliance Phase troubleshooting documentation (http://docs.chef.io/chef_compliance_phase/#troubleshooting)."
+ when /404/
+ Chef::Log.error "Object does not exist on remote server."
+ when /413/
+ Chef::Log.error "You most likely hit the erchef request size in #{ChefUtils::Dist::Server::PRODUCT} that defaults to ~2MB. To increase this limit see the Compliance Phase troubleshooting documentation (http://docs.chef.io/chef_compliance_phase/#troubleshooting) or the Chef Infra Server configuration documentation (https://docs.chef.io/server/config_rb_server/)"
+ when /429/
+ Chef::Log.error "This error typically means the data sent was larger than #{ChefUtils::Dist::Automate::PRODUCT}'s limit (4 MB). Run InSpec locally to identify any controls producing large diffs."
+ end
+ msg = "Received HTTP error #{code}"
+ Chef::Log.error msg
+ raise msg
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/compliance/reporter/compliance_enforcer.rb b/lib/chef/compliance/reporter/compliance_enforcer.rb
new file mode 100644
index 0000000000..1c63e43b28
--- /dev/null
+++ b/lib/chef/compliance/reporter/compliance_enforcer.rb
@@ -0,0 +1,20 @@
+class Chef
+ module Compliance
+ module Reporter
+ class AuditEnforcer
+ class ControlFailure < StandardError; end
+
+ def send_report(report)
+ report.fetch(:profiles, []).each do |profile|
+ profile.fetch(:controls, []).each do |control|
+ control.fetch(:results, []).each do |result|
+ raise ControlFailure, "Audit #{control[:id]} has failed. Aborting #{ChefUtils::Dist::Infra::CLIENT} run." if result[:status] == "failed"
+ end
+ end
+ end
+ true
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/compliance/reporter/json_file.rb b/lib/chef/compliance/reporter/json_file.rb
new file mode 100644
index 0000000000..471d9f64b1
--- /dev/null
+++ b/lib/chef/compliance/reporter/json_file.rb
@@ -0,0 +1,19 @@
+require_relative "../../json_compat"
+
+class Chef
+ module Compliance
+ module Reporter
+ class JsonFile
+ def initialize(opts)
+ @path = opts.fetch(:file)
+ end
+
+ def send_report(report)
+ FileUtils.mkdir_p(File.dirname(@path), mode: 0700)
+
+ File.write(@path, Chef::JSONCompat.to_json(report))
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/compliance/runner.rb b/lib/chef/compliance/runner.rb
new file mode 100644
index 0000000000..86344367c2
--- /dev/null
+++ b/lib/chef/compliance/runner.rb
@@ -0,0 +1,266 @@
+autoload :Inspec, "inspec"
+
+require_relative "default_attributes"
+require_relative "reporter/automate"
+require_relative "reporter/chef_server_automate"
+require_relative "reporter/compliance_enforcer"
+require_relative "reporter/json_file"
+
+class Chef
+ module Compliance
+ class Runner < EventDispatch::Base
+ extend Forwardable
+
+ attr_accessor :run_id, :recipes
+ attr_reader :node
+ def_delegators :node, :logger
+
+ def enabled?
+ audit_cookbook_present = recipes.include?("audit::default")
+
+ logger.info("#{self.class}##{__method__}: #{Inspec::Dist::PRODUCT_NAME} profiles? #{inspec_profiles.any?}")
+ logger.info("#{self.class}##{__method__}: audit cookbook? #{audit_cookbook_present}")
+
+ inspec_profiles.any? && !audit_cookbook_present
+ end
+
+ def node=(node)
+ @node = node
+ node.default["audit"] = Chef::Compliance::DEFAULT_ATTRIBUTES.merge(node.default["audit"])
+ end
+
+ def node_load_completed(node, _expanded_run_list, _config)
+ self.node = node
+ end
+
+ def run_started(run_status)
+ self.run_id = run_status.run_id
+ end
+
+ def run_list_expanded(run_list_expansion)
+ self.recipes = run_list_expansion.recipes
+ end
+
+ def run_completed(_node, _run_status)
+ return unless enabled?
+
+ logger.info("#{self.class}##{__method__}: enabling Compliance Phase")
+
+ report
+ end
+
+ def run_failed(_exception, _run_status)
+ return unless enabled?
+
+ logger.info("#{self.class}##{__method__}: enabling Compliance Phase")
+
+ report
+ end
+
+ ### Below code adapted from audit cookbook's files/default/handler/audit_report.rb
+
+ DEPRECATED_CONFIG_VALUES = %w{
+ attributes_save
+ fail_if_not_present
+ inspec_gem_source
+ inspec_version
+ interval
+ owner
+ raise_if_unreachable
+ }.freeze
+
+ def warn_for_deprecated_config_values!
+ deprecated_config_values = (node["audit"].keys & DEPRECATED_CONFIG_VALUES)
+
+ if deprecated_config_values.any?
+ values = deprecated_config_values.sort.map { |v| "'#{v}'" }.join(", ")
+ logger.warn "audit cookbook config values #{values} are not supported in #{ChefUtils::Dist::Infra::PRODUCT}'s Compliance Phase."
+ end
+ end
+
+ def report(report = generate_report)
+ warn_for_deprecated_config_values!
+
+ if report.empty?
+ logger.error "Compliance report was not generated properly, skipped reporting"
+ return
+ end
+
+ Array(node["audit"]["reporter"]).each do |reporter|
+ send_report(reporter, report)
+ end
+ end
+
+ def inspec_opts
+ inputs = node["audit"]["attributes"].to_h
+ if node["audit"]["chef_node_attribute_enabled"]
+ inputs["chef_node"] = node.to_h
+ inputs["chef_node"]["chef_environment"] = node.chef_environment
+ end
+
+ {
+ backend_cache: node["audit"]["inspec_backend_cache"],
+ inputs: inputs,
+ logger: logger,
+ output: node["audit"]["quiet"] ? ::File::NULL : STDOUT,
+ report: true,
+ reporter: ["json-automate"],
+ reporter_backtrace_inclusion: node["audit"]["result_include_backtrace"],
+ reporter_message_truncation: node["audit"]["result_message_limit"],
+ waiver_file: Array(node["audit"]["waiver_file"]),
+ }
+ end
+
+ def inspec_profiles
+ profiles = node["audit"]["profiles"]
+
+ # TODO: Custom exception class here?
+ unless profiles.respond_to?(:map) && profiles.all? { |_, p| p.respond_to?(:transform_keys) && p.respond_to?(:update) }
+ raise "#{Inspec::Dist::PRODUCT_NAME} profiles specified in an unrecognized format, expected a hash of hashes."
+ end
+
+ profiles.map do |name, profile|
+ profile.transform_keys(&:to_sym).update(name: name)
+ end
+ end
+
+ def load_fetchers!
+ case node["audit"]["fetcher"]
+ when "chef-automate"
+ require_relative "fetcher/automate"
+ when "chef-server"
+ require_relative "fetcher/chef_server"
+ when nil
+ # intentionally blank
+ else
+ raise "Invalid value specified for Compliance Phase's fetcher: '#{node["audit"]["fetcher"]}'. Valid values are 'chef-automate', 'chef-server', or nil."
+ end
+ end
+
+ def generate_report(opts: inspec_opts, profiles: inspec_profiles)
+ load_fetchers!
+
+ logger.debug "Options are set to: #{opts}"
+ runner = ::Inspec::Runner.new(opts)
+
+ if profiles.empty?
+ failed_report("No #{Inspec::Dist::PRODUCT_NAME} profiles are defined.")
+ return
+ end
+
+ profiles.each { |target| runner.add_target(target) }
+
+ logger.info "Running profiles from: #{profiles.inspect}"
+ runner.run
+ runner.report.tap do |r|
+ logger.debug "Compliance Report #{r}"
+ end
+ rescue Inspec::FetcherFailure => e
+ failed_report("Cannot fetch all profiles: #{profiles}. Please make sure you're authenticated and the server is reachable. #{e.message}")
+ rescue => e
+ failed_report(e.message)
+ end
+
+ # In case InSpec raises a runtime exception without providing a valid report,
+ # we make one up and add two new fields to it: `status` and `status_message`
+ def failed_report(err)
+ logger.error "#{Inspec::Dist::PRODUCT_NAME} has raised a runtime exception. Generating a minimal failed report."
+ logger.error err
+ {
+ "platform": {
+ "name": "unknown",
+ "release": "unknown",
+ },
+ "profiles": [],
+ "statistics": {
+ "duration": 0.0000001,
+ },
+ "version": Inspec::VERSION,
+ "status": "failed",
+ "status_message": err,
+ }
+ end
+
+ # extracts relevant node data
+ def node_info
+ chef_server_uri = URI(Chef::Config[:chef_server_url])
+
+ runlist_roles = node.run_list.select { |item| item.type == :role }.map(&:name)
+ runlist_recipes = node.run_list.select { |item| item.type == :recipe }.map(&:name)
+ {
+ node: node.name,
+ os: {
+ release: node["platform_version"],
+ family: node["platform"],
+ },
+ environment: node.environment,
+ roles: runlist_roles,
+ recipes: runlist_recipes,
+ policy_name: node.policy_name || "",
+ policy_group: node.policy_group || "",
+ chef_tags: node.tags,
+ organization_name: chef_server_uri.path.split("/").last || "",
+ source_fqdn: chef_server_uri.host || "",
+ ipaddress: node["ipaddress"],
+ fqdn: node["fqdn"],
+ }
+ end
+
+ def send_report(reporter_type, report)
+ logger.info "Reporting to #{reporter_type}"
+
+ reporter = reporter(reporter_type)
+
+ reporter.send_report(report) if reporter
+ end
+
+ def reporter(reporter_type)
+ case reporter_type
+ when "chef-automate"
+ opts = {
+ control_results_limit: node["audit"]["control_results_limit"],
+ entity_uuid: node["chef_guid"],
+ insecure: node["audit"]["insecure"],
+ node_info: node_info,
+ run_id: run_id,
+ run_time_limit: node["audit"]["run_time_limit"],
+ }
+ Chef::Compliance::Reporter::Automate.new(opts)
+ when "chef-server-automate"
+ opts = {
+ control_results_limit: node["audit"]["control_results_limit"],
+ entity_uuid: node["chef_guid"],
+ insecure: node["audit"]["insecure"],
+ node_info: node_info,
+ run_id: run_id,
+ run_time_limit: node["audit"]["run_time_limit"],
+ url: chef_server_automate_url,
+ }
+ Chef::Compliance::Reporter::ChefServerAutomate.new(opts)
+ when "json-file"
+ path = node["audit"]["json_file"]["location"]
+ logger.info "Writing compliance report to #{path}"
+ Chef::Compliance::Reporter::JsonFile.new(file: path)
+ when "audit-enforcer"
+ Chef::Compliance::Reporter::ComplianceEnforcer.new
+ else
+ raise "'#{reporter_type}' is not a supported reporter for Compliance Phase."
+ end
+ end
+
+ def chef_server_automate_url
+ url = if node["audit"]["server"]
+ URI(node["audit"]["server"])
+ else
+ URI(Chef::Config[:chef_server_url]).tap do |u|
+ u.path = ""
+ end
+ end
+
+ org = Chef::Config[:chef_server_url].split("/").last
+ url.path = File.join(url.path, "organizations/#{org}/data-collector")
+ url
+ end
+ end
+ end
+end
diff --git a/lib/chef/cookbook/gem_installer.rb b/lib/chef/cookbook/gem_installer.rb
index b652e5dee0..d7c18627de 100644
--- a/lib/chef/cookbook/gem_installer.rb
+++ b/lib/chef/cookbook/gem_installer.rb
@@ -47,7 +47,7 @@ class Chef
v2
end
end
- cookbook_gems[args.first] += args[1..-1]
+ cookbook_gems[args.first] += args[1..]
end
end
diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb
index 4a2940fb1f..53e874d0e8 100644
--- a/lib/chef/cookbook/synchronizer.rb
+++ b/lib/chef/cookbook/synchronizer.rb
@@ -17,7 +17,7 @@ require_relative "../client"
require_relative "../util/threaded_job_queue"
require_relative "../server_api"
require "singleton" unless defined?(Singleton)
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
@@ -65,7 +65,7 @@ class Chef
# manifest.
cache.find(File.join(%w{cookbooks ** {*,.*}})).each do |cache_filename|
unless @valid_cache_entries[cache_filename]
- Chef::Log.info("Removing #{cache_filename} from the cache; it is no longer needed by #{Chef::Dist::CLIENT}.")
+ Chef::Log.info("Removing #{cache_filename} from the cache; it is no longer needed by #{ChefUtils::Dist::Infra::CLIENT}.")
cache.delete(cache_filename)
end
end
diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb
index 765133b49a..84b0c0d58c 100644
--- a/lib/chef/cookbook_manifest.rb
+++ b/lib/chef/cookbook_manifest.rb
@@ -282,7 +282,7 @@ class Chef
name = File.join(segment, pathname.basename.to_s)
- if segment == "templates" || segment == "files"
+ if %w{templates files}.include?(segment)
# Check if pathname looks like files/foo or templates/foo (unscoped)
if pathname.each_filename.to_a.length == 2
# Use root_default in case the same path exists at root_default and default
@@ -317,6 +317,7 @@ class Chef
end
end
+
class CookbookManifestVersions
extend Chef::Mixin::VersionedAPIFactory
diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb
index 1598808234..d7226b79b3 100644
--- a/lib/chef/cookbook_site_streaming_uploader.rb
+++ b/lib/chef/cookbook_site_streaming_uploader.rb
@@ -18,11 +18,17 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "net/http" unless defined?(Net::HTTP)
-require "mixlib/authentication/signedheaderauth"
-require "openssl" unless defined?(OpenSSL)
-require_relative "dist"
+autoload :URI, "uri"
+module Net
+ autoload :HTTP, "net/http"
+end
+autoload :OpenSSL, "openssl"
+module Mixlib
+ module Authentication
+ autoload :SignedHeaderAuth, "mixlib/authentication/signedheaderauth"
+ end
+end
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
# == Chef::CookbookSiteStreamingUploader
@@ -37,7 +43,7 @@ class Chef
class << self
def create_build_dir(cookbook)
- tmp_cookbook_path = Tempfile.new("#{Chef::Dist::SHORT}-#{cookbook.name}-build")
+ tmp_cookbook_path = Tempfile.new("#{ChefUtils::Dist::Infra::SHORT}-#{cookbook.name}-build")
tmp_cookbook_path.close
tmp_cookbook_dir = tmp_cookbook_path.path
File.unlink(tmp_cookbook_dir)
@@ -225,11 +231,7 @@ class Chef
@part_no += 1
@part_offset = 0
next_part = read(how_much_next_part)
- result = current_part + if next_part
- next_part
- else
- ""
- end
+ result = current_part + (next_part || "")
else
@part_offset += how_much_current_part
result = current_part
diff --git a/lib/chef/cookbook_uploader.rb b/lib/chef/cookbook_uploader.rb
index 816cbf95fe..235a539b94 100644
--- a/lib/chef/cookbook_uploader.rb
+++ b/lib/chef/cookbook_uploader.rb
@@ -1,5 +1,5 @@
-require "set" unless defined?(Set)
+autoload :Set, "set"
require_relative "exceptions"
require_relative "knife/cookbook_metadata"
require_relative "digester"
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index 62407aa314..420532585a 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -264,7 +264,7 @@ class Chef
if found_pref
manifest_records_by_path[found_pref]
else
- if segment == :files || segment == :templates
+ if %i{files templates}.include?(segment)
error_message = "Cookbook '#{name}' (#{version}) does not contain a file at any of these locations:\n"
error_locations = if filename.is_a?(Array)
filename.map { |name| " #{File.join(segment.to_s, name)}" }
@@ -587,10 +587,7 @@ class Chef
end
def file_vendor
- unless @file_vendor
- @file_vendor = Chef::Cookbook::FileVendor.create_from_manifest(cookbook_manifest)
- end
- @file_vendor
+ @file_vendor ||= Chef::Cookbook::FileVendor.create_from_manifest(cookbook_manifest)
end
end
diff --git a/lib/chef/data_collector.rb b/lib/chef/data_collector.rb
index 6c7b2edb56..8d76f8a7b2 100644
--- a/lib/chef/data_collector.rb
+++ b/lib/chef/data_collector.rb
@@ -21,12 +21,12 @@
require_relative "server_api"
require_relative "http/simple_json"
require_relative "event_dispatch/base"
-require "set" unless defined?(Set)
+autoload :Set, "set"
require_relative "data_collector/run_end_message"
require_relative "data_collector/run_start_message"
require_relative "data_collector/config_validation"
require_relative "data_collector/error_handlers"
-require_relative "dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class DataCollector
@@ -182,7 +182,7 @@ class Chef
events.unregister(self) unless Chef::Config[:data_collector][:output_locations]
begin
- code = e&.response&.code&.to_s
+ code = e&.response&.code.to_s
rescue
# i really don't care
end
@@ -197,7 +197,7 @@ class Chef
else
if code == "404"
# Make the message non-scary for folks who don't have automate:
- msg << " (This is normal if you do not have #{Chef::Dist::AUTOMATE})"
+ msg << " (This is normal if you do not have #{ChefUtils::Dist::Automate::PRODUCT})"
Chef::Log.debug(msg)
else
Chef::Log.warn(msg)
@@ -212,8 +212,9 @@ class Chef
def send_to_output_locations(message)
return unless Chef::Config[:data_collector][:output_locations]
+ Chef::DataCollector::ConfigValidation.validate_output_locations!
Chef::Config[:data_collector][:output_locations].each do |type, locations|
- locations.each do |location|
+ Array(locations).each do |location|
send_to_file_location(location, message) if type == :files
send_to_http_location(location, message) if type == :urls
end
@@ -226,7 +227,7 @@ class Chef
# @param message [Hash] the message to render as JSON
#
def send_to_file_location(file_name, message)
- File.open(file_name, "a") do |fh|
+ File.open(File.expand_path(file_name), "a") do |fh|
fh.puts Chef::JSONCompat.to_json(message, validate_utf8: false)
end
end
diff --git a/lib/chef/data_collector/config_validation.rb b/lib/chef/data_collector/config_validation.rb
index 1a7940b0ae..1cdc400f48 100644
--- a/lib/chef/data_collector/config_validation.rb
+++ b/lib/chef/data_collector/config_validation.rb
@@ -16,6 +16,7 @@
#
require "uri" unless defined?(URI)
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class DataCollector
@@ -46,14 +47,14 @@ class Chef
return unless output_locations
# but deliberately setting an empty output_location we consider to be an error (XXX: but should we?)
- if output_locations.empty?
+ unless valid_hash_with_keys?(output_locations, :urls, :files)
raise Chef::Exceptions::ConfigurationError,
"Chef::Config[:data_collector][:output_locations] is empty. Please supply an hash of valid URLs and / or local file paths."
end
# loop through all the types and locations and validate each one-by-one
output_locations.each do |type, locations|
- locations.each do |location|
+ Array(locations).each do |location|
validate_url!(location) if type == :urls
validate_file!(location) if type == :files
end
@@ -86,15 +87,20 @@ class Chef
false
when running_mode == :client && Chef::Config[:data_collector][:token]
Chef::Log.warn("Data collector token authentication is not recommended for client-server mode. " \
- "Please upgrade #{Chef::Dist::SERVER_PRODUCT} to 12.11 or later and remove the token from your config file " \
+ "Please upgrade #{ChefUtils::Dist::Server::PRODUCT} to 12.11 or later and remove the token from your config file " \
"to use key based authentication instead")
true
- when Chef::Config[:data_collector][:output_locations] && Chef::Config[:data_collector][:output_locations][:files] && !Chef::Config[:data_collector][:output_locations][:files].empty?
+ when Chef::Config[:data_collector][:output_locations] && !valid_hash_with_keys?(Chef::Config[:data_collector][:output_locations], :urls)
# we can run fine to a file without a token, even in solo mode.
+ unless valid_hash_with_keys?(Chef::Config[:data_collector][:output_locations], :files)
+ raise Chef::Exceptions::ConfigurationError,
+ "Chef::Config[:data_collector][:output_locations] is empty. Please supply an hash of valid URLs and / or local file paths."
+ end
+
true
when running_mode == :solo && !Chef::Config[:data_collector][:token]
# we are in solo mode and are not logging to a file, so must have a token
- Chef::Log.trace("Data collector token must be configured to use #{Chef::Dist::AUTOMATE} data collector with #{Chef::Dist::SOLO}")
+ Chef::Log.trace("Data collector token must be configured to use #{ChefUtils::Dist::Automate::PRODUCT} data collector with #{ChefUtils::Dist::Solo::PRODUCT}")
false
else
true
@@ -105,16 +111,10 @@ class Chef
# validate an output_location file
def validate_file!(file)
- open(file, "a") {}
- rescue Errno::ENOENT
+ return true if Chef::Config.path_accessible?(File.expand_path(file))
+
raise Chef::Exceptions::ConfigurationError,
"Chef::Config[:data_collector][:output_locations][:files] contains the location #{file}, which is a non existent file path."
- rescue Errno::EACCES
- raise Chef::Exceptions::ConfigurationError,
- "Chef::Config[:data_collector][:output_locations][:files] contains the location #{file}, which cannot be written to by Chef."
- rescue Exception => e
- raise Chef::Exceptions::ConfigurationError,
- "Chef::Config[:data_collector][:output_locations][:files] contains the location #{file}, which is invalid: #{e.message}."
end
# validate an output_location url
@@ -125,6 +125,15 @@ class Chef
"Chef::Config[:data_collector][:output_locations][:urls] contains the url #{url} which is not valid."
end
+ # Validate the hash contains at least one of the given keys.
+ #
+ # @param hash [Hash] the hash to be validated.
+ # @param keys [Array] an array of keys to check existence of in the hash.
+ # @return [Boolean] true if the hash contains any of the given keys.
+ #
+ def valid_hash_with_keys?(hash, *keys)
+ hash.is_a?(Hash) && keys.any? { |k| hash.key?(k) }
+ end
end
end
end
diff --git a/lib/chef/data_collector/run_end_message.rb b/lib/chef/data_collector/run_end_message.rb
index 6f9f90b323..1900effa26 100644
--- a/lib/chef/data_collector/run_end_message.rb
+++ b/lib/chef/data_collector/run_end_message.rb
@@ -60,8 +60,8 @@ class Chef
"cookbooks" => ( node && node["cookbooks"] ) || {},
"policy_name" => node&.policy_name,
"policy_group" => node&.policy_group,
- "start_time" => run_status.start_time.utc.iso8601,
- "end_time" => run_status.end_time.utc.iso8601,
+ "start_time" => run_status&.start_time&.utc&.iso8601,
+ "end_time" => run_status&.end_time&.utc&.iso8601,
"source" => solo_run? ? "chef_solo" : "chef_client",
"status" => status,
"total_resource_count" => all_action_records(action_collection).count,
diff --git a/lib/chef/data_collector/run_start_message.rb b/lib/chef/data_collector/run_start_message.rb
index e5023b83ed..20ac867ef1 100644
--- a/lib/chef/data_collector/run_start_message.rb
+++ b/lib/chef/data_collector/run_start_message.rb
@@ -51,7 +51,7 @@ class Chef
"organization_name" => organization,
"run_id" => run_status&.run_id,
"source" => solo_run? ? "chef_solo" : "chef_client",
- "start_time" => run_status.start_time.utc.iso8601,
+ "start_time" => run_status&.start_time&.utc&.iso8601,
}
end
end
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb
index 1d167d7aca..992876c17d 100644
--- a/lib/chef/deprecated.rb
+++ b/lib/chef/deprecated.rb
@@ -113,7 +113,7 @@ class Chef
# @return [void]
def target(id, page = nil)
@deprecation_id = id
- @doc_page = page || "#{deprecation_key}"
+ @doc_page = page || deprecation_key.to_s
end
end
end
diff --git a/lib/chef/deprecation/warnings.rb b/lib/chef/deprecation/warnings.rb
index 201158114f..f83101ca3e 100644
--- a/lib/chef/deprecation/warnings.rb
+++ b/lib/chef/deprecation/warnings.rb
@@ -21,12 +21,12 @@ class Chef
module Warnings
require_relative "../version"
- require_relative "../dist"
+ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
def add_deprecation_warnings_for(method_names)
method_names.each do |name|
define_method(name) do |*args|
- message = "Method '#{name}' of '#{self.class}' is deprecated. It will be removed in #{Chef::Dist::PRODUCT} #{Chef::VERSION.to_i.next}."
+ message = "Method '#{name}' of '#{self.class}' is deprecated. It will be removed in #{ChefUtils::Dist::Infra::PRODUCT} #{Chef::VERSION.to_i.next}."
message << " Please update your cookbooks accordingly."
Chef.deprecated(:internal_api, message)
super(*args)
diff --git a/lib/chef/digester.rb b/lib/chef/digester.rb
index b9180ddd24..36df63f3a1 100644
--- a/lib/chef/digester.rb
+++ b/lib/chef/digester.rb
@@ -18,8 +18,8 @@
# limitations under the License.
#
-require "openssl" unless defined?(OpenSSL)
-require "digest" unless defined?(Digest)
+autoload :OpenSSL, "openssl"
+autoload :Digest, "digest"
require "singleton" unless defined?(Singleton)
class Chef
diff --git a/lib/chef/dist.rb b/lib/chef/dist.rb
deleted file mode 100644
index 7e6b221864..0000000000
--- a/lib/chef/dist.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-class Chef
- class Dist
- require "chef-config/dist"
- require "chef-config/config"
-
- # This class is not fully implemented, depending on it is not recommended!
- # When referencing a product directly, like Chef (Now Chef Infra)
- PRODUCT = "Chef Infra Client".freeze
-
- # A short designation for the product, used in Windows event logs
- # and some nomenclature.
- SHORT = ChefConfig::Dist::SHORT.freeze
-
- # The name of the server product
- SERVER_PRODUCT = "Chef Infra Server".freeze
-
- # The client's alias (chef-client)
- CLIENT = ChefConfig::Dist::CLIENT.freeze
-
- # name of the automate product
- AUTOMATE = "Chef Automate".freeze
-
- # The chef executable, as in `chef gem install` or `chef generate cookbook`
- EXEC = ChefConfig::Dist::EXEC.freeze
-
- # product website address
- WEBSITE = "https://chef.io".freeze
-
- # Chef-Zero's product name
- ZERO = "Chef Infra Zero".freeze
-
- # Chef-Solo's product name
- SOLO = "Chef Infra Solo".freeze
-
- # The chef-zero executable (local mode)
- ZEROEXEC = "chef-zero".freeze
-
- # The chef-solo executable (legacy local mode)
- SOLOEXEC = "chef-solo".freeze
-
- # The chef-shell executable
- SHELL = "chef-shell".freeze
-
- # The chef-apply executable
- APPLY = "chef-apply".freeze
-
- # Configuration related constants
- # The chef-shell configuration file
- SHELL_CONF = "chef_shell.rb".freeze
-
- # The configuration directory
- CONF_DIR = ChefConfig::Config.etc_chef_dir.freeze
-
- # The user's configuration directory
- USER_CONF_DIR = ChefConfig::Dist::USER_CONF_DIR.freeze
-
- # The suffix for Chef's /etc/chef, /var/chef and C:\\Chef directories
- # "cinc" => /etc/cinc, /var/cinc, C:\\cinc
- DIR_SUFFIX = ChefConfig::Dist::DIR_SUFFIX.freeze
-
- # The legacy conf folder: C:/opscode/chef. Specifically the "opscode" part
- # DIR_SUFFIX is appended to it in code where relevant
- LEGACY_CONF_DIR = ChefConfig::Dist::LEGACY_CONF_DIR.freeze
-
- # The server's configuration directory
- SERVER_CONF_DIR = "/etc/chef-server".freeze
- end
-end
diff --git a/lib/chef/dsl/chef_vault.rb b/lib/chef/dsl/chef_vault.rb
index bfb256ef3f..031627c358 100644
--- a/lib/chef/dsl/chef_vault.rb
+++ b/lib/chef/dsl/chef_vault.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require "chef-vault"
+autoload :ChefVault, "chef-vault"
require_relative "data_query"
class Chef
diff --git a/lib/chef/dsl/data_query.rb b/lib/chef/dsl/data_query.rb
index 8bfeff96b1..3b15affb5b 100644
--- a/lib/chef/dsl/data_query.rb
+++ b/lib/chef/dsl/data_query.rb
@@ -17,8 +17,8 @@
#
require_relative "../search/query"
-require_relative "../data_bag"
-require_relative "../data_bag_item"
+Chef.autoload :DataBag, File.expand_path("../data_bag", __dir__)
+Chef.autoload :DataBagItem, File.expand_path("../data_bag_item", __dir__)
require_relative "../encrypted_data_bag_item"
require_relative "../encrypted_data_bag_item/check_encrypted"
diff --git a/lib/chef/dsl/platform_introspection.rb b/lib/chef/dsl/platform_introspection.rb
index aa6c8946d9..49ec396cf2 100644
--- a/lib/chef/dsl/platform_introspection.rb
+++ b/lib/chef/dsl/platform_introspection.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "chef-utils" unless defined?(ChefUtils::CANARY)
+autoload :ChefUtils, "chef-utils"
require_relative "../mixin/chef_utils_wiring" unless defined?(Chef::Mixin::ChefUtilsWiring)
class Chef
diff --git a/lib/chef/encrypted_data_bag_item.rb b/lib/chef/encrypted_data_bag_item.rb
index 4a28d7ed35..9cf1a71db2 100644
--- a/lib/chef/encrypted_data_bag_item.rb
+++ b/lib/chef/encrypted_data_bag_item.rb
@@ -17,11 +17,9 @@
#
require_relative "config"
-require_relative "data_bag_item"
+Chef.autoload :DataBagItem, File.expand_path("data_bag_item", __dir__)
require_relative "encrypted_data_bag_item/decryptor"
require_relative "encrypted_data_bag_item/encryptor"
-require_relative "dist"
-require "open-uri" unless defined?(OpenURI)
# An EncryptedDataBagItem represents a read-only data bag item where
# all values, except for the value associated with the id key, have
@@ -129,9 +127,10 @@ class Chef::EncryptedDataBagItem
end
def self.load_secret(path = nil)
+ require "open-uri" unless defined?(OpenURI)
path ||= Chef::Config[:encrypted_data_bag_secret]
unless path
- raise ArgumentError, "No secret specified and no secret found at #{Chef::Config.platform_specific_path(Chef::Dist::CONF_DIR + "/encrypted_data_bag_secret")}"
+ raise ArgumentError, "No secret specified and no secret found at #{Chef::Config.platform_specific_path(ChefConfig::Config.etc_chef_dir) + "/encrypted_data_bag_secret"}"
end
secret = case path
diff --git a/lib/chef/encrypted_data_bag_item/assertions.rb b/lib/chef/encrypted_data_bag_item/assertions.rb
index 02baad2a2d..13ed0de050 100644
--- a/lib/chef/encrypted_data_bag_item/assertions.rb
+++ b/lib/chef/encrypted_data_bag_item/assertions.rb
@@ -30,7 +30,7 @@ class Chef::EncryptedDataBagItem
unless format_version.is_a?(Integer) && format_version >= Chef::Config[:data_bag_decrypt_minimum_version]
raise UnacceptableEncryptedDataBagItemFormat,
"The encrypted data bag item has format version `#{format_version}', " +
- "but the config setting 'data_bag_decrypt_minimum_version' requires version `#{Chef::Config[:data_bag_decrypt_minimum_version]}'"
+ "but the config setting 'data_bag_decrypt_minimum_version' requires version `#{Chef::Config[:data_bag_decrypt_minimum_version]}'"
end
end
diff --git a/lib/chef/encrypted_data_bag_item/decryptor.rb b/lib/chef/encrypted_data_bag_item/decryptor.rb
index 9bc4f32ed3..57119796a9 100644
--- a/lib/chef/encrypted_data_bag_item/decryptor.rb
+++ b/lib/chef/encrypted_data_bag_item/decryptor.rb
@@ -16,10 +16,10 @@
# limitations under the License.
#
-require "yaml" unless defined?(YAML)
+autoload :YAML, "yaml"
require_relative "../json_compat"
-require "openssl" unless defined?(OpenSSL)
-require "base64" unless defined?(Base64)
+autoload :OpenSSL, "openssl"
+autoload :Base64, "base64"
require "digest/sha2" unless defined?(Digest::SHA2)
require_relative "../encrypted_data_bag_item"
require_relative "unsupported_encrypted_data_bag_item_format"
diff --git a/lib/chef/encrypted_data_bag_item/encryptor.rb b/lib/chef/encrypted_data_bag_item/encryptor.rb
index 14094928ca..f068d134d8 100644
--- a/lib/chef/encrypted_data_bag_item/encryptor.rb
+++ b/lib/chef/encrypted_data_bag_item/encryptor.rb
@@ -16,10 +16,10 @@
# limitations under the License.
#
-require "base64" unless defined?(Base64)
+autoload :Base64, "base64"
require "digest/sha2" unless defined?(Digest::SHA2)
-require "openssl" unless defined?(OpenSSL)
-require "ffi_yajl" unless defined?(FFI_Yajl)
+autoload :OpenSSL, "openssl"
+autoload :FFI_Yajl, "ffi_yajl"
require_relative "../encrypted_data_bag_item"
require_relative "unsupported_encrypted_data_bag_item_format"
require_relative "encryption_failure"
diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb
index 4f0c365443..e651e1b4aa 100644
--- a/lib/chef/environment.rb
+++ b/lib/chef/environment.rb
@@ -25,7 +25,7 @@ require_relative "mixin/params_validate"
require_relative "mixin/from_file"
require_relative "version_constraint"
require_relative "server_api"
-require_relative "dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Environment
@@ -35,7 +35,7 @@ class Chef
include Chef::Mixin::ParamsValidate
include Chef::Mixin::FromFile
- COMBINED_COOKBOOK_CONSTRAINT = /(.+)(?:[\s]+)((?:#{Chef::VersionConstraint::OPS.join('|')})(?:[\s]+).+)$/.freeze
+ COMBINED_COOKBOOK_CONSTRAINT = /(.+)(?:\s+)((?:#{Chef::VersionConstraint::OPS.join('|')})(?:\s+).+)$/.freeze
def initialize(chef_server_rest: nil)
@name = ""
@@ -308,7 +308,7 @@ class Chef
def self.validate_cookbook_version(version)
if Chef::Config[:solo_legacy_mode]
raise Chef::Exceptions::IllegalVersionConstraint,
- "Environment cookbook version constraints not allowed in #{Chef::Dist::SOLO}"
+ "Environment cookbook version constraints not allowed in #{ChefUtils::Dist::Solo::PRODUCT}"
else
Chef::VersionConstraint.new version
true
diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb
index 1b9037fdb3..6b290eb8a7 100644
--- a/lib/chef/event_loggers/windows_eventlog.rb
+++ b/lib/chef/event_loggers/windows_eventlog.rb
@@ -19,7 +19,7 @@
require_relative "base"
require_relative "../platform/query_helpers"
require_relative "../win32/eventlog"
-require_relative "../dist"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
class Chef
module EventLoggers
@@ -36,7 +36,7 @@ class Chef
LOG_CATEGORY_ID = 11001
# Since we must install the event logger, this is not really configurable
- SOURCE = Chef::Dist::SHORT.freeze
+ SOURCE = ChefUtils::Dist::Infra::SHORT.freeze
def self.available?
ChefUtils.windows?
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 52a2cc8439..a0afd25208 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -18,7 +18,7 @@
# limitations under the License.
require "chef-config/exceptions"
-require_relative "dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require_relative "constants"
class Chef
@@ -84,11 +84,13 @@ class Chef
class InvalidPrivateKey < ArgumentError; end
class MissingKeyAttribute < ArgumentError; end
class KeyCommandInputError < ArgumentError; end
+
class BootstrapCommandInputError < ArgumentError
def initialize
super "You cannot pass both --json-attributes and --json-attribute-file. Please pass one or none."
end
end
+
class InvalidKeyArgument < ArgumentError; end
class InvalidKeyAttribute < ArgumentError; end
class InvalidUserAttribute < ArgumentError; end
@@ -195,6 +197,7 @@ class Chef
class IllegalVersionConstraint < NotImplementedError; end # rubocop:disable Lint/InheritException
class MetadataNotValid < StandardError; end
+
class MetadataNotFound < StandardError
attr_reader :install_path
attr_reader :cookbook_name
@@ -283,6 +286,7 @@ class Chef
end
end
+
# Exception class for collecting multiple failures. Used when running
# delayed notifications so that chef can process each delayed
# notification even if chef client or other notifications fail.
@@ -301,7 +305,7 @@ class Chef
def client_run_failure(exception)
set_backtrace(exception.backtrace)
- @all_failures << [ "#{Chef::Dist::PRODUCT} run", exception ]
+ @all_failures << [ "#{ChefUtils::Dist::Infra::PRODUCT} run", exception ]
end
def notification_failure(exception)
@@ -402,7 +406,7 @@ class Chef
def initialize(response_length, content_length)
super <<~EOF
Response body length #{response_length} does not match HTTP Content-Length header #{content_length}.
- This error is most often caused by network issues (proxies, etc) outside of #{Chef::Dist::CLIENT}.
+ This error is most often caused by network issues (proxies, etc) outside of #{ChefUtils::Dist::Infra::CLIENT}.
EOF
end
end
@@ -451,7 +455,7 @@ class Chef
attr_reader :wrapped_errors
def initialize(*errors)
- errors = errors.select { |e| !e.nil? }
+ errors = errors.compact
output = "Found #{errors.size} errors, they are stored in the backtrace"
@wrapped_errors = errors
super output
@@ -477,7 +481,7 @@ class Chef
class CookbookChefVersionMismatch < RuntimeError
def initialize(chef_version, cookbook_name, cookbook_version, *constraints)
constraint_str = constraints.map { |c| c.requirement.as_list.to_s }.join(", ")
- super "Cookbook '#{cookbook_name}' version '#{cookbook_version}' depends on #{Chef::Dist::PRODUCT} version #{constraint_str}, but the running #{Chef::Dist::PRODUCT} version is #{chef_version}"
+ super "Cookbook '#{cookbook_name}' version '#{cookbook_version}' depends on #{ChefUtils::Dist::Infra::PRODUCT} version #{constraint_str}, but the running #{ChefUtils::Dist::Infra::PRODUCT} version is #{chef_version}"
end
end
diff --git a/lib/chef/file_access_control/windows.rb b/lib/chef/file_access_control/windows.rb
index 118eae179c..cc1b96a84d 100644
--- a/lib/chef/file_access_control/windows.rb
+++ b/lib/chef/file_access_control/windows.rb
@@ -112,7 +112,11 @@ class Chef
def get_sid(value)
if value.is_a?(String)
- SID.from_account(value)
+ begin
+ Security.convert_string_sid_to_sid(value)
+ rescue Chef::Exceptions::Win32APIError
+ SID.from_account(value)
+ end
elsif value.is_a?(SID)
value
else
@@ -251,10 +255,7 @@ class Chef
flags |= CONTAINER_INHERIT_ACE
when :objects_only
flags |= OBJECT_INHERIT_ACE
- when true
- flags |= CONTAINER_INHERIT_ACE
- flags |= OBJECT_INHERIT_ACE
- when nil
+ when true, nil
flags |= CONTAINER_INHERIT_ACE
flags |= OBJECT_INHERIT_ACE
end
diff --git a/lib/chef/file_content_management/tempfile.rb b/lib/chef/file_content_management/tempfile.rb
index 763648de33..27efe34191 100644
--- a/lib/chef/file_content_management/tempfile.rb
+++ b/lib/chef/file_content_management/tempfile.rb
@@ -76,7 +76,7 @@ class Chef
# complexity here is due to supporting mangling non-UTF8 strings (e.g. latin-1 filenames with characters that are illegal in UTF-8)
b = File.basename(@new_resource.path)
i = b.index(".")
- i.nil? ? "" : b[i..-1].scrub
+ i.nil? ? "" : b[i..].scrub
end
# Returns the possible directories for the tempfile to be created in.
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index 88f332626c..513ac45471 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -1,6 +1,6 @@
require_relative "base"
require_relative "../config"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
module Formatters
@@ -41,7 +41,8 @@ class Chef
end
def run_start(version, run_status)
- puts_line "Starting #{Chef::Dist::PRODUCT}, version #{version}"
+ puts_line "Starting #{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
+ puts_line "Patents: #{ChefUtils::Dist::Org::PATENTS}"
puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
end
@@ -77,18 +78,18 @@ class Chef
puts_line ""
end
if Chef::Config[:why_run]
- puts_line "#{Chef::Dist::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources would have been updated"
+ puts_line "#{ChefUtils::Dist::Infra::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources would have been updated"
else
- puts_line "#{Chef::Dist::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources updated in #{pretty_elapsed_time}"
+ puts_line "#{ChefUtils::Dist::Infra::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources updated in #{pretty_elapsed_time}"
end
end
def run_failed(exception)
@end_time = Time.now
if Chef::Config[:why_run]
- puts_line "#{Chef::Dist::PRODUCT} failed. #{@updated_resources} resources would have been updated"
+ puts_line "#{ChefUtils::Dist::Infra::PRODUCT} failed. #{@updated_resources} resources would have been updated"
else
- puts_line "#{Chef::Dist::PRODUCT} failed. #{@updated_resources} resources updated in #{pretty_elapsed_time}"
+ puts_line "#{ChefUtils::Dist::Infra::PRODUCT} failed. #{@updated_resources} resources updated in #{pretty_elapsed_time}"
end
end
diff --git a/lib/chef/formatters/error_inspectors/api_error_formatting.rb b/lib/chef/formatters/error_inspectors/api_error_formatting.rb
index 6a1c75e0d3..ee4583c89b 100644
--- a/lib/chef/formatters/error_inspectors/api_error_formatting.rb
+++ b/lib/chef/formatters/error_inspectors/api_error_formatting.rb
@@ -17,7 +17,8 @@
#
require_relative "../../http/authenticator"
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
+require "timeout" unless defined?(Timeout)
class Chef
module Formatters
@@ -40,7 +41,7 @@ class Chef
def describe_eof_error(error_description)
error_description.section("Authentication Error:", <<~E)
Received an EOF on transport socket. This almost always indicates a network
- error external to #{Chef::Dist::CLIENT}. Some causes include:
+ error external to #{ChefUtils::Dist::Infra::CLIENT}. Some causes include:
- Blocking ICMP Dest Unreachable (breaking Path MTU Discovery)
- IPsec or VPN tunnelling / TCP Encapsulation MTU issues
@@ -114,8 +115,8 @@ class Chef
error_description.section("Incompatible server API version:", <<~E)
This version of the API that this request specified is not supported by the server you sent this request to.
The server supports a min API version of #{min_server_version} and a max API version of #{max_server_version}.
- #{Chef::Dist::PRODUCT} just made a request with an API version of #{client_api_version}.
- Please either update your #{Chef::Dist::PRODUCT} or the server to be a compatible set.
+ #{ChefUtils::Dist::Infra::PRODUCT} just made a request with an API version of #{client_api_version}.
+ Please either update your #{ChefUtils::Dist::Infra::PRODUCT} or the server to be a compatible set.
E
else
describe_http_error(error_description)
@@ -130,7 +131,7 @@ class Chef
end
def describe_503_error(error_description)
- error_description.section("Server Unavailable", "The #{Chef::Dist::SERVER_PRODUCT} is temporarily unavailable")
+ error_description.section("Server Unavailable", "The #{ChefUtils::Dist::Server::PRODUCT} is temporarily unavailable")
error_description.section("Server Response:", format_rest_error)
end
diff --git a/lib/chef/formatters/error_inspectors/compile_error_inspector.rb b/lib/chef/formatters/error_inspectors/compile_error_inspector.rb
index d765e66e7a..e42340ff3a 100644
--- a/lib/chef/formatters/error_inspectors/compile_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/compile_error_inspector.rb
@@ -115,14 +115,14 @@ class Chef
def culprit_line
@culprit_line ||= begin
- line_number = culprit_backtrace_entry[/^(?:.\:)?[^:]+:([\d]+)/, 1].to_i
+ line_number = culprit_backtrace_entry[/^(?:.\:)?[^:]+:(\d+)/, 1].to_i
Chef::Log.trace("Line number of compile error: '#{line_number}'")
line_number
end
end
def culprit_file
- @culprit_file ||= culprit_backtrace_entry[/^((?:.\:)?[^:]+):([\d]+)/, 1]
+ @culprit_file ||= culprit_backtrace_entry[/^((?:.\:)?[^:]+):(\d+)/, 1]
end
def filtered_bt
diff --git a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
index 3a3f602203..7e904c9ee2 100644
--- a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
@@ -17,7 +17,7 @@
#
require_relative "api_error_formatting"
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
module Formatters
@@ -46,7 +46,7 @@ class Chef
when Chef::Exceptions::PrivateKeyMissing
error_description.section("Private Key Not Found:", <<~E)
Your private key could not be loaded. If the key file exists, ensure that it is
- readable by #{Chef::Dist::PRODUCT}.
+ readable by #{ChefUtils::Dist::Infra::PRODUCT}.
E
error_description.section("Relevant Config Settings:", <<~E)
client_key "#{api_key}"
@@ -99,7 +99,7 @@ class Chef
# redirect.
def describe_404_error(error_description)
error_description.section("Resource Not Found:", <<~E)
- The #{Chef::Dist::SERVER_PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
+ The #{ChefUtils::Dist::Server::PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
E
error_description.section("Relevant Config Settings:", <<~E)
chef_server_url "#{server_url}"
diff --git a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
index 565ea217b8..4897ac6e1b 100644
--- a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
@@ -1,4 +1,4 @@
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
module Formatters
@@ -28,7 +28,7 @@ class Chef
humanize_http_exception(error_description)
when Errno::ECONNREFUSED, Timeout::Error, Errno::ETIMEDOUT, SocketError
error_description.section("Network Error:", <<~E)
- There was a network error connecting to the #{Chef::Dist::SERVER_PRODUCT}:
+ There was a network error connecting to the #{ChefUtils::Dist::Server::PRODUCT}:
#{exception.message}
E
error_description.section("Relevant Config Settings:", <<~E)
@@ -39,14 +39,14 @@ class Chef
when Chef::Exceptions::PrivateKeyMissing
error_description.section("Private Key Not Found:", <<~E)
Your private key could not be loaded. If the key file exists, ensure that it is
- readable by #{Chef::Dist::PRODUCT}.
+ readable by #{ChefUtils::Dist::Infra::PRODUCT}.
E
error_description.section("Relevant Config Settings:", <<~E)
validation_key "#{api_key}"
E
when Chef::Exceptions::InvalidRedirect
error_description.section("Invalid Redirect:", <<~E)
- Change your #{Chef::Dist::SERVER_PRODUCT} location in client.rb to the #{Chef::Dist::SERVER_PRODUCT}'s FQDN to avoid unwanted redirections.
+ Change your #{ChefUtils::Dist::Server::PRODUCT} location in client.rb to the #{ChefUtils::Dist::Server::PRODUCT}'s FQDN to avoid unwanted redirections.
E
when EOFError
describe_eof_error(error_description)
@@ -61,13 +61,13 @@ class Chef
when Net::HTTPUnauthorized
if clock_skew?
error_description.section("Authentication Error:", <<~E)
- Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
+ Failed to authenticate to the #{ChefUtils::Dist::Server::PRODUCT} (http 401).
The request failed because your clock has drifted by more than 15 minutes.
Syncing your clock to an NTP Time source should resolve the issue.
E
else
error_description.section("Authentication Error:", <<~E)
- Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
+ Failed to authenticate to the #{ChefUtils::Dist::Server::PRODUCT} (http 401).
E
error_description.section("Server Response:", format_rest_error)
@@ -81,7 +81,7 @@ class Chef
end
when Net::HTTPForbidden
error_description.section("Authorization Error:", <<~E)
- Your validation client is not authorized to create the client for this node on the #{Chef::Dist::SERVER_PRODUCT} (HTTP 403).
+ Your validation client is not authorized to create the client for this node on the #{ChefUtils::Dist::Server::PRODUCT} (HTTP 403).
E
error_description.section("Possible Causes:", <<~E)
* There may already be a client named "#{config[:node_name]}"
@@ -94,7 +94,7 @@ class Chef
error_description.section("Server Response:", format_rest_error)
when Net::HTTPNotFound
error_description.section("Resource Not Found:", <<~E)
- The #{Chef::Dist::SERVER_PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url configuration is incorrect.
+ The #{ChefUtils::Dist::Server::PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url configuration is incorrect.
E
error_description.section("Relevant Config Settings:", <<~E)
chef_server_url "#{server_url}"
@@ -107,7 +107,7 @@ class Chef
E
error_description.section("Server Response:", format_rest_error)
when Net::HTTPBadGateway, Net::HTTPServiceUnavailable
- error_description.section("Server Unavailable", "The #{Chef::Dist::SERVER_PRODUCT} is temporarily unavailable")
+ error_description.section("Server Unavailable", "The #{ChefUtils::Dist::Server::PRODUCT} is temporarily unavailable")
error_description.section("Server Response:", format_rest_error)
else
error_description.section("Unexpected API Request Failure:", format_rest_error)
diff --git a/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb b/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb
index fa7580d2c3..905a438f56 100644
--- a/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require_relative "../../dist"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
class Chef
module Formatters
@@ -56,7 +56,7 @@ class Chef
require_relative "../../win32/security"
unless Chef::ReservedNames::Win32::Security.has_admin_privileges?
- error_description.section("Missing Windows Admin Privileges", "#{Chef::Dist::CLIENT} doesn't have administrator privileges. This can be a possible reason for the resource failure.")
+ error_description.section("Missing Windows Admin Privileges", "#{ChefUtils::Dist::Infra::CLIENT} doesn't have administrator privileges. This can be a possible reason for the resource failure.")
end
end
end
@@ -79,8 +79,8 @@ class Chef
loop do
# low rent parser. try to gracefully handle nested blocks in resources
- nesting += 1 if /[\s]+do[\s]*/.match?(lines[current_line])
- nesting -= 1 if /end[\s]*$/.match?(lines[current_line])
+ nesting += 1 if /\s+do\s*/.match?(lines[current_line])
+ nesting -= 1 if /end\s*$/.match?(lines[current_line])
relevant_lines << format_line(current_line, lines[current_line])
@@ -114,11 +114,11 @@ class Chef
end
def parse_source
- resource.source_line[/^(([\w]:)?[^:]+):([\d]+)/, 1]
+ resource.source_line[/^((\w:)?[^:]+):(\d+)/, 1]
end
def parse_line(source)
- resource.source_line[/^#{Regexp.escape(source)}:([\d]+)/, 1].to_i
+ resource.source_line[/^#{Regexp.escape(source)}:(\d+)/, 1].to_i
end
end
diff --git a/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb b/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb
index ca3dec138b..6e452c959b 100644
--- a/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb
@@ -18,7 +18,7 @@
#
require_relative "api_error_formatting"
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
module Formatters
@@ -78,7 +78,7 @@ class Chef
case response
when Net::HTTPUnauthorized
error_description.section("Authentication Error:", <<~E)
- Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
+ Failed to authenticate to the #{ChefUtils::Dist::Server::PRODUCT} (http 401).
E
error_description.section("Server Response:", format_rest_error)
@@ -109,7 +109,7 @@ class Chef
E
error_description.section("Server Response:", format_rest_error)
when Net::HTTPBadGateway, Net::HTTPServiceUnavailable
- error_description.section("Server Unavailable", "The #{Chef::Dist::SERVER_PRODUCT} is temporarily unavailable")
+ error_description.section("Server Unavailable", "The #{ChefUtils::Dist::Server::PRODUCT} is temporarily unavailable")
error_description.section("Server Response:", format_rest_error)
else
error_description.section("Unexpected API Request Failure:", format_rest_error)
diff --git a/lib/chef/formatters/indentable_output_stream.rb b/lib/chef/formatters/indentable_output_stream.rb
index d508a32eb0..4943041b37 100644
--- a/lib/chef/formatters/indentable_output_stream.rb
+++ b/lib/chef/formatters/indentable_output_stream.rb
@@ -20,7 +20,7 @@ class Chef
# pastel.decorate is a lightweight replacement for highline.color
def pastel
@pastel ||= begin
- require "pastel"
+ require "pastel" unless defined?(Pastel)
Pastel.new
end
end
@@ -126,7 +126,7 @@ class Chef
indent_line(options)
# Note that the next line will need to be started
- if line[-1..-1] == "\n"
+ if line[-1..] == "\n"
@line_started = false
end
diff --git a/lib/chef/formatters/minimal.rb b/lib/chef/formatters/minimal.rb
index a35a7e8057..6a067c4f86 100644
--- a/lib/chef/formatters/minimal.rb
+++ b/lib/chef/formatters/minimal.rb
@@ -1,5 +1,5 @@
require_relative "base"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
@@ -28,19 +28,20 @@ class Chef
# Called at the very start of a Chef Run
def run_start(version, run_status)
- puts_line "Starting #{Chef::Dist::PRODUCT}, version #{version}"
+ puts_line "Starting #{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
+ puts_line "Patents: #{ChefUtils::Dist::Org::PATENTS}"
puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
end
# Called at the end of the Chef run.
def run_completed(node)
- puts "#{Chef::Dist::PRODUCT} finished, #{@updated_resources.size} resources updated"
+ puts "#{ChefUtils::Dist::Infra::PRODUCT} finished, #{@updated_resources.size} resources updated"
end
# called at the end of a failed run
def run_failed(exception)
- puts "#{Chef::Dist::PRODUCT} failed. #{@updated_resources.size} resources updated"
+ puts "#{ChefUtils::Dist::Infra::PRODUCT} failed. #{@updated_resources.size} resources updated"
end
# Called right after ohai runs.
diff --git a/lib/chef/guard_interpreter/resource_guard_interpreter.rb b/lib/chef/guard_interpreter/resource_guard_interpreter.rb
index 8528e4721d..a1e4205c03 100644
--- a/lib/chef/guard_interpreter/resource_guard_interpreter.rb
+++ b/lib/chef/guard_interpreter/resource_guard_interpreter.rb
@@ -20,19 +20,30 @@ require_relative "../guard_interpreter"
class Chef
class GuardInterpreter
- class ResourceGuardInterpreter < DefaultGuardInterpreter
-
+ class ResourceGuardInterpreter
def initialize(parent_resource, command, opts)
- super(command, opts)
+ @command = command
+ @opts = opts
+
@parent_resource = parent_resource
@resource = get_interpreter_resource(parent_resource)
end
+ # This class used to inherit from DefaultGuardInterpreter and it responds
+ # to #output, so leave this in for potential backwards compatibility.
+ def output
+ nil
+ end
+
def evaluate
# Add attributes inherited from the parent class
# to the resource
merge_inherited_attributes
+ @opts.each do |attribute, value|
+ @resource.send(attribute, value)
+ end
+
# Only execute and script resources and use guard attributes.
# The command to be executed on them are passed via different attributes.
# Script resources use code attribute and execute resources use
@@ -42,9 +53,9 @@ class Chef
# We need to make sure we check for Script first because any resource
# that can get to here is an Execute resource.
if @resource.is_a? Chef::Resource::Script
- block_attributes = @command_opts.merge({ code: @command })
+ @resource.code @command
else
- block_attributes = @command_opts.merge({ command: @command })
+ @resource.command @command
end
# Handles cases like powershell_script where default
@@ -53,33 +64,24 @@ class Chef
# the one attribute that causes this changes its default to be
# the same after some period to prepare for deprecation
if @resource.class.respond_to?(:get_default_attributes)
- block_attributes = @resource.class.send(:get_default_attributes, @command_opts).merge(block_attributes)
+ @resource.class.send(:get_default_attributes).each do |attribute, value|
+ @resource.send(attribute, value)
+ end
end
- resource_block = block_from_attributes(block_attributes)
- evaluate_action(nil, &resource_block)
- end
-
- protected
-
- def evaluate_action(action = nil, &block)
- @resource.instance_eval(&block)
-
- run_action = action || @resource.action
-
begin
# Coerce to an array to be safe. This could happen with a legacy
# resource or something overriding the default_action code in a
# subclass.
- Array(run_action).each { |action_to_run| @resource.run_action(action_to_run) }
- resource_updated = @resource.updated
+ Array(@resource.action).each { |action_to_run| @resource.run_action(action_to_run) }
+ @resource.updated
rescue Mixlib::ShellOut::ShellCommandFailed
- resource_updated = nil
+ nil
end
-
- resource_updated
end
+ private
+
def get_interpreter_resource(parent_resource)
if parent_resource.nil? || parent_resource.node.nil?
raise ArgumentError, "Node for guard resource parent must not be nil"
@@ -106,14 +108,6 @@ class Chef
interpreter_resource
end
- def block_from_attributes(attributes)
- Proc.new do
- attributes.each_key do |attribute_name|
- send(attribute_name, attributes[attribute_name]) if respond_to?(attribute_name)
- end
- end
- end
-
def merge_inherited_attributes
inherited_attributes = []
@@ -121,15 +115,10 @@ class Chef
inherited_attributes = @parent_resource.class.send(:guard_inherited_attributes)
end
- if inherited_attributes && !inherited_attributes.empty?
- inherited_attributes.each do |attribute|
- if @parent_resource.respond_to?(attribute) && @resource.respond_to?(attribute)
- parent_value = @parent_resource.send(attribute)
- child_value = @resource.send(attribute)
- if parent_value || child_value
- @resource.send(attribute, parent_value)
- end
- end
+ inherited_attributes.each do |attribute|
+ if @parent_resource.respond_to?(attribute) && @resource.respond_to?(attribute)
+ parent_value = @parent_resource.send(attribute)
+ @resource.send(attribute, parent_value)
end
end
end
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index 650ee73bb7..162998b7f3 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -22,11 +22,13 @@
#
require "tempfile" unless defined?(Tempfile)
-require "openssl" unless defined?(OpenSSL)
-require "net/http" unless defined?(Net::HTTP)
-require "uri" unless defined?(URI)
+autoload :OpenSSL, "openssl"
+autoload :URI, "uri"
+module Net
+ autoload :HTTP, "net/http"
+ autoload :HTTPClientException, "net/http"
+end
require_relative "http/basic_client"
-require_relative "monkey_patches/net_http"
require_relative "config"
require_relative "platform/query_helpers"
require_relative "exceptions"
@@ -163,10 +165,6 @@ class Chef
end
rescue Exception => exception
log_failed_request(response, return_value) unless response.nil?
-
- if exception.respond_to?(:chef_rest_request=)
- exception.chef_rest_request = rest_request
- end
raise
end
@@ -202,9 +200,6 @@ class Chef
end
rescue Exception => e
log_failed_request(response, return_value) unless response.nil?
- if e.respond_to?(:chef_rest_request=)
- e.chef_rest_request = rest_request
- end
raise
end
@@ -258,9 +253,6 @@ class Chef
end
rescue Exception => e
log_failed_request(response, return_value) unless response.nil?
- if e.respond_to?(:chef_rest_request=)
- e.chef_rest_request = rest_request
- end
raise
end
diff --git a/lib/chef/http/auth_credentials.rb b/lib/chef/http/auth_credentials.rb
index 765c9ee778..1702ae7e24 100644
--- a/lib/chef/http/auth_credentials.rb
+++ b/lib/chef/http/auth_credentials.rb
@@ -21,7 +21,11 @@
# limitations under the License.
#
require_relative "../log"
-require "mixlib/authentication/signedheaderauth"
+module Mixlib
+ module Authentication
+ autoload :SignedHeaderAuth, "mixlib/authentication/signedheaderauth"
+ end
+end
class Chef
class HTTP
diff --git a/lib/chef/http/authenticator.rb b/lib/chef/http/authenticator.rb
index 4a29fcea33..80b32be750 100644
--- a/lib/chef/http/authenticator.rb
+++ b/lib/chef/http/authenticator.rb
@@ -18,7 +18,7 @@
require_relative "auth_credentials"
require_relative "../exceptions"
-require "openssl" unless defined?(OpenSSL)
+autoload :OpenSSL, "openssl"
class Chef
class HTTP
diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb
index fa77b67427..2513b750eb 100644
--- a/lib/chef/http/basic_client.rb
+++ b/lib/chef/http/basic_client.rb
@@ -20,8 +20,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "net/http" unless defined?(Net::HTTP)
+autoload :URI, "uri"
+module Net
+ autoload :HTTP, "net/http"
+end
require_relative "ssl_policies"
require_relative "http_request"
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb
index 9569c4133a..a188fe947e 100644
--- a/lib/chef/http/http_request.rb
+++ b/lib/chef/http/http_request.rb
@@ -20,10 +20,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "cgi" unless defined?(CGI)
-require "net/http" unless defined?(Net::HTTP)
-require_relative "../dist"
+autoload :URI, "uri"
+autoload :CGI, "cgi"
+module Net
+ autoload :HTTP, "net/http"
+end
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
# To load faster, we only want ohai's version string.
# However, in ohai before 0.6.0, the version is defined
@@ -42,7 +44,7 @@ class Chef
engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
- UA_COMMON = "/#{::Chef::VERSION} (#{engine}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}; ohai-#{Ohai::VERSION}; #{RUBY_PLATFORM}; +#{Chef::Dist::WEBSITE})".freeze
+ UA_COMMON = "/#{::Chef::VERSION} (#{engine}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}; ohai-#{Ohai::VERSION}; #{RUBY_PLATFORM}; +#{ChefUtils::Dist::Org::WEBSITE})".freeze
DEFAULT_UA = "Chef Client" << UA_COMMON
USER_AGENT = "User-Agent".freeze
diff --git a/lib/chef/http/socketless_chef_zero_client.rb b/lib/chef/http/socketless_chef_zero_client.rb
index 0cd7b564d9..8c7ee8d8bc 100644
--- a/lib/chef/http/socketless_chef_zero_client.rb
+++ b/lib/chef/http/socketless_chef_zero_client.rb
@@ -44,7 +44,10 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
require "chef_zero/server"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
+module Net
+ autoload :HTTPResponse, "net/http"
+end
class Chef
class HTTP
@@ -64,7 +67,7 @@ class Chef
# or else streaming-style responses won't work.
def read_body(dest = nil, &block)
if dest
- raise "responses from socketless #{Chef::Dist::ZERO} can't be written to specific destination"
+ raise "responses from socketless #{ChefUtils::Dist::Zero::PRODUCT} can't be written to specific destination"
end
if block_given?
diff --git a/lib/chef/http/ssl_policies.rb b/lib/chef/http/ssl_policies.rb
index 05e4baf581..bc688f13a6 100644
--- a/lib/chef/http/ssl_policies.rb
+++ b/lib/chef/http/ssl_policies.rb
@@ -21,7 +21,7 @@
# limitations under the License.
#
-require "openssl" unless defined?(OpenSSL)
+autoload :OpenSSL, "openssl"
require_relative "../util/path_helper"
class Chef
@@ -70,6 +70,12 @@ class Chef
end
http_client.ca_file = config[:ssl_ca_file]
+ elsif ENV["SSL_CERT_FILE"]
+ unless ::File.exist?(ENV["SSL_CERT_FILE"])
+ raise Chef::Exceptions::ConfigurationError, "The configured ssl_ca_file #{ENV["SSL_CERT_FILE"]} does not exist"
+ end
+
+ http_client.ca_file = ENV["SSL_CERT_FILE"]
end
end
@@ -79,28 +85,41 @@ class Chef
http_client.cert_store.set_default_paths
end
if config.trusted_certs_dir
- certs = Dir.glob(File.join(Chef::Util::PathHelper.escape_glob_dir(config.trusted_certs_dir), "*.{crt,pem}"))
+ certs = Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob_dir(config.trusted_certs_dir), "*.{crt,pem}"))
certs.each do |cert_file|
- cert = OpenSSL::X509::Certificate.new(File.read(cert_file))
+ cert = begin
+ OpenSSL::X509::Certificate.new(::File.binread(cert_file))
+ rescue OpenSSL::X509::CertificateError => e
+ raise Chef::Exceptions::ConfigurationError, "Error reading cert file '#{cert_file}', original error '#{e.class}: #{e.message}'"
+ end
add_trusted_cert(cert)
end
end
end
def set_client_credentials
- if config[:ssl_client_cert] || config[:ssl_client_key]
- unless config[:ssl_client_cert] && config[:ssl_client_key]
- raise Chef::Exceptions::ConfigurationError, "You must configure ssl_client_cert and ssl_client_key together"
- end
- unless ::File.exists?(config[:ssl_client_cert])
- raise Chef::Exceptions::ConfigurationError, "The configured ssl_client_cert #{config[:ssl_client_cert]} does not exist"
- end
- unless ::File.exists?(config[:ssl_client_key])
- raise Chef::Exceptions::ConfigurationError, "The configured ssl_client_key #{config[:ssl_client_key]} does not exist"
- end
+ return unless config[:ssl_client_cert] || config[:ssl_client_key]
+
+ unless config[:ssl_client_cert] && config[:ssl_client_key]
+ raise Chef::Exceptions::ConfigurationError, "You must configure ssl_client_cert and ssl_client_key together"
+ end
+ unless ::File.exists?(config[:ssl_client_cert])
+ raise Chef::Exceptions::ConfigurationError, "The configured ssl_client_cert #{config[:ssl_client_cert]} does not exist"
+ end
+ unless ::File.exists?(config[:ssl_client_key])
+ raise Chef::Exceptions::ConfigurationError, "The configured ssl_client_key #{config[:ssl_client_key]} does not exist"
+ end
+
+ begin
+ http_client.cert = OpenSSL::X509::Certificate.new(::File.binread(config[:ssl_client_cert]))
+ rescue OpenSSL::X509::CertificateError => e
+ raise Chef::Exceptions::ConfigurationError, "Error reading cert file '#{config[:ssl_client_cert]}', original error '#{e.class}: #{e.message}'"
+ end
- http_client.cert = OpenSSL::X509::Certificate.new(::File.read(config[:ssl_client_cert]))
- http_client.key = OpenSSL::PKey::RSA.new(::File.read(config[:ssl_client_key]))
+ begin
+ http_client.key = OpenSSL::PKey::RSA.new(::File.binread(config[:ssl_client_key]))
+ rescue OpenSSL::PKey::RSAError => e
+ raise Chef::Exceptions::ConfigurationError, "Error reading key file '#{config[:ssl_client_key]}', original error '#{e.class}: #{e.message}'"
end
end
diff --git a/lib/chef/json_compat.rb b/lib/chef/json_compat.rb
index 188a5d38f3..b5c9072f6f 100644
--- a/lib/chef/json_compat.rb
+++ b/lib/chef/json_compat.rb
@@ -17,25 +17,22 @@
# Wrapper class for interacting with JSON.
-require "ffi_yajl" unless defined?(FFI_Yajl)
+autoload :FFI_Yajl, "ffi_yajl"
require_relative "exceptions"
# We're requiring this to prevent breaking consumers using Hash.to_json
require "json" unless defined?(JSON)
class Chef
class JSONCompat
- JSON_MAX_NESTING = 1000
class <<self
- # API to use to avoid create_additions
def parse(source, opts = {})
FFI_Yajl::Parser.parse(source, opts)
rescue FFI_Yajl::ParseError => e
raise Chef::Exceptions::JSON::ParseError, e.message
end
- # Just call the JSON gem's parse method with a modified :max_nesting field
def from_json(source, opts = {})
obj = parse(source, opts)
@@ -56,10 +53,8 @@ class Chef
end
def to_json_pretty(obj, opts = nil)
- opts ||= {}
- options_map = {}
- options_map[:pretty] = true
- options_map[:indent] = opts[:indent] if opts.key?(:indent)
+ options_map = { pretty: true }
+ options_map[:indent] = opts[:indent] if opts.respond_to?(:key?) && opts.key?(:indent)
to_json(obj, options_map).chomp
end
diff --git a/lib/chef/key.rb b/lib/chef/key.rb
index 6d30c97ad1..f1c046e6ba 100644
--- a/lib/chef/key.rb
+++ b/lib/chef/key.rb
@@ -46,7 +46,7 @@ class Chef
# Actor that the key is for, either a client or a user.
@actor = actor
- unless actor_field_name == "user" || actor_field_name == "client"
+ unless %w{user client}.include?(actor_field_name)
raise Chef::Exceptions::InvalidKeyArgument, "the second argument to initialize must be either 'user' or 'client'"
end
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index e1f2d56aaf..ac7a68d0fc 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -21,6 +21,7 @@ require "forwardable" unless defined?(Forwardable)
require_relative "version"
require "mixlib/cli" unless defined?(Mixlib::CLI)
require "chef-utils/dsl/default_paths" unless defined?(ChefUtils::DSL::DefaultPaths)
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require_relative "workstation_config_loader"
require_relative "mixin/convert_to_class_name"
require_relative "mixin/default_paths"
@@ -32,12 +33,11 @@ require_relative "http/authenticator"
require_relative "http/http_request"
require_relative "http"
require "pp" unless defined?(PP)
-require_relative "dist"
class Chef
class Knife
- Chef::HTTP::HTTPRequest.user_agent = "#{Chef::Dist::PRODUCT} Knife#{Chef::HTTP::HTTPRequest::UA_COMMON}"
+ Chef::HTTP::HTTPRequest.user_agent = "#{ChefUtils::Dist::Infra::PRODUCT} Knife#{Chef::HTTP::HTTPRequest::UA_COMMON}"
include Mixlib::CLI
include ChefUtils::DSL::DefaultPaths
@@ -282,7 +282,7 @@ class Chef
elsif category_commands = guess_category(args)
list_commands(category_commands)
elsif OFFICIAL_PLUGINS.include?(args[0]) # command was an uninstalled official chef knife plugin
- ui.info("Use `#{Chef::Dist::EXEC} gem install knife-#{args[0]}` to install the plugin into Chef Workstation")
+ ui.info("Use `#{ChefUtils::Dist::Infra::EXEC} gem install knife-#{args[0]}` to install the plugin into Chef Workstation")
else
list_commands
end
@@ -564,7 +564,7 @@ class Chef
ui.error "The API version that Knife is using is not supported by the server you sent this request to."
ui.info "The request that Knife sent was using API version #{client_api_version}."
ui.info "The server you sent the request to supports a min API version of #{min_server_version} and a max API version of #{max_server_version}."
- ui.info "Please either update your #{Chef::Dist::PRODUCT} or the server to be a compatible set."
+ ui.info "Please either update your #{ChefUtils::Dist::Infra::PRODUCT} or the server to be a compatible set."
else
ui.error response.message
ui.info "Response: #{format_rest_error(response)}"
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index a3f7d3a23c..1550c62dc1 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -18,9 +18,11 @@
require_relative "../knife"
require_relative "data_bag_secret_options"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require "license_acceptance/cli_flags/mixlib_cli"
-require "license_acceptance/acceptor"
+module LicenseAcceptance
+ autoload :Acceptor, "license_acceptance/acceptor"
+end
class Chef
class Knife
@@ -144,7 +146,7 @@ class Chef
# client.rb content via chef-full/bootstrap_context
option :bootstrap_version,
long: "--bootstrap-version VERSION",
- description: "The version of #{Chef::Dist::PRODUCT} to install."
+ description: "The version of #{ChefUtils::Dist::Infra::PRODUCT} to install."
option :channel,
long: "--channel CHANNEL",
@@ -176,7 +178,7 @@ class Chef
option :bootstrap_template,
short: "-t TEMPLATE",
long: "--bootstrap-template TEMPLATE",
- description: "Bootstrap #{Chef::Dist::PRODUCT} using a built-in or custom template. Set to the full path of an erb template or use one of the built-in templates."
+ description: "Bootstrap #{ChefUtils::Dist::Infra::PRODUCT} using a built-in or custom template. Set to the full path of an erb template or use one of the built-in templates."
# client.rb content via bootstrap_context
option :node_ssl_verify_mode,
@@ -194,7 +196,7 @@ class Chef
# bootstrap_context - client.rb
option :node_verify_api_cert,
long: "--[no-]node-verify-api-cert",
- description: "Verify the SSL cert for HTTPS requests to the #{Chef::Dist::SERVER_PRODUCT} API.",
+ description: "Verify the SSL cert for HTTPS requests to the #{ChefUtils::Dist::Server::PRODUCT} API.",
boolean: true
# runtime - sudo settings (train handles sudo)
@@ -252,14 +254,14 @@ class Chef
option :first_boot_attributes,
short: "-j JSON_ATTRIBS",
long: "--json-attributes",
- description: "A JSON string to be added to the first run of #{Chef::Dist::CLIENT}.",
+ description: "A JSON string to be added to the first run of #{ChefUtils::Dist::Infra::CLIENT}.",
proc: lambda { |o| Chef::JSONCompat.parse(o) },
default: nil
# bootstrap template
option :first_boot_attributes_from_file,
long: "--json-attribute-file FILE",
- description: "A JSON file to be used to the first run of #{Chef::Dist::CLIENT}.",
+ description: "A JSON file to be used to the first run of #{ChefUtils::Dist::Infra::CLIENT}.",
proc: lambda { |o| Chef::JSONCompat.parse(File.read(o)) },
default: nil
@@ -290,28 +292,28 @@ class Chef
option :msi_url, # Windows target only
short: "-m URL",
long: "--msi-url URL",
- description: "Location of the #{Chef::Dist::PRODUCT} MSI. The default templates will prefer to download from this location. The MSI will be downloaded from #{Chef::Dist::WEBSITE} if not provided (Windows).",
+ description: "Location of the #{ChefUtils::Dist::Infra::PRODUCT} MSI. The default templates will prefer to download from this location. The MSI will be downloaded from #{ChefUtils::Dist::Org::WEBSITE} if not provided (Windows).",
default: ""
# bootstrap override: Do this instead of our own setup.sh from omnitruck. Causes bootstrap_url to be ignored.
option :bootstrap_install_command,
long: "--bootstrap-install-command COMMANDS",
- description: "Custom command to install #{Chef::Dist::PRODUCT}."
+ description: "Custom command to install #{ChefUtils::Dist::Infra::PRODUCT}."
# bootstrap template: Run this command first in the bootstrap script
option :bootstrap_preinstall_command,
long: "--bootstrap-preinstall-command COMMANDS",
- description: "Custom commands to run before installing #{Chef::Dist::PRODUCT}."
+ description: "Custom commands to run before installing #{ChefUtils::Dist::Infra::PRODUCT}."
# bootstrap template
option :bootstrap_wget_options,
long: "--bootstrap-wget-options OPTIONS",
- description: "Add options to wget when installing #{Chef::Dist::PRODUCT}."
+ description: "Add options to wget when installing #{ChefUtils::Dist::Infra::PRODUCT}."
# bootstrap template
option :bootstrap_curl_options,
long: "--bootstrap-curl-options OPTIONS",
- description: "Add options to curl when install #{Chef::Dist::PRODUCT}."
+ description: "Add options to curl when install #{ChefUtils::Dist::Infra::PRODUCT}."
# chef_vault_handler
option :bootstrap_vault_file,
@@ -328,7 +330,7 @@ class Chef
long: "--bootstrap-vault-item VAULT_ITEM",
description: 'A single vault and item to update as "vault:item".',
proc: Proc.new { |i, accumulator|
- (vault, item) = i.split(/:/)
+ (vault, item) = i.split(":")
accumulator ||= {}
accumulator[vault] ||= []
accumulator[vault].push(item)
@@ -405,6 +407,7 @@ class Chef
deps do
require "erubis" unless defined?(Erubis)
+ require "net/ssh" unless defined?(Net::SSH)
require_relative "../json_compat"
require_relative "../util/path_helper"
require_relative "bootstrap/chef_vault_handler"
@@ -487,7 +490,7 @@ class Chef
# Otherwise search the template directories until we find the right one
bootstrap_files = []
- bootstrap_files << File.join(File.dirname(__FILE__), "bootstrap/templates", "#{template}.erb")
+ bootstrap_files << File.join(__dir__, "bootstrap/templates", "#{template}.erb")
bootstrap_files << File.join(Knife.chef_config_dir, "bootstrap", "#{template}.erb") if Chef::Knife.chef_config_dir
Chef::Util::PathHelper.home(".chef", "bootstrap", "#{template}.erb") { |p| bootstrap_files << p }
bootstrap_files << Gem.find_files(File.join("chef", "knife", "bootstrap", "#{template}.erb"))
@@ -538,7 +541,7 @@ class Chef
end
def run
- check_license if ChefConfig::Dist::ENFORCE_LICENSE
+ check_license if ChefUtils::Dist::Org::ENFORCE_LICENSE
plugin_setup!
validate_name_args!
diff --git a/lib/chef/knife/bootstrap/chef_vault_handler.rb b/lib/chef/knife/bootstrap/chef_vault_handler.rb
index b36c178d8e..20759d6fdf 100644
--- a/lib/chef/knife/bootstrap/chef_vault_handler.rb
+++ b/lib/chef/knife/bootstrap/chef_vault_handler.rb
@@ -112,7 +112,7 @@ class Chef
if bootstrap_vault_item
bootstrap_vault_item
else
- json = bootstrap_vault_json ? bootstrap_vault_json : File.read(bootstrap_vault_file)
+ json = bootstrap_vault_json || File.read(bootstrap_vault_file)
Chef::JSONCompat.from_json(json)
end
end
diff --git a/lib/chef/knife/bootstrap/templates/chef-full.erb b/lib/chef/knife/bootstrap/templates/chef-full.erb
index 5006009617..2e0c80eaef 100644
--- a/lib/chef/knife/bootstrap/templates/chef-full.erb
+++ b/lib/chef/knife/bootstrap/templates/chef-full.erb
@@ -172,8 +172,8 @@ do_download() {
<%= @config[:bootstrap_install_command] %>
<% else %>
install_sh="<%= @config[:bootstrap_url] ? @config[:bootstrap_url] : "https://omnitruck.chef.io/chef/install.sh" %>"
- if test -f /usr/bin/<%= Chef::Dist::CLIENT %>; then
- echo "-----> Existing <%= Chef::Dist::PRODUCT %> installation detected"
+ if test -f /usr/bin/<%= ChefUtils::Dist::Infra::CLIENT %>; then
+ echo "-----> Existing <%= ChefUtils::Dist::Infra::PRODUCT %> installation detected"
else
echo "-----> Installing Chef Omnibus (<%= @config[:channel] %>/<%= version_to_install %>)"
do_download ${install_sh} $tmp_dir/install.sh
@@ -237,6 +237,6 @@ mkdir -p /etc/chef/client.d
<%= client_d %>
<% end -%>
-echo "Starting the first <%= Chef::Dist::PRODUCT %> Client run..."
+echo "Starting the first <%= ChefUtils::Dist::Infra::PRODUCT %> Client run..."
<%= start_chef %>
diff --git a/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb b/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb
index 9699c09b0e..7aa7be49f8 100644
--- a/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb
+++ b/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb
@@ -109,13 +109,13 @@ goto Version10.0
goto chef_installed
:chef_installed
-@echo Checking for existing <%= Chef::Dist::PRODUCT %> installation
-WHERE <%= Chef::Dist::CLIENT %> >nul 2>nul
+@echo Checking for existing <%= ChefUtils::Dist::Infra::PRODUCT %> installation
+WHERE <%= ChefUtils::Dist::Infra::CLIENT %> >nul 2>nul
If !ERRORLEVEL!==0 (
- @echo Existing <%= Chef::Dist::PRODUCT %> installation detected, skipping download
+ @echo Existing <%= ChefUtils::Dist::Infra::PRODUCT %> installation detected, skipping download
goto key_create
) else (
- @echo No existing installation of <%= Chef::Dist::PRODUCT %> detected
+ @echo No existing installation of <%= ChefUtils::Dist::Infra::PRODUCT %> detected
goto install
)
@@ -127,7 +127,7 @@ If !ERRORLEVEL!==0 (
@rem Install Chef using the MSI installer
@set "LOCAL_DESTINATION_MSI_PATH=<%= local_download_path %>"
- @set "CHEF_CLIENT_MSI_LOG_PATH=%TEMP%\<%= Chef::Dist::CLIENT %>-msi%RANDOM%.log"
+ @set "CHEF_CLIENT_MSI_LOG_PATH=%TEMP%\<%= ChefUtils::Dist::Infra::CLIENT %>-msi%RANDOM%.log"
@rem Clear any pre-existing downloads
@echo Checking for existing downloaded package at "%LOCAL_DESTINATION_MSI_PATH%"
@@ -197,7 +197,7 @@ If !ERRORLEVEL!==0 (
<%= install_chef %>
@if ERRORLEVEL 1 (
- echo <%= Chef::Dist::CLIENT %> package failed to install with status code !ERRORLEVEL!. > "&2"
+ echo <%= ChefUtils::Dist::Infra::CLIENT %> package failed to install with status code !ERRORLEVEL!. > "&2"
echo See installation log for additional detail: %CHEF_CLIENT_MSI_LOG_PATH%. > "&2"
) else (
@echo Installation completed successfully
@@ -230,9 +230,9 @@ echo Writing validation key...
echo Validation key written.
@echo on
-<% if @config[:secret] -%>
+<% if secret -%>
> <%= bootstrap_directory %>\encrypted_data_bag_secret (
- <%= secret %>
+ <%= encrypted_data_bag_secret %>
)
<% end -%>
@@ -274,5 +274,5 @@ echo Validation key written.
<%= client_d %>
<% end -%>
-@echo Starting <%= Chef::Dist::CLIENT %> to bootstrap the node...
+@echo Starting <%= ChefUtils::Dist::Infra::CLIENT %> to bootstrap the node...
<%= start_chef %>
diff --git a/lib/chef/knife/bootstrap/train_connector.rb b/lib/chef/knife/bootstrap/train_connector.rb
index 8a1e5863bb..a220ece5bc 100644
--- a/lib/chef/knife/bootstrap/train_connector.rb
+++ b/lib/chef/knife/bootstrap/train_connector.rb
@@ -285,7 +285,7 @@ class Chef
# Train.unpack_target_from_uri only works for complete URIs in
# form of proto://[user[:pass]@]host[:port]/
# So we'll add the protocol prefix if it's not supplied.
- uri_to_check = if URI.regexp.match(uri)
+ uri_to_check = if URI::DEFAULT_PARSER.make_regexp.match(uri)
uri
else
"#{default_protocol}://#{uri}"
diff --git a/lib/chef/knife/client_create.rb b/lib/chef/knife/client_create.rb
index 9e9975ec0d..d6e0eab63b 100644
--- a/lib/chef/knife/client_create.rb
+++ b/lib/chef/knife/client_create.rb
@@ -17,7 +17,7 @@
#
require_relative "../knife"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -30,7 +30,7 @@ class Chef
option :file,
short: "-f FILE",
long: "--file FILE",
- description: "Write the private key to a file if the #{Chef::Dist::SERVER_PRODUCT} generated one."
+ description: "Write the private key to a file if the #{ChefUtils::Dist::Server::PRODUCT} generated one."
option :validator,
long: "--validator",
@@ -45,7 +45,7 @@ class Chef
option :prevent_keygen,
short: "-k",
long: "--prevent-keygen",
- description: "Prevent #{Chef::Dist::SERVER_PRODUCT} from generating a default key pair for you. Cannot be passed with --public-key.",
+ description: "Prevent #{ChefUtils::Dist::Server::PRODUCT} from generating a default key pair for you. Cannot be passed with --public-key.",
boolean: true
banner "knife client create CLIENTNAME (options)"
diff --git a/lib/chef/knife/config_show.rb b/lib/chef/knife/config_show.rb
index b8b55e11f6..7f28891885 100644
--- a/lib/chef/knife/config_show.rb
+++ b/lib/chef/knife/config_show.rb
@@ -79,7 +79,7 @@ class Chef
end
else
# It's a dotted path string.
- filter_parts = filter.split(/\./)
+ filter_parts = filter.split(".")
extract = lambda do |memo, filter_part|
memo.is_a?(Hash) ? memo[filter_part.to_sym] : nil
end
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb
index dc19e40d47..2a27fd5d88 100644
--- a/lib/chef/knife/configure.rb
+++ b/lib/chef/knife/configure.rb
@@ -17,7 +17,7 @@
#
require_relative "../knife"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -119,7 +119,7 @@ class Chef
if config[:initial]
@new_client_name = config[:node_name] || ask_question("Please enter a name for the new user: ", default: Etc.getlogin)
@admin_client_name = config[:admin_client_name] || ask_question("Please enter the existing admin name: ", default: "admin")
- @admin_client_key = config[:admin_client_key] || ask_question("Please enter the location of the existing admin's private key: ", default: "#{Chef::Dist::SERVER_CONF_DIR}/admin.pem")
+ @admin_client_key = config[:admin_client_key] || ask_question("Please enter the location of the existing admin's private key: ", default: "#{ChefUtils::Dist::Server::CONF_DIR}/admin.pem")
@admin_client_key = File.expand_path(@admin_client_key)
else
@new_client_name = config[:node_name] || ask_question("Please enter an existing username or clientname for the API: ", default: Etc.getlogin)
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index a70e463089..9aa81da82f 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -19,7 +19,7 @@
require_relative "../../run_list"
require_relative "../../util/path_helper"
require "pathname" unless defined?(Pathname)
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -184,7 +184,7 @@ class Chef
def start_chef
# If the user doesn't have a client path configure, let bash use the PATH for what it was designed for
- client_path = chef_config[:chef_client_path] || "#{Chef::Dist::CLIENT}"
+ client_path = chef_config[:chef_client_path] || ChefUtils::Dist::Infra::CLIENT
s = "#{client_path} -j /etc/chef/first-boot.json"
if config[:verbosity] && config[:verbosity] >= 3
s << " -l trace"
diff --git a/lib/chef/knife/core/cookbook_scm_repo.rb b/lib/chef/knife/core/cookbook_scm_repo.rb
index 31654d2954..ba194a8a6d 100644
--- a/lib/chef/knife/core/cookbook_scm_repo.rb
+++ b/lib/chef/knife/core/cookbook_scm_repo.rb
@@ -22,7 +22,7 @@ class Chef
class Knife
class CookbookSCMRepo
- DIRTY_REPO = /^[\s]+M/.freeze
+ DIRTY_REPO = /^\s+M/.freeze
include Chef::Mixin::ShellOut
diff --git a/lib/chef/knife/core/gem_glob_loader.rb b/lib/chef/knife/core/gem_glob_loader.rb
index b29df38c86..d058379e71 100644
--- a/lib/chef/knife/core/gem_glob_loader.rb
+++ b/lib/chef/knife/core/gem_glob_loader.rb
@@ -22,7 +22,7 @@ class Chef
class Knife
class SubcommandLoader
class GemGlobLoader < Chef::Knife::SubcommandLoader
- MATCHES_CHEF_GEM ||= %r{/chef-[\d]+\.[\d]+\.[\d]+}.freeze
+ MATCHES_CHEF_GEM ||= %r{/chef-\d+\.\d+\.\d+}.freeze
MATCHES_THIS_CHEF_GEM ||= %r{/chef-#{Chef::VERSION}(-\w+)?(-\w+)?/}.freeze
def subcommand_files
diff --git a/lib/chef/knife/core/object_loader.rb b/lib/chef/knife/core/object_loader.rb
index 9cabbf97db..5421fc46ce 100644
--- a/lib/chef/knife/core/object_loader.rb
+++ b/lib/chef/knife/core/object_loader.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "ffi_yajl" unless defined?(FFI_Yajl)
+autoload :FFI_Yajl, "ffi_yajl"
require_relative "../../util/path_helper"
require_relative "../../data_bag_item"
diff --git a/lib/chef/knife/core/ui.rb b/lib/chef/knife/core/ui.rb
index 0d467b69c8..aa84537064 100644
--- a/lib/chef/knife/core/ui.rb
+++ b/lib/chef/knife/core/ui.rb
@@ -64,13 +64,16 @@ class Chef
# Creates a new object of class TTY::Prompt
# with interrupt as exit so that it can be terminated with status code.
def prompt
- @prompt ||= TTY::Prompt.new(interrupt: :exit)
+ @prompt ||= begin
+ require "tty-prompt"
+ TTY::Prompt.new(interrupt: :exit)
+ end
end
# pastel.decorate is a lightweight replacement for highline.color
def pastel
@pastel ||= begin
- require "pastel"
+ require "pastel" unless defined?(Pastel)
Pastel.new
end
end
diff --git a/lib/chef/knife/core/windows_bootstrap_context.rb b/lib/chef/knife/core/windows_bootstrap_context.rb
index 7b4d517237..fa8b43f383 100644
--- a/lib/chef/knife/core/windows_bootstrap_context.rb
+++ b/lib/chef/knife/core/windows_bootstrap_context.rb
@@ -18,7 +18,7 @@
require_relative "bootstrap_context"
require_relative "../../util/path_helper"
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -32,6 +32,7 @@ class Chef
class WindowsBootstrapContext < BootstrapContext
attr_accessor :config
attr_accessor :chef_config
+ attr_accessor :secret
def initialize(config, run_list, chef_config, secret = nil)
@config = config
@@ -49,8 +50,8 @@ class Chef
end
end
- def secret
- escape_and_echo(config[:secret])
+ def encrypted_data_bag_secret
+ escape_and_echo(@secret)
end
def trusted_certs_script
@@ -134,12 +135,12 @@ class Chef
client_rb << %Q{no_proxy "#{config[:bootstrap_no_proxy]}"\n}
end
- if config[:secret]
- client_rb << %Q{encrypted_data_bag_secret "#{ChefConfig::Config.etc_chef_dir(windows: true)}/encrypted_data_bag_secret"\n}
+ if secret
+ client_rb << %Q{encrypted_data_bag_secret "#{ChefConfig::PathHelper.escapepath(ChefConfig::Config.etc_chef_dir(windows: true))}\\\\encrypted_data_bag_secret"\n}
end
unless trusted_certs_script.empty?
- client_rb << %Q{trusted_certs_dir "#{ChefConfig::Config.etc_chef_dir(windows: true)}/trusted_certs"\n}
+ client_rb << %Q{trusted_certs_dir "#{ChefConfig::PathHelper.escapepath(ChefConfig::Config.etc_chef_dir(windows: true))}\\\\trusted_certs"\n}
end
if chef_config[:fips]
@@ -175,7 +176,7 @@ class Chef
bootstrap_environment_option = bootstrap_environment.nil? ? "" : " -E #{bootstrap_environment}"
start_chef = "SET \"PATH=%SYSTEM32%;%SystemRoot%;%SYSTEM32%\\Wbem;%SYSTEM32%\\WindowsPowerShell\\v1.0\\;C:\\ruby\\bin;#{c_opscode_dir}\\bin;#{c_opscode_dir}\\embedded\\bin\;%PATH%\"\n"
- start_chef << "#{Chef::Dist::CLIENT} -c #{client_rb} -j #{first_boot}#{bootstrap_environment_option}\n"
+ start_chef << "#{ChefUtils::Dist::Infra::CLIENT} -c #{client_rb} -j #{first_boot}#{bootstrap_environment_option}\n"
end
def win_wget
@@ -255,6 +256,8 @@ class Chef
[String] $localPath
)
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+
$ProxyUrl = $env:http_proxy;
$webClient = new-object System.Net.WebClient;
@@ -288,7 +291,7 @@ class Chef
end
def local_download_path
- "%TEMP%\\#{Chef::Dist::CLIENT}-latest.msi"
+ "%TEMP%\\#{ChefUtils::Dist::Infra::CLIENT}-latest.msi"
end
# Build a URL to query www.chef.io that will redirect to the correct
@@ -365,7 +368,7 @@ class Chef
<<~EOH
@set MSIERRORCODE=!ERRORLEVEL!
@if ERRORLEVEL 1 (
- @echo WARNING: Failed to install #{Chef::Dist::PRODUCT} MSI package in remote context with status code !MSIERRORCODE!.
+ @echo WARNING: Failed to install #{ChefUtils::Dist::Infra::PRODUCT} MSI package in remote context with status code !MSIERRORCODE!.
@echo WARNING: This may be due to a defect in operating system update KB2918614: http://support.microsoft.com/kb/2918614
@set OLDLOGLOCATION="%CHEF_CLIENT_MSI_LOG_PATH%-fail.log"
@move "%CHEF_CLIENT_MSI_LOG_PATH%" "!OLDLOGLOCATION!" > NUL
@@ -374,26 +377,26 @@ class Chef
@schtasks /create /f /sc once /st 00:00:00 /tn chefclientbootstraptask /ru SYSTEM /rl HIGHEST /tr \"cmd /c #{command} & sleep 2 & waitfor /s %computername% /si chefclientinstalldone\"
@if ERRORLEVEL 1 (
- @echo ERROR: Failed to create #{Chef::Dist::PRODUCT} installation scheduled task with status code !ERRORLEVEL! > "&2"
+ @echo ERROR: Failed to create #{ChefUtils::Dist::Infra::PRODUCT} installation scheduled task with status code !ERRORLEVEL! > "&2"
) else (
- @echo Successfully created scheduled task to install #{Chef::Dist::PRODUCT}.
+ @echo Successfully created scheduled task to install #{ChefUtils::Dist::Infra::PRODUCT}.
@schtasks /run /tn chefclientbootstraptask
@if ERRORLEVEL 1 (
- @echo ERROR: Failed to execute #{Chef::Dist::PRODUCT} installation scheduled task with status code !ERRORLEVEL!. > "&2"
+ @echo ERROR: Failed to execute #{ChefUtils::Dist::Infra::PRODUCT} installation scheduled task with status code !ERRORLEVEL!. > "&2"
) else (
- @echo Successfully started #{Chef::Dist::PRODUCT} installation scheduled task.
+ @echo Successfully started #{ChefUtils::Dist::Infra::PRODUCT} installation scheduled task.
@echo Waiting for installation to complete -- this may take a few minutes...
waitfor chefclientinstalldone /t 600
if ERRORLEVEL 1 (
- @echo ERROR: Timed out waiting for #{Chef::Dist::PRODUCT} package to install
+ @echo ERROR: Timed out waiting for #{ChefUtils::Dist::Infra::PRODUCT} package to install
) else (
- @echo Finished waiting for #{Chef::Dist::PRODUCT} package to install.
+ @echo Finished waiting for #{ChefUtils::Dist::Infra::PRODUCT} package to install.
)
@schtasks /delete /f /tn chefclientbootstraptask > NUL
)
)
) else (
- @echo Successfully installed #{Chef::Dist::PRODUCT} package.
+ @echo Successfully installed #{ChefUtils::Dist::Infra::PRODUCT} package.
)
EOH
end
diff --git a/lib/chef/knife/exec.rb b/lib/chef/knife/exec.rb
index 9286a91022..d3ce2cee24 100644
--- a/lib/chef/knife/exec.rb
+++ b/lib/chef/knife/exec.rb
@@ -17,7 +17,7 @@
#
require_relative "../knife"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef::Knife::Exec < Chef::Knife
@@ -30,7 +30,7 @@ class Chef::Knife::Exec < Chef::Knife
option :exec,
short: "-E CODE",
long: "--exec CODE",
- description: "A string of #{Chef::Dist::PRODUCT} code to execute."
+ description: "A string of #{ChefUtils::Dist::Infra::PRODUCT} code to execute."
option :script_path,
short: "-p PATH:PATH",
diff --git a/lib/chef/knife/node_policy_set.rb b/lib/chef/knife/node_policy_set.rb
index cfbae1ff6f..d34ebd9478 100644
--- a/lib/chef/knife/node_policy_set.rb
+++ b/lib/chef/knife/node_policy_set.rb
@@ -45,7 +45,7 @@ class Chef
# Set policy name and group to node
def set_policy(node)
- policy_group, policy_name = @name_args[1..-1]
+ policy_group, policy_name = @name_args[1..]
node.policy_name = policy_name
node.policy_group = policy_group
end
@@ -70,7 +70,7 @@ class Chef
# True if one of policy_name or policy_group was given, but not both
def incomplete_policyfile_options?
- policy_group, policy_name = @name_args[1..-1]
+ policy_group, policy_name = @name_args[1..]
(policy_group.nil? || policy_name.nil? || @name_args[1..-1].size > 2)
end
diff --git a/lib/chef/knife/node_run_list_add.rb b/lib/chef/knife/node_run_list_add.rb
index ac5f09bae9..40476371eb 100644
--- a/lib/chef/knife/node_run_list_add.rb
+++ b/lib/chef/knife/node_run_list_add.rb
@@ -43,7 +43,7 @@ class Chef
node = Chef::Node.load(@name_args[0])
if @name_args.size > 2
# Check for nested lists and create a single plain one
- entries = @name_args[1..-1].map do |entry|
+ entries = @name_args[1..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/node_run_list_remove.rb b/lib/chef/knife/node_run_list_remove.rb
index 08f4e5d382..484e575475 100644
--- a/lib/chef/knife/node_run_list_remove.rb
+++ b/lib/chef/knife/node_run_list_remove.rb
@@ -34,7 +34,7 @@ class Chef
if @name_args.size > 2
# Check for nested lists and create a single plain one
- entries = @name_args[1..-1].map do |entry|
+ entries = @name_args[1..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/node_run_list_set.rb b/lib/chef/knife/node_run_list_set.rb
index eae05003ff..f356b39d95 100644
--- a/lib/chef/knife/node_run_list_set.rb
+++ b/lib/chef/knife/node_run_list_set.rb
@@ -36,7 +36,7 @@ class Chef
exit 1
elsif @name_args.size > 2
# Check for nested lists and create a single plain one
- entries = @name_args[1..-1].map do |entry|
+ entries = @name_args[1..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/node_show.rb b/lib/chef/knife/node_show.rb
index 801f0bbba9..8ef06d8938 100644
--- a/lib/chef/knife/node_show.rb
+++ b/lib/chef/knife/node_show.rb
@@ -18,7 +18,7 @@
require_relative "../knife"
require_relative "core/node_presenter"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -42,7 +42,7 @@ class Chef
option :environment,
short: "-E",
long: "--environment",
- description: "Show only the #{Chef::Dist::PRODUCT} environment."
+ description: "Show only the #{ChefUtils::Dist::Infra::PRODUCT} environment."
def run
ui.use_presenter Knife::Core::NodePresenter
diff --git a/lib/chef/knife/role_env_run_list_add.rb b/lib/chef/knife/role_env_run_list_add.rb
index 1fc8ef1e74..b5753b46fc 100644
--- a/lib/chef/knife/role_env_run_list_add.rb
+++ b/lib/chef/knife/role_env_run_list_add.rb
@@ -68,7 +68,7 @@ class Chef
if @name_args.size > 2
# Check for nested lists and create a single plain one
- entries = @name_args[2..-1].map do |entry|
+ entries = @name_args[2..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/role_env_run_list_set.rb b/lib/chef/knife/role_env_run_list_set.rb
index d9294b9bc4..0f1ce62a5d 100644
--- a/lib/chef/knife/role_env_run_list_set.rb
+++ b/lib/chef/knife/role_env_run_list_set.rb
@@ -51,7 +51,7 @@ class Chef
exit 1
elsif @name_args.size > 2
# Check for nested lists and create a single plain one
- entries = @name_args[2..-1].map do |entry|
+ entries = @name_args[2..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/role_run_list_add.rb b/lib/chef/knife/role_run_list_add.rb
index 5ed91d5d49..76633ff5f6 100644
--- a/lib/chef/knife/role_run_list_add.rb
+++ b/lib/chef/knife/role_run_list_add.rb
@@ -68,7 +68,7 @@ class Chef
if @name_args.size > 1
# Check for nested lists and create a single plain one
- entries = @name_args[1..-1].map do |entry|
+ entries = @name_args[1..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/role_run_list_set.rb b/lib/chef/knife/role_run_list_set.rb
index 7302797c33..ad1a5e2923 100644
--- a/lib/chef/knife/role_run_list_set.rb
+++ b/lib/chef/knife/role_run_list_set.rb
@@ -50,7 +50,7 @@ class Chef
exit 1
elsif @name_args.size > 1
# Check for nested lists and create a single plain one
- entries = @name_args[1..-1].map do |entry|
+ entries = @name_args[1..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
diff --git a/lib/chef/knife/search.rb b/lib/chef/knife/search.rb
index 9297a89686..2feb8e6729 100644
--- a/lib/chef/knife/search.rb
+++ b/lib/chef/knife/search.rb
@@ -26,7 +26,6 @@ class Chef
include Knife::Core::MultiAttributeReturnOption
deps do
- require "addressable/uri" unless defined?(Addressable::URI)
require_relative "../node"
require_relative "../environment"
require_relative "../api_client"
diff --git a/lib/chef/knife/serve.rb b/lib/chef/knife/serve.rb
index cce2ff6576..d79e05aa85 100644
--- a/lib/chef/knife/serve.rb
+++ b/lib/chef/knife/serve.rb
@@ -16,7 +16,7 @@
require_relative "../knife"
require_relative "../local_mode"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -30,11 +30,11 @@ class Chef
option :chef_repo_path,
long: "--chef-repo-path PATH",
- description: "Overrides the location of #{Chef::Dist::PRODUCT} repo. Default is specified by chef_repo_path in the config."
+ description: "Overrides the location of #{ChefUtils::Dist::Infra::PRODUCT} repo. Default is specified by chef_repo_path in the config."
option :chef_zero_host,
long: "--chef-zero-host IP",
- description: "Overrides the host upon which #{Chef::Dist::ZERO} listens. Default is 127.0.0.1."
+ description: "Overrides the host upon which #{ChefUtils::Dist::Zero::PRODUCT} listens. Default is 127.0.0.1."
def configure_chef
super
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index a6428d9726..8681fdfd02 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -289,7 +289,7 @@ class Chef
opts[:port] = port unless port.nil?
opts[:logger] = Chef::Log.with_child(subsystem: "net/ssh") if Chef::Log.level == :trace
unless config[:host_key_verify]
- opts[:verify_host_key] = false
+ opts[:verify_host_key] = :never
opts[:user_known_hosts_file] = "/dev/null"
end
if ssh_config[:keepalive]
@@ -385,6 +385,8 @@ class Chef
end
ch.on_extended_data do |_, _type, data|
+ raise ArgumentError if data.eql?("sudo: no tty present and no askpass program specified\n")
+
stderr += data
end
@@ -489,7 +491,7 @@ class Chef
new_window_cmds = lambda do
if session.servers_for.size > 1
- [""] + session.servers_for[1..-1].map do |server|
+ [""] + session.servers_for[1..].map do |server|
if config[:tmux_split]
"split-window #{ssh_dest.call(server)}; tmux select-layout tiled"
else
@@ -625,7 +627,7 @@ class Chef
when "cssh"
cssh
else
- ssh_command(@name_args[1..-1].join(" "))
+ ssh_command(@name_args[1..].join(" "))
end
session.close
diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb
index 65e8694497..0cc4141d42 100644
--- a/lib/chef/knife/ssl_check.rb
+++ b/lib/chef/knife/ssl_check.rb
@@ -17,7 +17,7 @@
#
require_relative "../knife"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -190,7 +190,7 @@ class Chef
#{ui.color("TO FIX THIS ERROR:", :bold)}
If the server you are connecting to uses a self-signed certificate, you must
- configure #{Chef::Dist::PRODUCT} to trust that server's certificate.
+ configure #{ChefUtils::Dist::Infra::PRODUCT} to trust that server's certificate.
By default, the certificate is stored in the following location on the host
where your chef-server runs:
@@ -234,7 +234,7 @@ class Chef
end
def debug_chef_ssl_config
- ui.err "#{Chef::Dist::PRODUCT} SSL Configuration:"
+ ui.err "#{ChefUtils::Dist::Infra::PRODUCT} SSL Configuration:"
ui.err "* ssl_ca_path: #{configuration.ssl_ca_path.inspect}"
ui.err "* ssl_ca_file: #{configuration.ssl_ca_file.inspect}"
ui.err "* trusted_certs_dir: #{configuration.trusted_certs_dir.inspect}"
diff --git a/lib/chef/knife/status.rb b/lib/chef/knife/status.rb
index 530cf791f7..ea5dffdf6c 100644
--- a/lib/chef/knife/status.rb
+++ b/lib/chef/knife/status.rb
@@ -19,7 +19,7 @@
require_relative "../knife"
require_relative "core/status_presenter"
require_relative "core/node_presenter"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -44,7 +44,7 @@ class Chef
option :hide_by_mins,
long: "--hide-by-mins MINS",
- description: "Hide nodes that have run #{Chef::Dist::CLIENT} in the last MINS minutes"
+ description: "Hide nodes that have run #{ChefUtils::Dist::Infra::CLIENT} in the last MINS minutes"
def append_to_query(term)
@query << " AND " unless @query.empty?
diff --git a/lib/chef/knife/tag_create.rb b/lib/chef/knife/tag_create.rb
index fe357981b7..2f0d302e74 100644
--- a/lib/chef/knife/tag_create.rb
+++ b/lib/chef/knife/tag_create.rb
@@ -32,7 +32,7 @@ class Chef
def run
name = @name_args[0]
- tags = @name_args[1..-1]
+ tags = @name_args[1..]
if name.nil? || tags.nil? || tags.empty?
show_usage
diff --git a/lib/chef/knife/tag_delete.rb b/lib/chef/knife/tag_delete.rb
index 1c9f2185d7..85fa6a9e27 100644
--- a/lib/chef/knife/tag_delete.rb
+++ b/lib/chef/knife/tag_delete.rb
@@ -32,7 +32,7 @@ class Chef
def run
name = @name_args[0]
- tags = @name_args[1..-1]
+ tags = @name_args[1..]
if name.nil? || tags.nil? || tags.empty?
show_usage
diff --git a/lib/chef/knife/user_create.rb b/lib/chef/knife/user_create.rb
index 785020f5e3..6d68f3ebbb 100644
--- a/lib/chef/knife/user_create.rb
+++ b/lib/chef/knife/user_create.rb
@@ -18,7 +18,7 @@
#
require_relative "../knife"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Knife
@@ -42,7 +42,7 @@ class Chef
option :prevent_keygen,
short: "-k",
long: "--prevent-keygen",
- description: "API V1 (#{Chef::Dist::SERVER_PRODUCT} 12.1+) only. Prevent server from generating a default key pair for you. Cannot be passed with --user-key.",
+ description: "API V1 (#{ChefUtils::Dist::Server::PRODUCT} 12.1+) only. Prevent server from generating a default key pair for you. Cannot be passed with --user-key.",
boolean: true
banner "knife user create USERNAME DISPLAY_NAME FIRST_NAME LAST_NAME EMAIL PASSWORD (options)"
diff --git a/lib/chef/knife/yaml_convert.rb b/lib/chef/knife/yaml_convert.rb
index ff64f5c53a..6bd2d1c0ea 100644
--- a/lib/chef/knife/yaml_convert.rb
+++ b/lib/chef/knife/yaml_convert.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "yaml" unless defined?(YAML)
+autoload :YAML, "yaml"
require_relative "../knife"
class Chef::Knife::YamlConvert < Chef::Knife
diff --git a/lib/chef/local_mode.rb b/lib/chef/local_mode.rb
index b7816cdc89..e7346322d2 100644
--- a/lib/chef/local_mode.rb
+++ b/lib/chef/local_mode.rb
@@ -15,9 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+require "chef-utils" unless defined?(ChefUtils::CANARY)
require_relative "config"
require_relative "monkey_patches/webrick-utils" if ChefUtils.windows?
-require_relative "dist"
class Chef
module LocalMode
@@ -79,7 +79,7 @@ class Chef
local_mode_url = @chef_zero_server.local_mode_url
- Chef::Log.info("Started #{Chef::Dist::ZERO} at #{local_mode_url} with #{@chef_fs.fs_description}")
+ Chef::Log.info("Started #{ChefUtils::Dist::Zero::PRODUCT} at #{local_mode_url} with #{@chef_fs.fs_description}")
Chef::Config.chef_server_url = local_mode_url
end
end
diff --git a/lib/chef/log/syslog.rb b/lib/chef/log/syslog.rb
index 5cf4de4602..4e6a6dd0b5 100644
--- a/lib/chef/log/syslog.rb
+++ b/lib/chef/log/syslog.rb
@@ -19,7 +19,7 @@
require "logger"
require "syslog-logger"
require_relative "../mixin/unformatter"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Log
@@ -33,7 +33,7 @@ class Chef
attr_accessor :sync, :formatter
- def initialize(program_name = "#{Chef::Dist::CLIENT}", facility = ::Syslog::LOG_DAEMON, logopts = nil)
+ def initialize(program_name = ChefUtils::Dist::Infra::CLIENT, facility = ::Syslog::LOG_DAEMON, logopts = nil)
super
return if defined? ::Logger::Syslog::SYSLOG
diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb
index 6aff6cccec..f060ecfde6 100644
--- a/lib/chef/log/winevt.rb
+++ b/lib/chef/log/winevt.rb
@@ -19,7 +19,7 @@
require_relative "../event_loggers/base"
require_relative "../platform/query_helpers"
require_relative "../mixin/unformatter"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Log
@@ -37,7 +37,7 @@ class Chef
FATAL_EVENT_ID = 10104
# Since we must install the event logger, this is not really configurable
- SOURCE = Chef::Dist::SHORT.freeze
+ SOURCE = ChefUtils::Dist::Infra::SHORT.freeze
include Chef::Mixin::Unformatter
diff --git a/lib/chef/mixin/convert_to_class_name.rb b/lib/chef/mixin/convert_to_class_name.rb
index 7bdbd7d39c..de11110574 100644
--- a/lib/chef/mixin/convert_to_class_name.rb
+++ b/lib/chef/mixin/convert_to_class_name.rb
@@ -66,62 +66,6 @@ class Chef
str = base.to_s + (file_base == "default" ? "" : "_#{file_base}")
normalize_snake_case_name(str)
end
-
- # Copied from rails activesupport. In ruby >= 2.0 const_get will just do this, so this can
- # be deprecated and removed.
- #
- # MIT LICENSE is here: https://github.com/rails/rails/blob/master/activesupport/MIT-LICENSE
-
- # Tries to find a constant with the name specified in the argument string.
- #
- # 'Module'.constantize # => Module
- # 'Test::Unit'.constantize # => Test::Unit
- #
- # The name is assumed to be the one of a top-level constant, no matter
- # whether it starts with "::" or not. No lexical context is taken into
- # account:
- #
- # C = 'outside'
- # module M
- # C = 'inside'
- # C # => 'inside'
- # 'C'.constantize # => 'outside', same as ::C
- # end
- #
- # NameError is raised when the name is not in CamelCase or the constant is
- # unknown.
- def constantize(camel_cased_word)
- names = camel_cased_word.split("::")
-
- # Trigger a built-in NameError exception including the ill-formed constant in the message.
- Object.const_get(camel_cased_word) if names.empty?
-
- # Remove the first blank element in case of '::ClassName' notation.
- names.shift if names.size > 1 && names.first.empty?
-
- names.inject(Object) do |constant, name|
- if constant == Object
- constant.const_get(name)
- else
- candidate = constant.const_get(name)
- next candidate if constant.const_defined?(name, false)
- next candidate unless Object.const_defined?(name)
-
- # Go down the ancestors to check if it is owned directly. The check
- # stops when we reach Object or the end of ancestors tree.
- constant = constant.ancestors.inject do |const, ancestor|
- break const if ancestor == Object
- break ancestor if ancestor.const_defined?(name, false)
-
- const
- end
-
- # owner is in Object, so raise
- constant.const_get(name, false)
- end
- end
- end
-
end
end
end
diff --git a/lib/chef/mixin/deep_merge.rb b/lib/chef/mixin/deep_merge.rb
index 300ae1a31f..ad9c9e89dd 100644
--- a/lib/chef/mixin/deep_merge.rb
+++ b/lib/chef/mixin/deep_merge.rb
@@ -75,14 +75,7 @@ class Chef
# @api private
#
def deep_merge!(source, dest)
- # if dest doesn't exist, then simply copy source to it
- if dest.nil?
- dest = source; return dest
- end
-
case source
- when nil
- dest
when Hash
if dest.is_a?(Hash)
source.each do |src_key, src_value|
@@ -147,11 +140,6 @@ class Chef
end
end
merge_onto
-
- # If merge_with is nil, don't replace merge_onto
- elsif merge_with.nil?
- merge_onto
-
# In all other cases, replace merge_onto with merge_with
else
merge_with
diff --git a/lib/chef/mixin/openssl_helper.rb b/lib/chef/mixin/openssl_helper.rb
index db422175bb..69583bea98 100644
--- a/lib/chef/mixin/openssl_helper.rb
+++ b/lib/chef/mixin/openssl_helper.rb
@@ -14,15 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+autoload :OpenSSL, "openssl"
class Chef
module Mixin
# various helpers for use with openssl. Currently used by the openssl_* resources
module OpenSSLHelper
- def self.included(_base)
- require "openssl" unless defined?(::OpenSSL)
- end
-
# determine the key filename from the cert filename
# @param [String] cert_filename the path to the certfile
# @return [String] the path to the keyfile
@@ -158,7 +155,7 @@ class Chef
# @return [OpenSSL::PKey::DH]
def gen_ec_priv_key(curve)
raise TypeError, "curve must be a string" unless curve.is_a?(String)
- raise ArgumentError, "Specified curve is not available on this system" unless curve == "prime256v1" || curve == "secp384r1" || curve == "secp521r1"
+ raise ArgumentError, "Specified curve is not available on this system" unless %w{prime256v1 secp384r1 secp521r1}.include?(curve)
::OpenSSL::PKey::EC.new(curve).generate_key
end
diff --git a/lib/chef/mixin/powershell_exec.rb b/lib/chef/mixin/powershell_exec.rb
index e3410e007f..bbf8ae1a69 100644
--- a/lib/chef/mixin/powershell_exec.rb
+++ b/lib/chef/mixin/powershell_exec.rb
@@ -16,14 +16,19 @@
# limitations under the License.
require_relative "../powershell"
+require_relative "../pwsh"
-# The powershell_exec mixin provides in-process access to PowerShell engine via
-# a COM interop (installed by the Chef Client installer).
+# The powershell_exec mixin provides in-process access to the PowerShell engine.
#
-# powershell_exec returns a Chef::PowerShell object that provides 4 methods:
+# powershell_exec is initialized with a string that should be set to the script
+# to run and also takes an optional interpreter argument which must be either
+# :powershell (Windows PowerShell which is the default) or :pwsh (PowerShell
+# Core). It will return a Chef::PowerShell object that provides 5 methods:
#
# .result - returns a hash representing the results returned by executing the
# PowerShell script block
+# .verbose - this is an array of string containing any messages written to the
+# PowerShell verbose stream during execution
# .errors - this is an array of string containing any messages written to the
# PowerShell error stream during execution
# .error? - returns true if there were error messages written to the PowerShell
@@ -42,6 +47,9 @@ require_relative "../powershell"
# > powershell_exec("$a = $true; $a").result
# => true
#
+# > powershell_exec("$PSVersionTable", :pwsh).result["PSEdition"]
+# => "Core"
+#
# > powershell_exec("not-found").errors
# => ["ObjectNotFound: (not-found:String) [], CommandNotFoundException: The
# term 'not-found' is not recognized as the name of a cmdlet, function, script
@@ -90,22 +98,28 @@ require_relative "../powershell"
class Chef
module Mixin
module PowershellExec
- # Run a command under PowerShell via a managed (.NET) COM interop API.
- # This implementation requires the managed dll to be registered on the
- # target machine.
+ # Run a command under PowerShell via a managed (.NET) API.
#
# Requires: .NET Framework 4.0 or higher on the target machine.
#
# @param script [String] script to run
+ # @param interpreter [Symbol] the interpreter type, `:powershell` or `:pwsh`
# @return [Chef::PowerShell] output
- def powershell_exec(script)
- Chef::PowerShell.new(script)
+ def powershell_exec(script, interpreter = :powershell)
+ case interpreter
+ when :powershell
+ Chef::PowerShell.new(script)
+ when :pwsh
+ Chef::Pwsh.new(script)
+ else
+ raise ArgumentError, "Expected interpreter of :powershell or :pwsh"
+ end
end
# The same as the #powershell_exec method except this will raise
# Chef::PowerShell::CommandFailed if the command fails
- def powershell_exec!(script)
- cmd = Chef::PowerShell.new(script)
+ def powershell_exec!(script, interpreter = :powershell)
+ cmd = powershell_exec(script, interpreter)
cmd.error!
cmd
end
diff --git a/lib/chef/mixin/powershell_out.rb b/lib/chef/mixin/powershell_out.rb
index 1ecc9bac98..6d0989f8e0 100644
--- a/lib/chef/mixin/powershell_out.rb
+++ b/lib/chef/mixin/powershell_out.rb
@@ -28,19 +28,24 @@ class Chef
# can be set to :i386 or :x86_64 to force the windows architecture.
#
# @param script [String] script to run
+ # @param interpreter [Symbol] the interpreter type, `:powershell` or `:pwsh`
# @param options [Hash] options hash
# @return [Mixlib::Shellout] mixlib-shellout object
def powershell_out(*command_args)
script = command_args.first
options = command_args.last.is_a?(Hash) ? command_args.last : nil
+ interpreter = command_args[1].is_a?(Symbol) ? command_args[1] : :powershell
- run_command_with_os_architecture(script, options)
+ raise ArgumentError, "Expected interpreter of :powershell or :pwsh" unless %i{powershell pwsh}.include?(interpreter)
+
+ run_command_with_os_architecture(script, interpreter, options)
end
# Run a command under powershell with the same API as shell_out!
# (raises exceptions on errors)
#
# @param script [String] script to run
+ # @param interpreter [Symbol] the interpreter type, `:powershell` or `:pwsh`
# @param options [Hash] options hash
# @return [Mixlib::Shellout] mixlib-shellout object
def powershell_out!(*command_args)
@@ -56,16 +61,17 @@ class Chef
# because chef-client runs as a 32-bit app on 64-bit windows).
#
# @param script [String] script to run
+ # @param interpreter [Symbol] the interpreter type, `:powershell` or `:pwsh`
# @param options [Hash] options hash
# @return [Mixlib::Shellout] mixlib-shellout object
- def run_command_with_os_architecture(script, options)
+ def run_command_with_os_architecture(script, interpreter, options)
options ||= {}
options = options.dup
arch = options.delete(:architecture)
with_os_architecture(nil, architecture: arch) do
shell_out(
- build_powershell_command(script),
+ build_powershell_command(script, interpreter),
**options
)
end
@@ -74,8 +80,9 @@ class Chef
# Helper to build a powershell command around the script to run.
#
# @param script [String] script to run
+ # @param interpreter [Symbol] the interpreter type, `:powershell` or `:pwsh`
# @return [String] powershell command to execute
- def build_powershell_command(script)
+ def build_powershell_command(script, interpreter)
flags = [
# Hides the copyright banner at startup.
"-NoLogo",
@@ -91,7 +98,7 @@ class Chef
"-InputFormat None",
]
- "powershell.exe #{flags.join(" ")} -Command \"#{script.gsub('"', '\"')}\""
+ "#{interpreter}.exe #{flags.join(" ")} -Command \"#{script.gsub('"', '\"')}\""
end
end
end
diff --git a/lib/chef/mixin/properties.rb b/lib/chef/mixin/properties.rb
index eca0787dc4..c42e3889b0 100644
--- a/lib/chef/mixin/properties.rb
+++ b/lib/chef/mixin/properties.rb
@@ -135,6 +135,8 @@ class Chef
property.emit_dsl
end
+ alias :attribute :property
+
#
# Create a reusable property type that can be used in multiple properties
# in different resources.
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb
index d72bfe9e3a..dcb728f964 100644
--- a/lib/chef/mixin/template.rb
+++ b/lib/chef/mixin/template.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require "tempfile" unless defined?(Tempfile)
-require "erubis" unless defined?(Erubis)
+autoload :Tempfile, "tempfile"
+autoload :Erubis, "erubis"
class Chef
module Mixin
@@ -204,7 +204,7 @@ class Chef
all_ivars.delete(:@_extension_modules)
all_ivars.inject({}) do |ivar_map, ivar_symbol_name|
value = instance_variable_get(ivar_symbol_name)
- name_without_at = ivar_symbol_name.to_s[1..-1].to_sym
+ name_without_at = ivar_symbol_name.to_s[1..].to_sym
ivar_map[name_without_at] = value
ivar_map
end
diff --git a/lib/chef/mixin/unformatter.rb b/lib/chef/mixin/unformatter.rb
index fbe1bdccb4..c233549b17 100644
--- a/lib/chef/mixin/unformatter.rb
+++ b/lib/chef/mixin/unformatter.rb
@@ -21,7 +21,7 @@ class Chef
module Unformatter
def write(message)
- data = message.match(/(\[.+?\] )?([\w]+):(.*)$/)
+ data = message.match(/(\[.+?\] )?(\w+):(.*)$/)
send(data[2].downcase.chomp.to_sym, data[3].strip)
rescue NoMethodError
send(:info, message)
diff --git a/lib/chef/mixin/uris.rb b/lib/chef/mixin/uris.rb
index ab33c6791e..13c4ee29b3 100644
--- a/lib/chef/mixin/uris.rb
+++ b/lib/chef/mixin/uris.rb
@@ -16,8 +16,10 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "addressable/uri" unless defined?(Addressable::URI)
+autoload :URI, "uri"
+module Addressable
+ autoload :URI, "addressable/uri"
+end
class Chef
module Mixin
diff --git a/lib/chef/mixin/versioned_api.rb b/lib/chef/mixin/versioned_api.rb
index eab2ea8228..b627e0210c 100644
--- a/lib/chef/mixin/versioned_api.rb
+++ b/lib/chef/mixin/versioned_api.rb
@@ -50,8 +50,7 @@ class Chef
# in which case we'll just start with the highest version and see what happens
ServerAPIVersions.instance.min_server_version.nil? || (version >= ServerAPIVersions.instance.min_server_version && version <= ServerAPIVersions.instance.send(type))
end
- .sort { |a, b| a.send(:minimum_api_version) <=> b.send(:minimum_api_version) }
- .last
+ .max_by { |a| a.send(:minimum_api_version) }
end
def def_versioned_delegator(method)
diff --git a/lib/chef/monkey_patches/net_http.rb b/lib/chef/monkey_patches/net_http.rb
deleted file mode 100644
index 42007d23a7..0000000000
--- a/lib/chef/monkey_patches/net_http.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Module gets mixed in to Net::HTTP exception classes so we can attach our
-# RESTRequest object to them and get the request parameters back out later.
-module ChefNetHTTPExceptionExtensions
- attr_accessor :chef_rest_request
-end
-
-require "net/http" unless defined?(Net::HTTP)
-module Net
- class HTTPError
- include ChefNetHTTPExceptionExtensions
- end
- class HTTPRetriableError
- include ChefNetHTTPExceptionExtensions
- end
- class HTTPClientException
- include ChefNetHTTPExceptionExtensions
- end
- class HTTPFatalError
- include ChefNetHTTPExceptionExtensions
- end
-end
diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb
index b8fd507336..a420563165 100644
--- a/lib/chef/node/attribute_collections.rb
+++ b/lib/chef/node/attribute_collections.rb
@@ -73,9 +73,7 @@ class Chef
def convert_value(value)
case value
- when VividMash
- value
- when AttrArray
+ when VividMash, AttrArray
value
when Hash
VividMash.new(value, __root__, __node__, __precedence__)
@@ -159,9 +157,7 @@ class Chef
# attribute tree will have the correct cache invalidation behavior.
def convert_value(value)
case value
- when VividMash
- value
- when AttrArray
+ when VividMash, AttrArray
value
when Hash
VividMash.new(value, __root__, __node__, __precedence__)
diff --git a/lib/chef/node/mixin/immutablize_hash.rb b/lib/chef/node/mixin/immutablize_hash.rb
index e3b02e378e..f6d885ca2b 100644
--- a/lib/chef/node/mixin/immutablize_hash.rb
+++ b/lib/chef/node/mixin/immutablize_hash.rb
@@ -58,6 +58,7 @@ class Chef
each_with_object
empty?
entries
+ except
fetch
fetch_values
filter
@@ -137,6 +138,7 @@ class Chef
default_proc=
delete
delete_if
+ except!
filter!
keep_if
map!
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index 30a0ed6c4e..0b85dbe9df 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -36,7 +36,7 @@
# XXX: confusingly, in the *_priority_map the :klass may be an array of Strings of class names
#
-require_relative "dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class NodeMap
@@ -86,7 +86,7 @@ class Chef
else
klass.superclass.to_s
end
- Chef::Log.warn( COLLISION_WARNING % { type: type_of_thing, key: key, type_caps: type_of_thing.capitalize, client_name: Chef::Dist::PRODUCT } )
+ Chef::Log.warn( COLLISION_WARNING % { type: type_of_thing, key: key, type_caps: type_of_thing.capitalize, client_name: ChefUtils::Dist::Infra::PRODUCT } )
end
# The map is sorted in order of preference already; we just need to find
@@ -225,13 +225,13 @@ class Chef
if attribute == :platform_family
# If any blocklist value matches, we don't match
- return false if blocklist.any? { |v| v[1..-1] == value || platform_family_query_helper?(node, v[1..-1]) }
+ return false if blocklist.any? { |v| v[1..] == value || platform_family_query_helper?(node, v[1..]) }
# If the allowlist is empty, or anything matches, we match.
allowlist.empty? || allowlist.any? { |v| v == :all || v == value || platform_family_query_helper?(node, v) }
else
# If any blocklist value matches, we don't match
- return false if blocklist.any? { |v| v[1..-1] == value }
+ return false if blocklist.any? { |v| v[1..] == value }
# If the allowlist is empty, or anything matches, we match.
allowlist.empty? || allowlist.any? { |v| v == :all || v == value }
diff --git a/lib/chef/platform/query_helpers.rb b/lib/chef/platform/query_helpers.rb
index 6188ce0cb5..bd0703d72a 100644
--- a/lib/chef/platform/query_helpers.rb
+++ b/lib/chef/platform/query_helpers.rb
@@ -58,10 +58,10 @@ class Chef
end
def dsc_refresh_mode_disabled?(node)
- require_relative "../util/powershell/cmdlet"
- cmdlet = Chef::Util::Powershell::Cmdlet.new(node, "Get-DscLocalConfigurationManager", :object)
- metadata = cmdlet.run!.return_value
- metadata["RefreshMode"] == "Disabled"
+ require_relative "../powershell"
+ exec = Chef::PowerShell.new("Get-DscLocalConfigurationManager")
+ exec.error!
+ exec.result["RefreshMode"] == "Disabled"
end
def supported_powershell_version?(node, version_string)
diff --git a/lib/chef/policy_builder/dynamic.rb b/lib/chef/policy_builder/dynamic.rb
index 7971379d2c..3d9d4c0b7d 100644
--- a/lib/chef/policy_builder/dynamic.rb
+++ b/lib/chef/policy_builder/dynamic.rb
@@ -23,6 +23,8 @@ require_relative "../run_context"
require_relative "../config"
require_relative "../node"
require_relative "../exceptions"
+require_relative "expand_node_object"
+require_relative "policyfile"
class Chef
module PolicyBuilder
diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb
index 0055f9d4b6..bac015be42 100644
--- a/lib/chef/policy_builder/policyfile.rb
+++ b/lib/chef/policy_builder/policyfile.rb
@@ -24,7 +24,7 @@ require_relative "../run_context"
require_relative "../config"
require_relative "../node"
require_relative "../server_api"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
module PolicyBuilder
@@ -91,7 +91,7 @@ class Chef
@node = nil
if Chef::Config[:solo_legacy_mode]
- raise UnsupportedFeature, "Policyfile does not support chef-solo. Use #{Chef::Dist::CLIENT} local mode instead."
+ raise UnsupportedFeature, "Policyfile does not support chef-solo. Use #{ChefUtils::Dist::Infra::CLIENT} local mode instead."
end
if override_runlist
diff --git a/lib/chef/powershell.rb b/lib/chef/powershell.rb
index 10765384ff..b49d3c58e4 100644
--- a/lib/chef/powershell.rb
+++ b/lib/chef/powershell.rb
@@ -24,6 +24,7 @@ class Chef
attr_reader :result
attr_reader :errors
+ attr_reader :verbose
# Run a command under PowerShell via FFI
# This implementation requires the managed dll and native wrapper to be in the library search
@@ -34,8 +35,12 @@ class Chef
# @param script [String] script to run
# @return [Object] output
def initialize(script)
- raise "Chef::PowerShell can only be used on the Windows platform." unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
-
+ # This Powershell DLL source lives here: https://github.com/chef/chef-powershell-shim
+ # Every merge into that repo triggers a Habitat build and promotion. Running
+ # the rake :update_chef_exec_dll task in this (chef/chef) repo will pull down
+ # the built packages and copy the binaries to distro/ruby_bin_folder. Bundle install
+ # ensures that the correct architecture binaries are installed into the path.
+ @dll ||= "Chef.PowerShell.Wrapper.dll"
exec(script)
end
@@ -59,15 +64,16 @@ class Chef
raise Chef::PowerShell::CommandFailed, "Unexpected exit in PowerShell command: #{@errors}" if error?
end
- private
+ protected
def exec(script)
- FFI.ffi_lib "Chef.PowerShell.Wrapper.dll"
+ FFI.ffi_lib @dll
FFI.attach_function :execute_powershell, :ExecuteScript, [:string], :pointer
execution = FFI.execute_powershell(script).read_utf16string
hashed_outcome = Chef::JSONCompat.parse(execution)
@result = Chef::JSONCompat.parse(hashed_outcome["result"])
@errors = hashed_outcome["errors"]
+ @verbose = hashed_outcome["verbose"]
end
end
end
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 819b82f384..bbf06854d6 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -559,7 +559,7 @@ class Chef
if modified_options.key?(:name_property) ||
modified_options.key?(:name_attribute) ||
modified_options.key?(:default)
- options = options.reject { |k, v| k == :name_attribute || k == :name_property || k == :default }
+ options = options.reject { |k, v| %i{name_attribute name_property default}.include?(k) }
end
self.class.new(**options.merge(modified_options))
end
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 60b89a8094..4d5631397b 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -88,7 +88,7 @@ class Chef
def self.use(partial)
dirname = ::File.dirname(partial)
basename = ::File.basename(partial, ".rb")
- basename = basename[1..-1] if basename.start_with?("_")
+ basename = basename[1..] if basename.start_with?("_")
class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
end
diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb
index 622f8f5e63..7d37f34b1a 100644
--- a/lib/chef/provider/cron.rb
+++ b/lib/chef/provider/cron.rb
@@ -112,13 +112,7 @@ class Chef
when ENV_PATTERN
crontab << line unless cron_found
next
- when SPECIAL_PATTERN
- if cron_found
- cron_found = false
- crontab << newcron
- next
- end
- when CRON_PATTERN
+ when SPECIAL_PATTERN, CRON_PATTERN
if cron_found
cron_found = false
crontab << newcron
@@ -163,12 +157,7 @@ class Chef
next
when ENV_PATTERN
next if cron_found
- when SPECIAL_PATTERN
- if cron_found
- cron_found = false
- next
- end
- when CRON_PATTERN
+ when SPECIAL_PATTERN, CRON_PATTERN
if cron_found
cron_found = false
next
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb
index 5f1f8ca8ac..a919d1deff 100644
--- a/lib/chef/provider/dsc_resource.rb
+++ b/lib/chef/provider/dsc_resource.rb
@@ -15,7 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require_relative "../util/powershell/cmdlet"
+require "timeout" unless defined?(Timeout)
+require_relative "../mixin/powershell_exec"
require_relative "../util/dsc/local_configuration_manager"
require_relative "../mixin/powershell_type_coercions"
require_relative "../util/dsc/resource_store"
@@ -130,27 +131,27 @@ class Chef
def test_resource
result = invoke_resource(:test)
add_dsc_verbose_log(result)
- return_dsc_resource_result(result, "InDesiredState")
+ result.result["InDesiredState"]
end
def set_resource
result = invoke_resource(:set)
add_dsc_verbose_log(result)
- create_reboot_resource if return_dsc_resource_result(result, "RebootRequired")
- result.return_value
+ create_reboot_resource if result.result["RebootRequired"]
+ result
end
def add_dsc_verbose_log(result)
# We really want this information from the verbose stream,
# however in some versions of WMF, Invoke-DscResource is not correctly
# writing to that stream and instead just dumping to stdout
- verbose_output = result.stream(:verbose)
- verbose_output = result.stdout if verbose_output.empty?
+ verbose_output = result.verbose.join("\n")
+ verbose_output = result.result if verbose_output.empty?
if @converge_description.nil? || @converge_description.empty?
@converge_description = verbose_output
else
- @converge_description << "\n"
+ @converge_description << "\n\n"
@converge_description << verbose_output
end
end
@@ -159,26 +160,13 @@ class Chef
@module_version.nil? ? module_name : "@{ModuleName='#{module_name}';ModuleVersion='#{@module_version}'}"
end
- def invoke_resource(method, output_format = :object)
+ def invoke_resource(method)
properties = translate_type(new_resource.properties)
switches = "-Method #{method} -Name #{new_resource.resource}"\
" -Property #{properties} -Module #{module_info_object} -Verbose"
- cmdlet = Chef::Util::Powershell::Cmdlet.new(
- node,
- "Invoke-DscResource #{switches}",
- output_format
- )
- cmdlet.run!({}, { timeout: new_resource.timeout })
- end
-
- def return_dsc_resource_result(result, property_name)
- if result.return_value.is_a?(Array)
- # WMF Feb 2015 Preview
- result.return_value[0][property_name]
- else
- # WMF April 2015 Preview
- result.return_value[property_name]
- end
+ Timeout.timeout(new_resource.timeout) {
+ powershell_exec!("Invoke-DscResource #{switches}")
+ }
end
def create_reboot_resource
diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb
index 8793a9274a..d55f060f94 100644
--- a/lib/chef/provider/dsc_script.rb
+++ b/lib/chef/provider/dsc_script.rb
@@ -16,7 +16,6 @@
# limitations under the License.
#
-require_relative "../util/powershell/cmdlet"
require_relative "../util/dsc/configuration_generator"
require_relative "../util/dsc/local_configuration_manager"
require_relative "../util/path_helper"
@@ -32,11 +31,11 @@ class Chef
@dsc_resource = dsc_resource
@resource_converged = false
@operations = {
- set: Proc.new do |config_manager, document, shellout_flags|
- config_manager.set_configuration(document, shellout_flags)
+ set: Proc.new do |config_manager, document|
+ config_manager.set_configuration(document)
end,
- test: Proc.new do |config_manager, document, shellout_flags|
- config_manager.test_configuration(document, shellout_flags)
+ test: Proc.new do |config_manager, document|
+ config_manager.test_configuration(document)
end }
end
@@ -85,20 +84,23 @@ class Chef
config_manager = Chef::Util::DSC::LocalConfigurationManager.new(@run_context.node, config_directory)
- shellout_flags = {
- cwd: @dsc_resource.cwd,
- environment: @dsc_resource.environment,
- timeout: @dsc_resource.timeout,
- }
+ cwd = @dsc_resource.cwd || Dir.pwd
+ original_env = ENV.to_hash
begin
- configuration_document = generate_configuration_document(config_directory, configuration_flags)
- @operations[operation].call(config_manager, configuration_document, shellout_flags)
+ ENV.update(@dsc_resource.environment) if @dsc_resource.environment
+ Dir.chdir(cwd) do
+ Timeout.timeout(@dsc_resource.timeout) do
+ configuration_document = generate_configuration_document(config_directory, configuration_flags)
+ @operations[operation].call(config_manager, configuration_document)
+ end
+ end
rescue Exception => e
logger.error("DSC operation failed: #{e.message}")
raise e
ensure
::FileUtils.rm_rf(config_directory)
+ ENV.replace(original_env)
end
end
@@ -112,20 +114,14 @@ class Chef
end
def generate_configuration_document(config_directory, configuration_flags)
- shellout_flags = {
- cwd: @dsc_resource.cwd,
- environment: @dsc_resource.environment,
- timeout: @dsc_resource.timeout,
- }
-
generator = Chef::Util::DSC::ConfigurationGenerator.new(@run_context.node, config_directory)
if @dsc_resource.command
- generator.configuration_document_from_script_path(@dsc_resource.command, configuration_name, configuration_flags, shellout_flags)
+ generator.configuration_document_from_script_path(@dsc_resource.command, configuration_name, configuration_flags)
else
# If code is also not provided, we mimic what the other script resources do (execute nothing)
logger.warn("Neither code or command were provided for dsc_resource[#{@dsc_resource.name}].") unless @dsc_resource.code
- generator.configuration_document_from_script_code(@dsc_resource.code || "", configuration_flags, @dsc_resource.imports, shellout_flags)
+ generator.configuration_document_from_script_code(@dsc_resource.code || "", configuration_flags, @dsc_resource.imports)
end
end
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 0de620bba1..e2c07ad9f7 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -31,7 +31,7 @@ require_relative "../util/backup"
require_relative "../util/diff"
require_relative "../util/selinux"
require_relative "../file_content_management/deploy"
-require_relative "../dist"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
# The Tao of File Providers:
# - the content provider must always return a tempfile that we can delete/mv
@@ -394,7 +394,7 @@ class Chef
return if tempfile.nil?
# but a tempfile that has no path or doesn't exist should not happen
if tempfile.path.nil? || !::File.exists?(tempfile.path)
- raise "#{Chef::Dist::CLIENT} is confused, trying to deploy a file that has no path or does not exist..."
+ raise "#{ChefUtils::Dist::Infra::CLIENT} is confused, trying to deploy a file that has no path or does not exist..."
end
# the file? on the next line suppresses the case in why-run when we have a not-file here that would have otherwise been removed
diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb
index f1c8380307..c0f6f01c59 100644
--- a/lib/chef/provider/git.rb
+++ b/lib/chef/provider/git.rb
@@ -68,9 +68,9 @@ class Chef
a.assertion { !(new_resource.revision =~ %r{^origin/}) }
a.failure_message Chef::Exceptions::InvalidRemoteGitReference,
"Deploying remote branches is not supported. " +
- "Specify the remote branch as a local branch for " +
- "the git repository you're deploying from " +
- "(ie: '#{new_resource.revision.gsub("origin/", "")}' rather than '#{new_resource.revision}')."
+ "Specify the remote branch as a local branch for " +
+ "the git repository you're deploying from " +
+ "(ie: '#{new_resource.revision.gsub("origin/", "")}' rather than '#{new_resource.revision}')."
end
requirements.assert(:all_actions) do |a|
@@ -80,8 +80,8 @@ class Chef
a.assertion { !target_revision.nil? }
a.failure_message Chef::Exceptions::UnresolvableGitReference,
"Unable to parse SHA reference for '#{new_resource.revision}' in repository '#{new_resource.repository}'. " +
- "Verify your (case-sensitive) repository URL and revision.\n" +
- "`git ls-remote '#{new_resource.repository}' '#{rev_search_pattern}'` output: #{@resolved_reference}"
+ "Verify your (case-sensitive) repository URL and revision.\n" +
+ "`git ls-remote '#{new_resource.repository}' '#{rev_search_pattern}'` output: #{@resolved_reference}"
end
end
diff --git a/lib/chef/provider/group.rb b/lib/chef/provider/group.rb
index 905a22dc33..0cda3182ba 100644
--- a/lib/chef/provider/group.rb
+++ b/lib/chef/provider/group.rb
@@ -78,7 +78,7 @@ class Chef
# <false>:: If a change is not required
def compare_group
@change_desc = [ ]
- if new_resource.gid.to_s != current_resource.gid.to_s
+ unless group_gid_match?
@change_desc << "change gid #{current_resource.gid} to #{new_resource.gid}"
end
@@ -103,13 +103,21 @@ class Chef
unless members_to_be_removed.empty?
@change_desc << "remove existing member(s): #{members_to_be_removed.join(", ")}"
end
- elsif new_resource.members != current_resource.members
- @change_desc << "replace group members with new list of members"
+ elsif !group_members_match?
+ @change_desc << "replace group members with new list of members: #{new_resource.members.join(", ")}"
end
!@change_desc.empty?
end
+ def group_gid_match?
+ new_resource.gid.to_s == current_resource.gid.to_s
+ end
+
+ def group_members_match?
+ [new_resource.members].flatten.sort == [current_resource.members].flatten.sort
+ end
+
def has_current_group_member?(member)
current_resource.members.include?(member)
end
@@ -131,7 +139,7 @@ class Chef
if compare_group
converge_by(["alter group #{new_resource.group_name}"] + change_desc) do
manage_group
- logger.info("#{new_resource} altered")
+ logger.info("#{new_resource} altered: #{change_desc.join(", ")}")
end
end
end
@@ -151,7 +159,7 @@ class Chef
converge_by(["manage group #{new_resource.group_name}"] + change_desc) do
manage_group
- logger.info("#{new_resource} managed")
+ logger.info("#{new_resource} managed: #{change_desc.join(", ")}")
end
end
@@ -160,7 +168,7 @@ class Chef
converge_by(["modify group #{new_resource.group_name}"] + change_desc) do
manage_group
- logger.info("#{new_resource} modified")
+ logger.info("#{new_resource} modified: #{change_desc.join(", ")}")
end
end
diff --git a/lib/chef/provider/group/windows.rb b/lib/chef/provider/group/windows.rb
index 45914b16e3..dacfc348f7 100644
--- a/lib/chef/provider/group/windows.rb
+++ b/lib/chef/provider/group/windows.rb
@@ -33,6 +33,17 @@ class Chef
@net_group = Chef::Util::Windows::NetGroup.new(new_resource.group_name)
end
+ def group_members_match?
+ sorted_members_sids = new_resource.members.map { |x| lookup_account_name(x) }.sort
+ sorted_current_sids = current_resource.members.sort
+ Chef::Log.debug("#{new_resource.name}: current_members: #{sorted_current_sids} vs new_members #{sorted_members_sids}")
+ sorted_members_sids == sorted_current_sids
+ end
+
+ def group_gid_match?
+ true
+ end
+
def load_current_resource
@current_resource = Chef::Resource::Group.new(new_resource.name)
current_resource.group_name(new_resource.group_name)
@@ -74,7 +85,7 @@ class Chef
members_to_be_removed << member if has_current_group_member?(member)
end
@net_group.local_delete_members(members_to_be_removed) unless members_to_be_removed.empty?
- else
+ elsif !group_members_match?
@net_group.local_set_members(new_resource.members)
end
@net_group.local_group_set_info(new_resource.comment) if new_resource.comment
diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb
index fbff49468a..d08564e75d 100644
--- a/lib/chef/provider/ifconfig.rb
+++ b/lib/chef/provider/ifconfig.rb
@@ -20,7 +20,7 @@ require_relative "../log"
require_relative "../provider"
require_relative "../resource/file"
require_relative "../exceptions"
-require "erb" unless defined?(Erb)
+autoload :ERB, "erb"
class Chef
class Provider
@@ -126,18 +126,18 @@ class Chef
elsif line.match(addr_regex)[3] == ""
@int_name = line.match(addr_regex)[1]
@interfaces[@int_name] = {}
- @interfaces[@int_name]["mtu"] = (line =~ /mtu (\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /mtu/ && @interfaces[@int_name]["mtu"].nil?
+ @interfaces[@int_name]["mtu"] = (line =~ /mtu (\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("mtu") && @interfaces[@int_name]["mtu"].nil?
else
@int_name = "#{line.match(addr_regex)[1]}:#{line.match(addr_regex)[3]}"
@interfaces[@int_name] = {}
- @interfaces[@int_name]["mtu"] = (line =~ /mtu (\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /mtu/ && @interfaces[@int_name]["mtu"].nil?
+ @interfaces[@int_name]["mtu"] = (line =~ /mtu (\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("mtu") && @interfaces[@int_name]["mtu"].nil?
end
else
- @interfaces[@int_name]["inet_addr"] = (line =~ /inet (\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /inet/ && @interfaces[@int_name]["inet_addr"].nil?
- @interfaces[@int_name]["bcast"] = (line =~ /broadcast (\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /broadcast/ && @interfaces[@int_name]["bcast"].nil?
- @interfaces[@int_name]["mask"] = (line =~ /netmask (\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /netmask/ && @interfaces[@int_name]["mask"].nil?
- @interfaces[@int_name]["hwaddr"] = (line =~ /ether (\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /ether/ && @interfaces[@int_name]["hwaddr"].nil?
- @interfaces[@int_name]["metric"] = (line =~ /Metric:(\S+)/ ? Regexp.last_match(1) : "nil") if line =~ /Metric:/ && @interfaces[@int_name]["metric"].nil?
+ @interfaces[@int_name]["inet_addr"] = (line =~ /inet (\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("inet") && @interfaces[@int_name]["inet_addr"].nil?
+ @interfaces[@int_name]["bcast"] = (line =~ /broadcast (\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("broadcast") && @interfaces[@int_name]["bcast"].nil?
+ @interfaces[@int_name]["mask"] = (line =~ /netmask (\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("netmask") && @interfaces[@int_name]["mask"].nil?
+ @interfaces[@int_name]["hwaddr"] = (line =~ /ether (\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("ether") && @interfaces[@int_name]["hwaddr"].nil?
+ @interfaces[@int_name]["metric"] = (line =~ /Metric:(\S+)/ ? Regexp.last_match(1) : "nil") if line.include?("Metric:") && @interfaces[@int_name]["metric"].nil?
end
next unless @interfaces.key?(new_resource.device)
@@ -236,7 +236,7 @@ class Chef
return unless can_generate_config?
b = binding
- template = ::ERB.new(@config_template)
+ template = ::ERB.new(@config_template, nil, "-")
config = resource_for_config(@config_path)
config.content(template.result(b))
config.run_action(:create)
diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb
index 17d5fdd243..9b359d7c54 100644
--- a/lib/chef/provider/ifconfig/debian.rb
+++ b/lib/chef/provider/ifconfig/debian.rb
@@ -23,8 +23,7 @@ class Chef
class Provider
class Ifconfig
class Debian < Chef::Provider::Ifconfig
- provides :ifconfig, platform: %w{ubuntu}, platform_version: ">= 11.10"
- provides :ifconfig, platform: %w{debian}, platform_version: ">= 7.0"
+ provides :ifconfig, platform_family: %w{debian}
INTERFACES_FILE = "/etc/network/interfaces".freeze
INTERFACES_DOT_D_DIR = "/etc/network/interfaces.d".freeze
@@ -32,25 +31,43 @@ class Chef
def initialize(new_resource, run_context)
super(new_resource, run_context)
@config_template = %{
-<% if new_resource.device %>
-<% if new_resource.onboot == "yes" %>auto <%= new_resource.device %><% end %>
+<% if new_resource.device -%>
+<% if new_resource.onboot == "yes" -%>
+auto <%= new_resource.device %>
+<% end -%>
<% case new_resource.bootproto
- when "dhcp" %>
+ when "dhcp" -%>
iface <%= new_resource.device %> <%= new_resource.family %> dhcp
-<% when "bootp" %>
+<% when "bootp" -%>
iface <%= new_resource.device %> <%= new_resource.family %> bootp
-<% else %>
+<% else -%>
iface <%= new_resource.device %> <%= new_resource.family %> static
- <% if new_resource.target %>address <%= new_resource.target %><% end %>
- <% if new_resource.mask %>netmask <%= new_resource.mask %><% end %>
- <% if new_resource.network %>network <%= new_resource.network %><% end %>
- <% if new_resource.bcast %>broadcast <%= new_resource.bcast %><% end %>
- <% if new_resource.metric %>metric <%= new_resource.metric %><% end %>
- <% if new_resource.hwaddr %>hwaddress <%= new_resource.hwaddr %><% end %>
- <% if new_resource.mtu %>mtu <%= new_resource.mtu %><% end %>
- <% if new_resource.gateway %>gateway <%= new_resource.gateway %><% end %>
-<% end %>
-<% end %>
+ <% if new_resource.target -%>
+ address <%= new_resource.target %>
+ <% end -%>
+ <% if new_resource.mask -%>
+ netmask <%= new_resource.mask %>
+ <% end -%>
+ <% if new_resource.network -%>
+ network <%= new_resource.network %>
+ <% end -%>
+ <% if new_resource.bcast -%>
+ broadcast <%= new_resource.bcast %>
+ <% end -%>
+ <% if new_resource.metric -%>
+ metric <%= new_resource.metric %>
+ <% end -%>
+ <% if new_resource.hwaddr -%>
+ hwaddress <%= new_resource.hwaddr %>
+ <% end -%>
+ <% if new_resource.mtu -%>
+ mtu <%= new_resource.mtu %>
+ <% end -%>
+ <% if new_resource.gateway -%>
+ gateway <%= new_resource.gateway %>
+ <% end -%>
+<% end -%>
+<% end -%>
}
@config_path = "#{INTERFACES_DOT_D_DIR}/ifcfg-#{new_resource.device}"
end
@@ -63,13 +80,12 @@ iface <%= new_resource.device %> <%= new_resource.family %> static
protected
def enforce_interfaces_dot_d_sanity
- # on ubuntu 18.04 there's no interfaces file and it uses interfaces.d by default
+ # on ubuntu 18.04+ there's no interfaces file and it uses interfaces.d by default
return if ::File.directory?(INTERFACES_DOT_D_DIR) && !::File.exist?(INTERFACES_FILE)
- # create /etc/network/interfaces.d via dir resource (to get reporting, etc)
- dir = Chef::Resource::Directory.new(INTERFACES_DOT_D_DIR, run_context)
- dir.run_action(:create)
- new_resource.updated_by_last_action(true) if dir.updated_by_last_action?
+ # create /etc/network/interfaces.d via dir if it's missing
+ directory INTERFACES_DOT_D_DIR
+
# roll our own file_edit resource, this will not get reported until we have a file_edit resource
interfaces_dot_d_for_regexp = INTERFACES_DOT_D_DIR.gsub(/\./, '\.') # escape dots for the regexp
regexp = %r{^\s*source\s+#{interfaces_dot_d_for_regexp}/\*\s*$}
diff --git a/lib/chef/provider/ifconfig/redhat.rb b/lib/chef/provider/ifconfig/redhat.rb
index 44cfe31ea7..a7f73c43dc 100644
--- a/lib/chef/provider/ifconfig/redhat.rb
+++ b/lib/chef/provider/ifconfig/redhat.rb
@@ -27,27 +27,63 @@ class Chef
def initialize(new_resource, run_context)
super(new_resource, run_context)
@config_template = %{
-<% if new_resource.device %>DEVICE=<%= new_resource.device %><% end %>
-<% if new_resource.onboot == "yes" %>ONBOOT=<%= new_resource.onboot %><% end %>
-<% if new_resource.bootproto %>BOOTPROTO=<%= new_resource.bootproto %><% end %>
-<% if new_resource.target %>IPADDR=<%= new_resource.target %><% end %>
-<% if new_resource.mask %>NETMASK=<%= new_resource.mask %><% end %>
-<% if new_resource.network %>NETWORK=<%= new_resource.network %><% end %>
-<% if new_resource.bcast %>BROADCAST=<%= new_resource.bcast %><% end %>
-<% if new_resource.onparent %>ONPARENT=<%= new_resource.onparent %><% end %>
-<% if new_resource.hwaddr %>HWADDR=<%= new_resource.hwaddr %><% end %>
-<% if new_resource.metric %>METRIC=<%= new_resource.metric %><% end %>
-<% if new_resource.mtu %>MTU=<%= new_resource.mtu %><% end %>
-<% if new_resource.ethtool_opts %>ETHTOOL_OPTS="<%= new_resource.ethtool_opts %>"<% end %>
-<% if new_resource.bonding_opts %>BONDING_OPTS="<%= new_resource.bonding_opts %>"<% end %>
-<% if new_resource.master %>MASTER=<%= new_resource.master %><% end %>
-<% if new_resource.slave %>SLAVE=<%= new_resource.slave %><% end %>
-<% if new_resource.vlan %>VLAN=<%= new_resource.vlan %><% end %>
-<% if new_resource.gateway %>GATEWAY=<%= new_resource.gateway %><% end %>
+<% if new_resource.device -%>
+DEVICE=<%= new_resource.device %>
+<% end -%>
+<% if new_resource.onboot == "yes" -%>
+ONBOOT=<%= new_resource.onboot %>
+<% end -%>
+<% if new_resource.bootproto -%>
+BOOTPROTO=<%= new_resource.bootproto %>
+<% end -%>
+<% if new_resource.target -%>
+IPADDR=<%= new_resource.target %>
+<% end -%>
+<% if new_resource.mask -%>
+NETMASK=<%= new_resource.mask %>
+<% end -%>
+<% if new_resource.network -%>
+NETWORK=<%= new_resource.network %>
+<% end -%>
+<% if new_resource.bcast -%>
+BROADCAST=<%= new_resource.bcast %>
+<% end -%>
+<% if new_resource.onparent -%>
+ONPARENT=<%= new_resource.onparent %>
+<% end -%>
+<% if new_resource.hwaddr -%>
+HWADDR=<%= new_resource.hwaddr %>
+<% end -%>
+<% if new_resource.metric -%>
+METRIC=<%= new_resource.metric %>
+<% end -%>
+<% if new_resource.mtu -%>
+MTU=<%= new_resource.mtu %>
+<% end -%>
+<% if new_resource.ethtool_opts -%>
+ETHTOOL_OPTS="<%= new_resource.ethtool_opts %>"
+<% end -%>
+<% if new_resource.bonding_opts -%>
+BONDING_OPTS="<%= new_resource.bonding_opts %>"
+<% end -%>
+<% if new_resource.master -%>
+MASTER=<%= new_resource.master %>
+<% end -%>
+<% if new_resource.slave -%>
+SLAVE=<%= new_resource.slave %>
+<% end -%>
+<% if new_resource.vlan -%>
+VLAN=<%= new_resource.vlan %>
+<% end -%>
+<% if new_resource.gateway -%>
+GATEWAY=<%= new_resource.gateway %>
+<% end -%>
+<% if new_resource.bridge -%>
+BRIDGE=<%= new_resource.bridge %>
+<% end -%>
}
@config_path = "/etc/sysconfig/network-scripts/ifcfg-#{new_resource.device}"
end
-
end
end
end
diff --git a/lib/chef/provider/launchd.rb b/lib/chef/provider/launchd.rb
index 78ae823596..b8ff9dfa4d 100644
--- a/lib/chef/provider/launchd.rb
+++ b/lib/chef/provider/launchd.rb
@@ -20,7 +20,7 @@ require_relative "../provider"
require_relative "../resource/file"
require_relative "../resource/cookbook_file"
require_relative "../resource/macosx_service"
-require "plist"
+autoload :Plist, "plist"
require "forwardable" unless defined?(Forwardable)
class Chef
@@ -29,17 +29,7 @@ class Chef
extend Forwardable
provides :launchd, os: "darwin"
- def_delegators :new_resource, *%i{
- backup
- cookbook
- group
- label
- mode
- owner
- source
- session_type
- type
- }
+ def_delegators :new_resource, :backup, :cookbook, :group, :label, :mode, :owner, :source, :session_type, :type
def load_current_resource
current_resource = Chef::Resource::Launchd.new(new_resource.name)
@@ -209,7 +199,7 @@ class Chef
# @api private
def path
- @path ||= new_resource.path ? new_resource.path : gen_path_from_type
+ @path ||= new_resource.path || gen_path_from_type
end
end
end
diff --git a/lib/chef/provider/link.rb b/lib/chef/provider/link.rb
index 1615d3ad14..900d0516af 100644
--- a/lib/chef/provider/link.rb
+++ b/lib/chef/provider/link.rb
@@ -33,15 +33,6 @@ class Chef
include Chef::Mixin::EnforceOwnershipAndPermissions
include Chef::Mixin::FileClass
- def negative_complement(big)
- if big > 1073741823 # Fixnum max
- big -= (2**32) # diminished radix wrap to negative
- end
- big
- end
-
- private :negative_complement
-
def load_current_resource
@current_resource = Chef::Resource::Link.new(new_resource.name)
current_resource.target_file(new_resource.target_file)
diff --git a/lib/chef/provider/mount.rb b/lib/chef/provider/mount.rb
index 013b8a67b3..44fb94ca01 100644
--- a/lib/chef/provider/mount.rb
+++ b/lib/chef/provider/mount.rb
@@ -122,8 +122,11 @@ class Chef
# we need to be able to update fstab to conform with their wishes
# without necessarily needing to remount the device.
# See #6851 for more.
+ # We have to compare current resource device with device_fstab value
+ # because entry in /etc/fstab will be as per device_type.
+ # For Ex: 'LABEL=/tmp/ /mnt ext3 defaults 0 2', where 'device_type' is :label.
def device_unchanged?
- @current_resource.device == @new_resource.device
+ @current_resource.device == device_fstab
end
#
@@ -169,6 +172,20 @@ class Chef
sleep 0.1
end
end
+
+ # Returns the new_resource device as per device_type
+ def device_fstab
+ # Removed "/" from the end of str, because it was causing idempotency issue.
+ device = @new_resource.device == "/" ? @new_resource.device : @new_resource.device.chomp("/")
+ case @new_resource.device_type
+ when :device
+ device
+ when :label
+ "LABEL=#{device}"
+ when :uuid
+ "UUID=#{device}"
+ end
+ end
end
end
end
diff --git a/lib/chef/provider/mount/linux.rb b/lib/chef/provider/mount/linux.rb
index 3199024f1b..382e37d41a 100644
--- a/lib/chef/provider/mount/linux.rb
+++ b/lib/chef/provider/mount/linux.rb
@@ -53,6 +53,10 @@ class Chef
when %r{\A#{Regexp.escape(real_mount_point)}\s+([/\w])+\[#{device_mount_regex}\]\s}
mounted = true
logger.trace("Bind device #{device_logstring} mounted as #{real_mount_point}")
+ # Permalink for network device mounted to an existing mount point: https://rubular.com/r/JRTXXGFdQtwCD6
+ when /\A#{Regexp.escape(real_mount_point)}\s+#{device_mount_regex}\[/
+ mounted = true
+ logger.trace("Network device #{device_logstring} mounted as #{real_mount_point}")
end
end
@current_resource.mounted(mounted)
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 6e39f6549b..0bd81d5453 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -70,10 +70,6 @@ class Chef
@current_resource.dump($4.to_i)
@current_resource.pass($5.to_i)
logger.trace("Found mount #{device_fstab} to #{@new_resource.mount_point} in /etc/fstab")
- next
- when %r{^[/\w]+\s+#{Regexp.escape(@new_resource.mount_point)}\s+}
- enabled = false
- logger.trace("Found conflicting mount point #{@new_resource.mount_point} in /etc/fstab")
end
end
@current_resource.enabled(enabled)
@@ -168,40 +164,23 @@ class Chef
if @current_resource.enabled
# The current options don't match what we have, so
- # disable, then enable.
- disable_fs
- end
- ::File.open("/etc/fstab", "a") do |fstab|
- fstab.puts("#{device_fstab} #{@new_resource.mount_point} #{@new_resource.fstype} #{@new_resource.options.nil? ? default_mount_options : @new_resource.options.join(",")} #{@new_resource.dump} #{@new_resource.pass}")
- logger.trace("#{@new_resource} is enabled at #{@new_resource.mount_point}")
+ # update the last matching entry with current option
+ # and order will remain the same.
+ edit_fstab
+ else
+ ::File.open("/etc/fstab", "a") do |fstab|
+ fstab.puts("#{device_fstab} #{@new_resource.mount_point} #{@new_resource.fstype} #{@new_resource.options.nil? ? default_mount_options : @new_resource.options.join(",")} #{@new_resource.dump} #{@new_resource.pass}")
+ logger.trace("#{@new_resource} is enabled at #{@new_resource.mount_point}")
+ end
end
end
def disable_fs
- if @current_resource.enabled
- contents = []
-
- found = false
- ::File.readlines("/etc/fstab").reverse_each do |line|
- if !found && line =~ /^#{device_fstab_regex}\s+#{Regexp.escape(@new_resource.mount_point)}\s/
- found = true
- logger.trace("#{@new_resource} is removed from fstab")
- next
- else
- contents << line
- end
- end
-
- ::File.open("/etc/fstab", "w") do |fstab|
- contents.reverse_each { |line| fstab.puts line }
- end
- else
- logger.trace("#{@new_resource} is not enabled - nothing to do")
- end
+ edit_fstab(remove: true)
end
def network_device?
- @new_resource.device =~ /:/ || @new_resource.device =~ %r{//}
+ @new_resource.device.include?(":") || @new_resource.device.include?("//")
end
def device_should_exist?
@@ -212,17 +191,6 @@ class Chef
private
- def device_fstab
- case @new_resource.device_type
- when :device
- @new_resource.device
- when :label
- "LABEL=#{@new_resource.device}"
- when :uuid
- "UUID=#{@new_resource.device}"
- end
- end
-
def device_real
if @real_device.nil?
if @new_resource.device_type == :device
@@ -234,7 +202,8 @@ class Chef
@real_device = device_line.chomp unless device_line.nil?
end
end
- @real_device
+ # Removed "/" from the end of str, because it was causing idempotency issue.
+ @real_device == "/" ? @real_device : @real_device.chomp("/")
end
def device_logstring
@@ -278,6 +247,35 @@ class Chef
@current_resource.pass == @new_resource.pass
end
+ # It will update or delete the entry from fstab.
+ def edit_fstab(remove: false)
+ if @current_resource.enabled
+ contents = []
+
+ found = false
+ ::File.readlines("/etc/fstab").reverse_each do |line|
+ if !found && line =~ /^#{device_fstab_regex}\s+#{Regexp.escape(@new_resource.mount_point)}\s/
+ found = true
+ if remove
+ logger.trace("#{@new_resource} is removed from fstab")
+ else
+ contents << ("#{device_fstab} #{@new_resource.mount_point} #{@new_resource.fstype} #{@new_resource.options.nil? ? default_mount_options : @new_resource.options.join(",")} #{@new_resource.dump} #{@new_resource.pass}")
+ logger.trace("#{@new_resource} is updated with new content in fstab")
+ end
+ next
+ else
+ contents << line
+ end
+ end
+
+ ::File.open("/etc/fstab", "w") do |fstab|
+ contents.reverse_each { |line| fstab.puts line }
+ end
+ else
+ logger.trace("#{@new_resource} is not enabled - nothing to do")
+ end
+ end
+
end
end
end
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index 8ace5e033b..6cbc8c7b24 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -443,6 +443,9 @@ class Chef
elsif current_version && !allow_downgrade && version_compare(current_version, new_version) == 1
logger.warn("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{new_version}. Skipping...)")
target_version_array.push(nil)
+ elsif version_equals?(current_version, candidate_version)
+ logger.trace("#{new_resource} #{package_name} #{candidate_version} is already installed")
+ target_version_array.push(nil)
else
logger.trace("#{new_resource} #{package_name} #{current_version} needs updating to #{new_version}")
target_version_array.push(new_version)
diff --git a/lib/chef/provider/package/apt.rb b/lib/chef/provider/package/apt.rb
index 4fbacdc065..dbacaedb07 100644
--- a/lib/chef/provider/package/apt.rb
+++ b/lib/chef/provider/package/apt.rb
@@ -161,7 +161,7 @@ class Chef
def config_file_options
# If the user has specified config file options previously, respect those.
- return if Array(options).any? { |opt| opt =~ /--force-conf/ }
+ return if Array(options).any? { |opt| opt.include?("--force-conf") }
# It doesn't make sense to install packages in a scenario that can
# result in a prompt. Have users decide up-front whether they want to
diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb
index 498a98f2d0..06db3c2979 100644
--- a/lib/chef/provider/package/chocolatey.rb
+++ b/lib/chef/provider/package/chocolatey.rb
@@ -79,7 +79,7 @@ class Chef
name_versions_to_install = desired_name_versions.select { |n, v| lowercase_names(names).include?(n) }
name_nil_versions = name_versions_to_install.select { |n, v| v.nil? }
- name_has_versions = name_versions_to_install.reject { |n, v| v.nil? }
+ name_has_versions = name_versions_to_install.compact
# choco does not support installing multiple packages with version pins
name_has_versions.each do |name, version|
@@ -101,7 +101,7 @@ class Chef
name_versions_to_install = desired_name_versions.select { |n, v| lowercase_names(names).include?(n) }
name_nil_versions = name_versions_to_install.select { |n, v| v.nil? }
- name_has_versions = name_versions_to_install.reject { |n, v| v.nil? }
+ name_has_versions = name_versions_to_install.compact
# choco does not support installing multiple packages with version pins
name_has_versions.each do |name, version|
@@ -151,7 +151,7 @@ class Chef
@choco_exe ||= begin
# if this check is in #define_resource_requirements, it won't get
# run before choco.exe gets called from #load_current_resource.
- exe_path = ::File.join(choco_install_path.to_s, "bin", "choco.exe")
+ exe_path = ::File.join(choco_install_path, "bin", "choco.exe")
raise Chef::Exceptions::MissingLibrary, CHOCO_MISSING_MSG unless ::File.exist?(exe_path)
exe_path
@@ -160,9 +160,9 @@ class Chef
# lets us mock out an incorrect value for testing.
def choco_install_path
- @choco_install_path ||= powershell_out!(
- PATHFINDING_POWERSHELL_COMMAND
- ).stdout.chomp
+ result = powershell_exec!(PATHFINDING_POWERSHELL_COMMAND).result
+ result = "" if result.empty?
+ result
end
# Helper to dispatch a choco command through shell_out using the timeout
diff --git a/lib/chef/provider/package/dpkg.rb b/lib/chef/provider/package/dpkg.rb
index 08829e9b26..b2d1678caa 100644
--- a/lib/chef/provider/package/dpkg.rb
+++ b/lib/chef/provider/package/dpkg.rb
@@ -164,10 +164,7 @@ class Chef
#
# @return [Hash] Mapping of package names to sources
def name_sources
- @name_sources =
- begin
- Hash[*package_name_array.zip(resolved_source_array).flatten]
- end
+ @name_sources ||= Hash[*package_name_array.zip(resolved_source_array).flatten]
end
# Helper to construct Hash of names-to-package-information.
@@ -186,17 +183,11 @@ class Chef
end
def name_candidate_version
- @name_candidate_version ||=
- begin
- Hash[name_pkginfo.map { |k, v| [k, v ? v.split("\t")[1].strip : nil] }]
- end
+ @name_candidate_version ||= name_pkginfo.transform_values { |v| v ? v.split("\t")[1]&.strip : nil }
end
def name_package_name
- @name_package_name ||=
- begin
- Hash[name_pkginfo.map { |k, v| [k, v ? v.split("\t")[0] : nil] }]
- end
+ @name_package_name ||= name_pkginfo.transform_values { |v| v ? v.split("\t")[0] : nil }
end
# Return candidate version array from pkg-deb -W against the source file(s).
diff --git a/lib/chef/provider/package/freebsd/base.rb b/lib/chef/provider/package/freebsd/base.rb
index 2805200516..46a01e754c 100644
--- a/lib/chef/provider/package/freebsd/base.rb
+++ b/lib/chef/provider/package/freebsd/base.rb
@@ -58,9 +58,10 @@ class Chef
def makefile_variable_value(variable, dir = nil)
options = dir ? { cwd: dir } : {}
- options.merge!(env: nil, returns: [0, 1])
+ options[:env] = nil
+ options[:returns] = [0, 1]
make_v = shell_out!("make", "-V", variable, **options)
- make_v.exitstatus == 0 ? make_v.stdout.strip.split($OUTPUT_RECORD_SEPARATOR).first : nil # $\ is the line separator, i.e. newline.
+ make_v.exitstatus == 0 ? make_v.stdout.strip.split($OUTPUT_RECORD_SEPARATOR).first : nil
end
end
diff --git a/lib/chef/provider/package/freebsd/pkgng.rb b/lib/chef/provider/package/freebsd/pkgng.rb
index 48fc7a0dd5..87acb3a830 100644
--- a/lib/chef/provider/package/freebsd/pkgng.rb
+++ b/lib/chef/provider/package/freebsd/pkgng.rb
@@ -62,7 +62,7 @@ class Chef
end
pkg_query = shell_out!("pkg", "rquery", options, "%v", new_resource.package_name, env: nil)
- pkg_query.exitstatus == 0 ? pkg_query.stdout.strip.split(/\n/).last : nil
+ pkg_query.exitstatus == 0 ? pkg_query.stdout.strip.split('\n').last : nil
end
def repo_regex
diff --git a/lib/chef/provider/package/homebrew.rb b/lib/chef/provider/package/homebrew.rb
index d61a0314c0..2b60c0a1ec 100644
--- a/lib/chef/provider/package/homebrew.rb
+++ b/lib/chef/provider/package/homebrew.rb
@@ -127,7 +127,7 @@ class Chef
# check each item in the hash to see if we were passed an alias
brew_info.each_value do |p|
- return p if p["aliases"].include?(package_name)
+ return p if p["full_name"] == package_name || p["aliases"].include?(package_name)
end
{}
diff --git a/lib/chef/provider/package/ips.rb b/lib/chef/provider/package/ips.rb
index 129447dcab..ee997d147f 100644
--- a/lib/chef/provider/package/ips.rb
+++ b/lib/chef/provider/package/ips.rb
@@ -26,7 +26,7 @@ class Chef
class Package
class Ips < Chef::Provider::Package
- provides :package, platform: %w{openindiana opensolaris omnios solaris2}
+ provides :package, platform: %w{openindiana omnios solaris2}
provides :ips_package
attr_accessor :virtual
diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb
index 54e31bbd1e..1f59360c61 100644
--- a/lib/chef/provider/package/powershell.rb
+++ b/lib/chef/provider/package/powershell.rb
@@ -53,9 +53,6 @@ class Chef
# Installs the package specified with the version passed else latest version will be installed
def install_package(names, versions)
- # To enable tls 1.2, which is disabled by default in some OS
- powershell_out("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
-
names.each_with_index do |name, index|
cmd = powershell_out(build_powershell_package_command("Install-Package '#{name}'", versions[index]), timeout: new_resource.timeout)
next if cmd.nil?
@@ -118,6 +115,8 @@ class Chef
command = [command] unless command.is_a?(Array)
cmdlet_name = command.first
command.unshift("(")
+ # PowerShell Gallery requires tls 1.2
+ command.unshift("if ([Net.ServicePointManager]::SecurityProtocol -lt [Net.SecurityProtocolType]::Tls12) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 };")
# -WarningAction SilentlyContinue is used to suppress the warnings from stdout
%w{-Force -ForceBootstrap -WarningAction SilentlyContinue}.each do |arg|
command.push(arg)
diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb
index 502dccf914..a0b569b8e3 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -17,39 +17,42 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
+autoload :URI, "uri"
require_relative "../package"
require_relative "../../resource/package"
require_relative "../../mixin/get_source_from_package"
require_relative "../../mixin/which"
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
# Class methods on Gem are defined in rubygems
-require "rubygems" unless defined?(Gem)
+autoload :Gem, "rubygems"
# Ruby 1.9's gem_prelude can interact poorly with loading the full rubygems
# explicitly like this. Make sure rubygems/specification is always last in this
# list
-require "rubygems/version"
-require "rubygems/dependency"
-require "rubygems/spec_fetcher"
-require "rubygems/platform"
-require "rubygems/package" unless defined?(Gem::Package)
-require "rubygems/dependency_installer"
-require "rubygems/uninstaller"
-require "rubygems/specification"
+Gem.autoload :Version, "rubygems/version"
+Gem.autoload :Dependency, "rubygems/dependency"
+Gem.autoload :SpecFetcher, "rubygems/spec_fetcher"
+Gem.autoload :Platform, "rubygems/platform"
+Gem.autoload :Package, "rubygems/package"
+Gem.autoload :DependencyInstaller, "rubygems/dependency_installer"
+Gem.autoload :Uninstaller, "rubygems/uninstaller"
+Gem.autoload :Specification, "rubygems/specification"
class Chef
class Provider
class Package
class Rubygems < Chef::Provider::Package
class GemEnvironment
- # HACK: trigger gem config load early. Otherwise it can get lazy
- # loaded during operations where we've set Gem.sources to an
- # alternate value and overwrite it with the defaults.
- Gem.configuration
-
DEFAULT_UNINSTALLER_OPTS = { ignore: true, executables: true }.freeze
+ def initialize(*args)
+ super
+ # HACK: trigger gem config load early. Otherwise it can get lazy
+ # loaded during operations where we've set Gem.sources to an
+ # alternate value and overwrite it with the defaults.
+ Gem.configuration
+ end
+
# The paths where rubygems should search for installed gems.
# Implemented by subclasses.
def gem_paths
@@ -398,8 +401,8 @@ class Chef
if new_resource.options && new_resource.options.is_a?(Hash)
msg = [
"Gem options must be passed to gem_package as a string instead of a hash when",
- "using this installation of #{Chef::Dist::PRODUCT} because it runs with its own packaged Ruby. A hash",
- "may only be used when installing a gem to the same Ruby installation that #{Chef::Dist::PRODUCT} is",
+ "using this installation of #{ChefUtils::Dist::Infra::PRODUCT} because it runs with its own packaged Ruby. A hash",
+ "may only be used when installing a gem to the same Ruby installation that #{ChefUtils::Dist::Infra::PRODUCT} is",
"running under. See https://docs.chef.io/resources/gem_package/ for more information.",
"Error raised at #{new_resource} from #{new_resource.source_line}",
].join("\n")
@@ -421,7 +424,7 @@ class Chef
logger.trace("#{new_resource} detected omnibus installation in #{RbConfig::CONFIG["bindir"]}")
# Omnibus installs to a static path because of linking on unix, find it.
true
- elsif RbConfig::CONFIG["bindir"].sub(/^[\w]:/, "") == "/opscode/chef/embedded/bin"
+ elsif RbConfig::CONFIG["bindir"].sub(/^\w:/, "") == "/opscode/chef/embedded/bin"
logger.trace("#{new_resource} detected omnibus installation in #{RbConfig::CONFIG["bindir"]}")
# windows, with the drive letter removed
true
diff --git a/lib/chef/provider/package/snap.rb b/lib/chef/provider/package/snap.rb
index de723c5eb5..81af09e04d 100644
--- a/lib/chef/provider/package/snap.rb
+++ b/lib/chef/provider/package/snap.rb
@@ -218,13 +218,10 @@ class Chef
waiting = true
while waiting
result = get_change_id(id)
- puts "STATUS: #{result["result"]["status"]}"
case result["result"]["status"]
when "Do", "Doing", "Undoing", "Undo"
# Continue
- when "Abort"
- raise result
- when "Hold", "Error"
+ when "Abort", "Hold", "Error"
raise result
when "Done"
waiting = false
diff --git a/lib/chef/provider/package/solaris.rb b/lib/chef/provider/package/solaris.rb
index cf180ec401..7094428236 100644
--- a/lib/chef/provider/package/solaris.rb
+++ b/lib/chef/provider/package/solaris.rb
@@ -26,8 +26,6 @@ class Chef
include Chef::Mixin::GetSourceFromPackage
- provides :package, platform: "nexentacore"
- provides :package, platform: "solaris2", platform_version: "< 5.11"
provides :solaris_package
# def initialize(*args)
diff --git a/lib/chef/provider/package/windows.rb b/lib/chef/provider/package/windows.rb
index e654c80c83..c722d8222c 100644
--- a/lib/chef/provider/package/windows.rb
+++ b/lib/chef/provider/package/windows.rb
@@ -21,7 +21,7 @@ require_relative "../../resource/windows_package"
require_relative "../package"
require_relative "../../util/path_helper"
require_relative "../../mixin/checksum"
-require "cgi" unless defined?(CGI)
+autoload :CGI, "cgi"
class Chef
class Provider
@@ -33,7 +33,7 @@ class Chef
provides :package, os: "windows"
provides :windows_package
- require "chef/provider/package/windows/registry_uninstall_entry.rb"
+ autoload :RegistryUninstallEntry, ::File.expand_path("windows/registry_uninstall_entry.rb", __dir__)
def define_resource_requirements
if new_resource.checksum
diff --git a/lib/chef/provider/package/windows/registry_uninstall_entry.rb b/lib/chef/provider/package/windows/registry_uninstall_entry.rb
index f1814d5dcf..6e7b825256 100644
--- a/lib/chef/provider/package/windows/registry_uninstall_entry.rb
+++ b/lib/chef/provider/package/windows/registry_uninstall_entry.rb
@@ -17,7 +17,9 @@
# limitations under the License.
#
-require "win32/registry" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+module Win32
+ autoload :Registry, File.expand_path("../../../monkey_patches/win32/registry", __dir__) if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+end
class Chef
class Provider
diff --git a/lib/chef/provider/package/yum/rpm_utils.rb b/lib/chef/provider/package/yum/rpm_utils.rb
index b2a24abb1c..7514d57bce 100644
--- a/lib/chef/provider/package/yum/rpm_utils.rb
+++ b/lib/chef/provider/package/yum/rpm_utils.rb
@@ -46,7 +46,7 @@ class Chef
lead = 0
tail = evr.size
- if /^([\d]+):/.match(evr) # rubocop:disable Performance/RedundantMatch
+ if /^(\d+):/.match(evr) # rubocop:disable Performance/RedundantMatch
epoch = $1.to_i
lead = $1.length + 1
elsif evr[0].ord == ":".ord
diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb
index 1096dcd044..a1a433cbdf 100644
--- a/lib/chef/provider/package/zypper.rb
+++ b/lib/chef/provider/package/zypper.rb
@@ -26,87 +26,18 @@ class Chef
class Package
class Zypper < Chef::Provider::Package
use_multipackage_api
+ allow_nils
provides :package, platform_family: "suse"
provides :zypper_package
- def get_versions(package_name)
- candidate_version = current_version = nil
- is_installed = false
- logger.trace("#{new_resource} checking zypper")
- status = shell_out!("zypper", "--non-interactive", "info", package_name)
- status.stdout.each_line do |line|
- case line
- when /^Version *: (.+) *$/
- candidate_version = $1.strip
- logger.trace("#{new_resource} version #{candidate_version}")
- when /^Installed *: Yes.*$/ # http://rubular.com/r/9StcAMjOn6
- is_installed = true
- logger.trace("#{new_resource} is installed")
- when /^Status *: out-of-date \(version (.+) installed\) *$/
- current_version = $1.strip
- logger.trace("#{new_resource} out of date version #{current_version}")
- end
- end
- current_version ||= candidate_version if is_installed
- { current_version: current_version, candidate_version: candidate_version }
- end
-
- def versions
- @versions ||=
- begin
- raw_versions = package_name_array.map do |package_name|
- get_versions(package_name)
- end
- Hash[*package_name_array.zip(raw_versions).flatten]
- end
- end
-
- def get_candidate_versions
- package_name_array.map do |package_name|
- versions[package_name][:candidate_version]
- end
- end
-
- def get_current_versions
- package_name_array.map do |package_name|
- versions[package_name][:current_version]
- end
- end
-
- def packages_all_locked?(names, versions)
- names.all? { |n| locked_packages.include? n }
- end
-
- def packages_all_unlocked?(names, versions)
- names.all? { |n| !locked_packages.include? n }
- end
-
- def locked_packages
- @locked_packages ||=
- begin
- locked = shell_out!("zypper", "locks")
- locked.stdout.each_line.map do |line|
- line.split("|").shift(2).last.strip
- end
- end
- end
-
def load_current_resource
@current_resource = Chef::Resource::ZypperPackage.new(new_resource.name)
current_resource.package_name(new_resource.package_name)
-
- @candidate_version = get_candidate_versions
current_resource.version(get_current_versions)
-
current_resource
end
- def zypper_version
- @zypper_version ||=
- `zypper -V 2>&1`.scan(/\d+/).join(".").to_f
- end
-
def install_package(name, version)
zypper_package("install", global_options, *options, "--auto-agree-with-licenses", allow_downgrade, name, version)
end
@@ -134,10 +65,77 @@ class Chef
private
+ def get_current_versions
+ package_name_array.each_with_index.map { |pkg, i| installed_version(i) }
+ end
+
+ def candidate_version
+ @candidate_version ||= package_name_array.each_with_index.map { |pkg, i| available_version(i) }
+ end
+
+ def resolve_current_version(package_name)
+ latest_version = current_version = nil
+ is_installed = false
+ logger.trace("#{new_resource} checking zypper")
+ status = shell_out!("zypper", "--non-interactive", "info", package_name)
+ status.stdout.each_line do |line|
+ case line
+ when /^Version *: (.+) *$/
+ latest_version = $1.strip
+ logger.trace("#{new_resource} version #{latest_version}")
+ when /^Installed *: Yes.*$/ # http://rubular.com/r/9StcAMjOn6
+ is_installed = true
+ logger.trace("#{new_resource} is installed")
+ when /^Status *: out-of-date \(version (.+) installed\) *$/
+ current_version = $1.strip
+ logger.trace("#{new_resource} out of date version #{current_version}")
+ end
+ end
+ current_version ||= latest_version if is_installed
+ current_version
+ end
+
+ def resolve_available_version(package_name, new_version)
+ search_string = new_version.nil? ? package_name : "#{package_name}=#{new_version}"
+ so = shell_out!("zypper", "--non-interactive", "search", "-s", "--provides", "--match-exact", "--type=package", search_string)
+ so.stdout.each_line do |line|
+ if md = line.match(/^(\S*)\s+\|\s+(\S+)\s+\|\s+(\S+)\s+\|\s+(\S+)\s+\|\s+(\S+)\s+\|\s+(.*)$/)
+ (status, name, type, version, arch, repo) = [ md[1], md[2], md[3], md[4], md[5], md[6] ]
+ next if version == "Version" # header
+
+ # sometimes even though we request a specific version in the search string above and have match exact, we wind up
+ # with other versions in the output, particularly getting the installed version when downgrading.
+ if new_version
+ next unless version == new_version || version.start_with?("#{new_version}-")
+ end
+
+ return version
+ end
+ end
+ nil
+ end
+
+ def available_version(index)
+ @available_version ||= []
+ @available_version[index] ||= resolve_available_version(package_name_array[index], safe_version_array[index])
+ @available_version[index]
+ end
+
+ def installed_version(index)
+ @installed_version ||= []
+ @installed_version[index] ||= resolve_current_version(package_name_array[index])
+ @installed_version[index]
+ end
+
def zip(names, versions)
names.zip(versions).map do |n, v|
(v.nil? || v.empty?) ? n : "#{n}=#{v}"
- end
+ end.compact
+ end
+
+ def zypper_version
+ @zypper_version ||=
+ `zypper -V 2>&1`.scan(/\d+/).join(".").to_f
end
def zypper_package(command, global_options, *options, names, versions)
@@ -158,8 +156,37 @@ class Chef
end
def global_options
- new_resource.global_options if new_resource.global_options
+ new_resource.global_options
+ end
+
+ def packages_all_locked?(names, versions)
+ names.all? { |n| locked_packages.include? n }
end
+
+ def packages_all_unlocked?(names, versions)
+ names.all? { |n| !locked_packages.include? n }
+ end
+
+ def locked_packages
+ @locked_packages ||=
+ begin
+ locked = shell_out!("zypper", "locks")
+ locked.stdout.each_line.map do |line|
+ line.split("|").shift(2).last.strip
+ end
+ end
+ end
+
+ def safe_version_array
+ if new_resource.version.is_a?(Array)
+ new_resource.version
+ elsif new_resource.version.nil?
+ package_name_array.map { nil }
+ else
+ [ new_resource.version ]
+ end
+ end
+
end
end
end
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb
index 49d800b6d2..8360dd873b 100644
--- a/lib/chef/provider/powershell_script.rb
+++ b/lib/chef/provider/powershell_script.rb
@@ -54,7 +54,18 @@ class Chef
def interpreter_path
# Powershell.exe is always in "v1.0" folder (for backwards compatibility)
- Chef::Util::PathHelper.join(basepath, "WindowsPowerShell", "v1.0", interpreter)
+ # pwsh is the other interpreter and we will assume that it is on the path.
+ # It will exist in different folders depending on the installed version.
+ # There can also be multiple versions installed. Depending on how it was installed,
+ # there might be a registry entry pointing to the installation path. The key will
+ # differ depending on version and architecture. It seems best to let the PATH
+ # determine the file path to use since that will provide the same pwsh.exe one
+ # would invoke from any shell.
+ if interpreter == "powershell"
+ Chef::Util::PathHelper.join(basepath, "WindowsPowerShell", "v1.0", "#{interpreter}.exe")
+ else
+ interpreter
+ end
end
def code
diff --git a/lib/chef/provider/registry_key.rb b/lib/chef/provider/registry_key.rb
index d1849066f8..316a2a1081 100644
--- a/lib/chef/provider/registry_key.rb
+++ b/lib/chef/provider/registry_key.rb
@@ -35,6 +35,8 @@ class Chef
include Chef::Mixin::Checksum
+ WORD_TYPES = %i{dword dword_big_endian qword}.freeze
+
def running_on_windows!
unless ChefUtils.windows?
raise Chef::Exceptions::Win32NotWindows, "Attempt to manipulate the windows registry on a non-windows node"
@@ -122,9 +124,8 @@ class Chef
new_resource.unscrubbed_values.each do |value|
if @name_hash.key?(value[:name].downcase)
current_value = @name_hash[value[:name].downcase]
- if %i{dword dword_big_endian qword}.include? value[:type]
- value[:data] = value[:data].to_i
- end
+ value[:data] = value[:data].to_i if WORD_TYPES.include?(value[:type])
+
unless current_value[:type] == value[:type] && current_value[:data] == value[:data]
converge_by_value = if new_resource.sensitive
value.merge(data: "*sensitive value suppressed*")
diff --git a/lib/chef/provider/remote_file/content.rb b/lib/chef/provider/remote_file/content.rb
index c76029c091..665da47e8d 100644
--- a/lib/chef/provider/remote_file/content.rb
+++ b/lib/chef/provider/remote_file/content.rb
@@ -21,6 +21,9 @@ require "uri" unless defined?(URI)
require "tempfile" unless defined?(Tempfile)
require_relative "../../file_content_management/content_base"
require_relative "../../mixin/uris"
+module Net
+ autoload :FTPError, "net/ftp"
+end
class Chef
class Provider
diff --git a/lib/chef/provider/remote_file/ftp.rb b/lib/chef/provider/remote_file/ftp.rb
index e2b32ddaf6..44a6d1c6e8 100644
--- a/lib/chef/provider/remote_file/ftp.rb
+++ b/lib/chef/provider/remote_file/ftp.rb
@@ -16,10 +16,12 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "cgi" unless defined?(CGI)
-require "tempfile" unless defined?(Tempfile)
-require "net/ftp"
+autoload :URI, "uri"
+autoload :CGI, "cgi"
+autoload :Tempfile, "tempfile"
+module Net
+ autoload :FTP, "net/ftp"
+end
require_relative "../remote_file"
require_relative "../../file_content_management/tempfile"
diff --git a/lib/chef/provider/remote_file/sftp.rb b/lib/chef/provider/remote_file/sftp.rb
index 43654bd67c..be2a34fc54 100644
--- a/lib/chef/provider/remote_file/sftp.rb
+++ b/lib/chef/provider/remote_file/sftp.rb
@@ -16,10 +16,12 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "cgi" unless defined?(CGI)
-require "tempfile" unless defined?(Tempfile)
-require "net/sftp"
+autoload :URI, "uri"
+autoload :CGI, "cgi"
+autoload :Tempfile, "tempfile"
+module Net
+ autoload :SFTP, "net/sftp"
+end
require_relative "../remote_file"
require_relative "../../file_content_management/tempfile"
diff --git a/lib/chef/provider/route.rb b/lib/chef/provider/route.rb
index afb1fd5a88..614d56aa22 100644
--- a/lib/chef/provider/route.rb
+++ b/lib/chef/provider/route.rb
@@ -19,7 +19,7 @@
require_relative "../log"
require_relative "../provider"
-require "ipaddr" unless defined?(IPAddr)
+autoload :IPAddr, "ipaddr"
class Chef
class Provider
@@ -169,11 +169,7 @@ class Chef
next unless resource.is_a? Chef::Resource::Route
# default to eth0
- dev = if resource.device
- resource.device
- else
- "eth0"
- end
+ dev = resource.device || "eth0"
conf[dev] = "" if conf[dev].nil?
case @action
@@ -192,8 +188,8 @@ class Chef
logger.trace("#{new_resource} writing default route #{new_resource.gateway} to #{network_file_name}")
if ::File.exist?(network_file_name)
network_file = ::Chef::Util::FileEdit.new(network_file_name)
- network_file.search_file_replace_line /^GATEWAY=/, "GATEWAY=#{new_resource.gateway}"
- network_file.insert_line_if_no_match /^GATEWAY=/, "GATEWAY=#{new_resource.gateway}"
+ network_file.search_file_replace_line(/^GATEWAY=/, "GATEWAY=#{new_resource.gateway}")
+ network_file.insert_line_if_no_match(/^GATEWAY=/, "GATEWAY=#{new_resource.gateway}")
network_file.write_file
else
network_file = ::File.new(network_file_name, "w")
diff --git a/lib/chef/provider/service/debian.rb b/lib/chef/provider/service/debian.rb
index da599fa2f6..17e0b19b9c 100644
--- a/lib/chef/provider/service/debian.rb
+++ b/lib/chef/provider/service/debian.rb
@@ -28,6 +28,7 @@ class Chef
UPDATE_RC_D_ENABLED_MATCHES = %r{/rc[\dS].d/S|not installed}i.freeze
UPDATE_RC_D_PRIORITIES = %r{/rc([\dS]).d/([SK])(\d\d)}i.freeze
+ RUNLEVELS = %w{ 1 2 3 4 5 S }.freeze
def self.supports?(resource, action)
service_script_exist?(:initd, resource.service_name)
@@ -121,7 +122,7 @@ class Chef
priority.each do |runlevel, arguments|
logger.trace("#{new_resource} runlevel #{runlevel}, action #{arguments[0]}, priority #{arguments[1]}")
# if we are in a update-rc.d default startup runlevel && we start in this runlevel
- if %w{ 1 2 3 4 5 S }.include?(runlevel) && arguments[0] == :start
+ if RUNLEVELS.include?(runlevel) && arguments[0] == :start
enabled = true
end
end
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb
index 7e695aaf2b..2152789a6e 100644
--- a/lib/chef/provider/service/macosx.rb
+++ b/lib/chef/provider/service/macosx.rb
@@ -18,7 +18,7 @@
#
require "etc" unless defined?(Etc)
-require "rexml/document" unless defined?(REXML::Document)
+autoload :REXML, "rexml/document"
require_relative "../../resource/service"
require_relative "../../resource/macosx_service"
require_relative "simple"
@@ -47,7 +47,7 @@ class Chef
@current_resource = Chef::Resource::MacosxService.new(@new_resource.name)
@current_resource.service_name(@new_resource.service_name)
@plist_size = 0
- @plist = @new_resource.plist ? @new_resource.plist : find_service_plist
+ @plist = @new_resource.plist || find_service_plist
@service_label = find_service_label
# LaunchAgents should be loaded as the console user.
@console_user = @plist ? @plist.include?("LaunchAgents") : false
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index 3ef7110002..14b55bef85 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -84,7 +84,7 @@ class Chef
chkconfig = shell_out!("/sbin/chkconfig --list #{current_resource.service_name}", returns: [0, 1])
unless run_levels.nil? || run_levels.empty?
all_levels_match = true
- chkconfig.stdout.split(/\s+/)[1..-1].each do |level|
+ chkconfig.stdout.split(/\s+/)[1..].each do |level|
index = level.split(":").first
status = level.split(":").last
if CHKCONFIG_ON.match?(level)
diff --git a/lib/chef/provider/template_finder.rb b/lib/chef/provider/template_finder.rb
index fdc5eaeda9..fa120a1624 100644
--- a/lib/chef/provider/template_finder.rb
+++ b/lib/chef/provider/template_finder.rb
@@ -43,19 +43,11 @@ class Chef
protected
def template_source_name(name, options)
- if options[:source]
- options[:source]
- else
- name
- end
+ options[:source] || name
end
def find_cookbook_name(options)
- if options[:cookbook]
- options[:cookbook]
- else
- @cookbook_name
- end
+ options[:cookbook] || @cookbook_name
end
end
end
diff --git a/lib/chef/provider/user.rb b/lib/chef/provider/user.rb
index d4a2651378..803d87d820 100644
--- a/lib/chef/provider/user.rb
+++ b/lib/chef/provider/user.rb
@@ -24,6 +24,7 @@ class Chef
class User < Chef::Provider
attr_accessor :user_exists, :locked
+ attr_accessor :change_desc
def initialize(new_resource, run_context)
super
@@ -107,13 +108,20 @@ class Chef
# <true>:: If a change is required
# <false>:: If the users are identical
def compare_user
- return true if !new_resource.home.nil? && Pathname.new(new_resource.home).cleanpath != Pathname.new(current_resource.home).cleanpath
+ @change_desc = []
+ if !new_resource.home.nil? && Pathname.new(new_resource.home).cleanpath != Pathname.new(current_resource.home).cleanpath
+ @change_desc << "change homedir from #{current_resource.home} to #{new_resource.home}"
+ end
%i{comment shell password uid gid}.each do |user_attrib|
- return true if !new_resource.send(user_attrib).nil? && new_resource.send(user_attrib).to_s != current_resource.send(user_attrib).to_s
+ new_val = new_resource.send(user_attrib)
+ cur_val = current_resource.send(user_attrib)
+ if !new_val.nil? && new_val.to_s != cur_val.to_s
+ @change_desc << "change #{user_attrib} from #{cur_val} to #{new_val}"
+ end
end
- false
+ !@change_desc.empty?
end
action :create do
@@ -123,9 +131,9 @@ class Chef
logger.info("#{new_resource} created")
end
elsif compare_user
- converge_by("alter user #{new_resource.username}") do
+ converge_by(["alter user #{new_resource.username}"] + change_desc) do
manage_user
- logger.info("#{new_resource} altered")
+ logger.info("#{new_resource} altered, #{change_desc.join(", ")}")
end
end
end
@@ -142,18 +150,18 @@ class Chef
action :manage do
return unless @user_exists && compare_user
- converge_by("manage user #{new_resource.username}") do
+ converge_by(["manage user #{new_resource.username}"] + change_desc) do
manage_user
- logger.info("#{new_resource} managed")
+ logger.info("#{new_resource} managed: #{change_desc.join(", ")}")
end
end
action :modify do
return unless compare_user
- converge_by("modify user #{new_resource.username}") do
+ converge_by(["modify user #{new_resource.username}"] + change_desc) do
manage_user
- logger.info("#{new_resource} modified")
+ logger.info("#{new_resource} modified: #{change_desc.join(", ")}")
end
end
diff --git a/lib/chef/provider/user/aix.rb b/lib/chef/provider/user/aix.rb
index 893f304a96..740f9943d3 100644
--- a/lib/chef/provider/user/aix.rb
+++ b/lib/chef/provider/user/aix.rb
@@ -68,7 +68,7 @@ class Chef
def check_lock
lock_info = shell_out!("lsuser", "-a", "account_locked", new_resource.username)
- if whyrun_mode? && passwd_s.stdout.empty? && lock_info.stderr.match(/does not exist/)
+ if whyrun_mode? && passwd_s.stdout.empty? && lock_info.stderr.include?("does not exist")
# if we're in whyrun mode and the user is not yet created we assume it would be
return false
end
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb
index 7b86fa5269..7b266b8d62 100644
--- a/lib/chef/provider/user/dscl.rb
+++ b/lib/chef/provider/user/dscl.rb
@@ -19,8 +19,8 @@
require_relative "../../mixin/shell_out"
require_relative "../user"
require_relative "../../resource/user/dscl_user"
-require "openssl" unless defined?(OpenSSL)
-require "plist"
+autoload :OpenSSL, "openssl"
+autoload :Plist, "plist"
require_relative "../../util/path_helper"
class Chef
@@ -584,16 +584,16 @@ in 'password', with the associated 'salt' and 'iterations'.")
#
def run_dscl(*args)
- result = shell_out("dscl", ".", "-#{args[0]}", args[1..-1])
+ result = shell_out("dscl", ".", "-#{args[0]}", args[1..])
return "" if ( args.first =~ /^delete/ ) && ( result.exitstatus != 0 )
raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") unless result.exitstatus == 0
- raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") if /No such key: /.match?(result.stdout)
+ raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") if result.stdout.include?("No such key: ")
result.stdout
end
def run_plutil(*args)
- result = shell_out("plutil", "-#{args[0]}", args[1..-1])
+ result = shell_out("plutil", "-#{args[0]}", args[1..])
raise(Chef::Exceptions::PlistUtilCommandFailed, "plutil error: #{result.inspect}") unless result.exitstatus == 0
if result.stdout.encoding == Encoding::ASCII_8BIT
diff --git a/lib/chef/provider/user/mac.rb b/lib/chef/provider/user/mac.rb
index 9ae1628d5c..5604244f7f 100644
--- a/lib/chef/provider/user/mac.rb
+++ b/lib/chef/provider/user/mac.rb
@@ -22,7 +22,7 @@ require_relative "../../mixin/shell_out"
require_relative "../../mixin/which"
require_relative "../user"
require_relative "../../resource/user/mac_user"
-require "plist"
+autoload :Plist, "plist"
class Chef
class Provider
@@ -221,7 +221,17 @@ class Chef
end
def compare_user
- %i{comment shell uid gid salt password admin secure_token hidden}.any? { |m| diverged?(m) }
+ @change_desc = []
+ %i{comment shell uid gid salt password admin secure_token hidden}.each do |attr|
+ if diverged?(attr)
+ desc = "Update #{attr}"
+ unless %i{password gid secure_token hidden}.include?(attr)
+ desc << " from #{current_resource.send(attr)} to #{new_resource.send(attr)}"
+ end
+ @change_desc << desc
+ end
+ end
+ !@change_desc.empty?
end
def manage_user
@@ -290,9 +300,7 @@ class Chef
end
if diverged?(:hidden)
- converge_by("alter hidden") do
- set_hidden
- end
+ converge_by("alter hidden") { set_hidden }
end
reload_user_plist
@@ -608,7 +616,7 @@ class Chef
end
def run_dscl(*args)
- result = shell_out("dscl", "-plist", ".", "-#{args[0]}", args[1..-1])
+ result = shell_out("dscl", "-plist", ".", "-#{args[0]}", args[1..])
return "" if ( args.first =~ /^delete/ ) && ( result.exitstatus != 0 )
raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") unless result.exitstatus == 0
raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") if /No such key: /.match?(result.stdout)
@@ -617,7 +625,7 @@ class Chef
end
def run_plutil(*args)
- result = shell_out("plutil", "-#{args[0]}", args[1..-1])
+ result = shell_out("plutil", "-#{args[0]}", args[1..])
raise(Chef::Exceptions::PlistUtilCommandFailed, "plutil error: #{result.inspect}") unless result.exitstatus == 0
result.stdout
diff --git a/lib/chef/provider/user/solaris.rb b/lib/chef/provider/user/solaris.rb
index 2da1d754e4..abf6cd94c8 100644
--- a/lib/chef/provider/user/solaris.rb
+++ b/lib/chef/provider/user/solaris.rb
@@ -25,7 +25,7 @@ class Chef
class User
class Solaris < Chef::Provider::User
provides :solaris_user
- provides :user, os: %w{openindiana opensolaris illumos omnios solaris2 smartos}
+ provides :user, os: %w{openindiana illumos omnios solaris2 smartos}
PASSWORD_FILE = "/etc/shadow".freeze
diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb
index 6d50e2c8ee..32b2c35264 100644
--- a/lib/chef/provider/user/windows.rb
+++ b/lib/chef/provider/user/windows.rb
@@ -61,13 +61,20 @@ class Chef
# <true>:: If a change is required
# <false>:: If the users are identical
def compare_user
+ @change_desc = []
unless @net_user.validate_credentials(new_resource.password)
- logger.trace("#{new_resource} password has changed")
- return true
+ @change_desc << "update password"
end
+
%i{uid comment home shell full_name}.any? do |user_attrib|
- !new_resource.send(user_attrib).nil? && new_resource.send(user_attrib) != current_resource.send(user_attrib)
+ new_val = new_resource.send(user_attrib)
+ cur_val = current_resource.send(user_attrib)
+ if !new_val.nil? && new_val != cur_val
+ @change_desc << "change #{user_attrib} from #{cur_val} to #{new_val}"
+ end
end
+
+ !@change_desc.empty?
end
def create_user
diff --git a/lib/chef/provider/windows_env.rb b/lib/chef/provider/windows_env.rb
deleted file mode 100644
index f60dc79c5b..0000000000
--- a/lib/chef/provider/windows_env.rb
+++ /dev/null
@@ -1,210 +0,0 @@
-#
-# Author:: Doug MacEachern (<dougm@vmware.com>)
-# Copyright:: Copyright 2010-2016, VMware, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require_relative "../provider"
-require_relative "../resource/windows_env"
-require_relative "../mixin/windows_env_helper"
-
-class Chef
- class Provider
- class WindowsEnv < Chef::Provider
- include Chef::Mixin::WindowsEnvHelper
- attr_accessor :key_exists
-
- provides :env
- provides :windows_env
-
- def whyrun_supported?
- false
- end
-
- def initialize(new_resource, run_context)
- super
- @key_exists = true
- end
-
- def load_current_resource
- @current_resource = Chef::Resource::WindowsEnv.new(new_resource.name)
- current_resource.key_name(new_resource.key_name)
-
- if env_key_exists(new_resource.key_name)
- current_resource.value(env_value(new_resource.key_name))
- else
- @key_exists = false
- logger.trace("#{new_resource} key does not exist")
- end
-
- current_resource
- end
-
- def env_key_exists(key_name)
- env_value(key_name) ? true : false
- end
-
- # Check to see if value needs any changes
- #
- # ==== Returns
- # <true>:: If a change is required
- # <false>:: If a change is not required
- def requires_modify_or_create?
- if new_resource.delim
- # e.g. check for existing value within PATH
- new_values.inject(0) do |index, val|
- next_index = current_values.find_index val
- return true if next_index.nil? || next_index < index
-
- next_index
- end
- false
- else
- new_resource.value != current_resource.value
- end
- end
-
- alias_method :compare_value, :requires_modify_or_create?
-
- action :create do
- if @key_exists
- if requires_modify_or_create?
- modify_env
- logger.info("#{new_resource} altered")
- new_resource.updated_by_last_action(true)
- end
- else
- create_env
- logger.info("#{new_resource} created")
- new_resource.updated_by_last_action(true)
- end
- end
-
- # e.g. delete a PATH element
- #
- # ==== Returns
- # <true>:: If we handled the element case and caller should not delete the key
- # <false>:: Caller should delete the key, either no :delim was specific or value was empty
- # after we removed the element.
- def delete_element
- return false unless new_resource.delim # no delim: delete the key
-
- needs_delete = new_values.any? { |v| current_values.include?(v) }
- if !needs_delete
- logger.trace("#{new_resource} element '#{new_resource.value}' does not exist")
- true # do not delete the key
- else
- new_value =
- current_values.select do |item|
- not new_values.include?(item)
- end.join(new_resource.delim)
-
- if new_value.empty?
- false # nothing left here, delete the key
- else
- old_value = new_resource.value(new_value)
- create_env
- logger.trace("#{new_resource} deleted #{old_value} element")
- new_resource.updated_by_last_action(true)
- true # we removed the element and updated; do not delete the key
- end
- end
- end
-
- action :delete do
- if ( ENV[new_resource.key_name] || @key_exists ) && !delete_element
- delete_env
- logger.info("#{new_resource} deleted")
- new_resource.updated_by_last_action(true)
- end
- end
-
- action :modify do
- if @key_exists
- if requires_modify_or_create?
- modify_env
- logger.info("#{new_resource} modified")
- new_resource.updated_by_last_action(true)
- end
- else
- raise Chef::Exceptions::WindowsEnv, "Cannot modify #{new_resource} - key does not exist!"
- end
- end
-
- def create_env
- obj = env_obj(@new_resource.key_name)
- unless obj
- obj = WIN32OLE.connect("winmgmts://").get("Win32_Environment").spawninstance_
- obj.name = @new_resource.key_name
- obj.username = new_resource.user
- end
- obj.variablevalue = @new_resource.value
- obj.put_
- value = @new_resource.value
- value = expand_path(value) if @new_resource.key_name.casecmp("PATH") == 0
- ENV[@new_resource.key_name] = value
- broadcast_env_change
- end
-
- def delete_env
- obj = env_obj(@new_resource.key_name)
- if obj
- obj.delete_
- broadcast_env_change
- end
- if ENV[@new_resource.key_name]
- ENV.delete(@new_resource.key_name)
- end
- end
-
- def modify_env
- if new_resource.delim
- new_resource.value((new_values + current_values).uniq.join(new_resource.delim))
- end
- create_env
- end
-
- # Returns the current values to split by delimiter
- def current_values
- @current_values ||= current_resource.value.split(new_resource.delim)
- end
-
- # Returns the new values to split by delimiter
- def new_values
- @new_values ||= new_resource.value.split(new_resource.delim)
- end
-
- def env_value(key_name)
- obj = env_obj(key_name)
- obj.variablevalue if obj
- end
-
- def env_obj(key_name)
- return @env_obj if @env_obj
-
- wmi = WmiLite::Wmi.new
- # Note that by design this query is case insensitive with regard to key_name
- environment_variables = wmi.query("select * from Win32_Environment where name = '#{key_name}'")
- if environment_variables && environment_variables.length > 0
- environment_variables.each do |env|
- @env_obj = env.wmi_ole_object
- return @env_obj if @env_obj.username.split('\\').last.casecmp(new_resource.user) == 0
- end
- end
- @env_obj = nil
- end
- end
- end
-end
diff --git a/lib/chef/provider/windows_path.rb b/lib/chef/provider/windows_path.rb
deleted file mode 100644
index 36d202ad49..0000000000
--- a/lib/chef/provider/windows_path.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Author:: Nimisha Sharad (<nimisha.sharad@msystechnologies.com>)
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require_relative "../mixin/windows_env_helper" if ChefUtils.windows?
-require_relative "../mixin/wide_string"
-require_relative "../exceptions"
-
-class Chef
- class Provider
- class WindowsPath < Chef::Provider
- include Chef::Mixin::WindowsEnvHelper if ChefUtils.windows?
-
- provides :windows_path
-
- def load_current_resource
- @current_resource = Chef::Resource::WindowsPath.new(new_resource.name)
- @current_resource.path(new_resource.path)
- @current_resource
- end
-
- action :add do
- # The windows Env provider does not correctly expand variables in
- # the PATH environment variable. Ruby expects these to be expanded.
- #
- path = expand_path(new_resource.path)
- declare_resource(:env, "path") do
- action :modify
- delim ::File::PATH_SEPARATOR
- value path.tr("/", '\\')
- end
- end
-
- action :remove do
- # The windows Env provider does not correctly expand variables in
- # the PATH environment variable. Ruby expects these to be expanded.
- #
- path = expand_path(new_resource.path)
- declare_resource(:env, "path") do
- action :delete
- delim ::File::PATH_SEPARATOR
- value path.tr("/", '\\')
- end
- end
- end
- end
-end
diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb
deleted file mode 100644
index c402818321..0000000000
--- a/lib/chef/provider/windows_task.rb
+++ /dev/null
@@ -1,632 +0,0 @@
-#
-# Author:: Nimisha Sharad (<nimisha.sharad@msystechnologies.com>)
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "rexml/document" unless defined?(REXML::Document)
-require "iso8601" if ChefUtils.windows?
-require_relative "../provider"
-require_relative "../util/path_helper"
-require "win32/taskscheduler" if ChefUtils.windows?
-
-class Chef
- class Provider
- class WindowsTask < Chef::Provider
- if ChefUtils.windows?
- include Win32
-
- provides :windows_task
-
- MONTHS = {
- JAN: TaskScheduler::JANUARY,
- FEB: TaskScheduler::FEBRUARY,
- MAR: TaskScheduler::MARCH,
- APR: TaskScheduler::APRIL,
- MAY: TaskScheduler::MAY,
- JUN: TaskScheduler::JUNE,
- JUL: TaskScheduler::JULY,
- AUG: TaskScheduler::AUGUST,
- SEP: TaskScheduler::SEPTEMBER,
- OCT: TaskScheduler::OCTOBER,
- NOV: TaskScheduler::NOVEMBER,
- DEC: TaskScheduler::DECEMBER,
- }.freeze
-
- DAYS_OF_WEEK = { MON: TaskScheduler::MONDAY,
- TUE: TaskScheduler::TUESDAY,
- WED: TaskScheduler::WEDNESDAY,
- THU: TaskScheduler::THURSDAY,
- FRI: TaskScheduler::FRIDAY,
- SAT: TaskScheduler::SATURDAY,
- SUN: TaskScheduler::SUNDAY }.freeze
-
- WEEKS_OF_MONTH = {
- FIRST: TaskScheduler::FIRST_WEEK,
- SECOND: TaskScheduler::SECOND_WEEK,
- THIRD: TaskScheduler::THIRD_WEEK,
- FOURTH: TaskScheduler::FOURTH_WEEK,
- }.freeze
-
- DAYS_OF_MONTH = {
- 1 => TaskScheduler::TASK_FIRST,
- 2 => TaskScheduler::TASK_SECOND,
- 3 => TaskScheduler::TASK_THIRD,
- 4 => TaskScheduler::TASK_FOURTH,
- 5 => TaskScheduler::TASK_FIFTH,
- 6 => TaskScheduler::TASK_SIXTH,
- 7 => TaskScheduler::TASK_SEVENTH,
- 8 => TaskScheduler::TASK_EIGHTH,
- # cspell:disable-next-line
- 9 => TaskScheduler::TASK_NINETH,
- 10 => TaskScheduler::TASK_TENTH,
- 11 => TaskScheduler::TASK_ELEVENTH,
- 12 => TaskScheduler::TASK_TWELFTH,
- 13 => TaskScheduler::TASK_THIRTEENTH,
- 14 => TaskScheduler::TASK_FOURTEENTH,
- 15 => TaskScheduler::TASK_FIFTEENTH,
- 16 => TaskScheduler::TASK_SIXTEENTH,
- 17 => TaskScheduler::TASK_SEVENTEENTH,
- 18 => TaskScheduler::TASK_EIGHTEENTH,
- 19 => TaskScheduler::TASK_NINETEENTH,
- 20 => TaskScheduler::TASK_TWENTIETH,
- 21 => TaskScheduler::TASK_TWENTY_FIRST,
- 22 => TaskScheduler::TASK_TWENTY_SECOND,
- 23 => TaskScheduler::TASK_TWENTY_THIRD,
- 24 => TaskScheduler::TASK_TWENTY_FOURTH,
- 25 => TaskScheduler::TASK_TWENTY_FIFTH,
- 26 => TaskScheduler::TASK_TWENTY_SIXTH,
- 27 => TaskScheduler::TASK_TWENTY_SEVENTH,
- 28 => TaskScheduler::TASK_TWENTY_EIGHTH,
- 29 => TaskScheduler::TASK_TWENTY_NINTH,
- # cspell:disable-next-line
- 30 => TaskScheduler::TASK_THIRTYETH,
- 31 => TaskScheduler::TASK_THIRTY_FIRST,
- }.freeze
-
- PRIORITY = { "critical" => 0, "highest" => 1, "above_normal_2" => 2 , "above_normal_3" => 3, "normal_4" => 4,
- "normal_5" => 5, "normal_6" => 6, "below_normal_7" => 7, "below_normal_8" => 8, "lowest" => 9, "idle" => 10 }.freeze
-
- def load_current_resource
- @current_resource = Chef::Resource::WindowsTask.new(new_resource.name)
- task = TaskScheduler.new(new_resource.task_name, nil, "\\", false)
- @current_resource.exists = task.exists?(new_resource.task_name)
- if @current_resource.exists
- task.get_task(new_resource.task_name)
- @current_resource.task = task
- pathed_task_name = new_resource.task_name.start_with?('\\') ? new_resource.task_name : "\\#{new_resource.task_name}"
- @current_resource.task_name(pathed_task_name)
- end
- @current_resource
- end
-
- action :create do
- set_command_and_arguments if new_resource.command
-
- if current_resource.exists
- logger.trace "#{new_resource} task exist."
- unless (task_needs_update?(current_resource.task)) || (new_resource.force)
- logger.info "#{new_resource} task does not need updating and force is not specified - nothing to do"
- return
- end
-
- # if start_day and start_time is not set by user current date and time will be set while updating any property
- set_start_day_and_time unless new_resource.frequency == :none
- update_task(current_resource.task)
- else
- basic_validation
- set_start_day_and_time
- converge_by("#{new_resource} task created") do
- task = TaskScheduler.new
- if new_resource.frequency == :none
- task.new_work_item(new_resource.task_name, {}, { user: new_resource.user, password: new_resource.password, interactive: new_resource.interactive_enabled })
- task.activate(new_resource.task_name)
- else
- task.new_work_item(new_resource.task_name, trigger, { user: new_resource.user, password: new_resource.password, interactive: new_resource.interactive_enabled })
- end
- task.application_name = new_resource.command
- task.parameters = new_resource.command_arguments if new_resource.command_arguments
- task.working_directory = new_resource.cwd if new_resource.cwd
- task.configure_settings(config_settings)
- task.configure_principals(principal_settings)
- task.set_account_information(new_resource.user, new_resource.password, new_resource.interactive_enabled)
- task.creator = new_resource.user
- task.description = new_resource.description unless new_resource.description.nil?
- task.activate(new_resource.task_name)
- end
- end
- end
-
- action :run do
- if current_resource.exists
- logger.trace "#{new_resource} task exists"
- if current_resource.task.status == "running"
- logger.info "#{new_resource} task is currently running, skipping run"
- else
- converge_by("run scheduled task #{new_resource}") do
- current_resource.task.run
- end
- end
- else
- logger.warn "#{new_resource} task does not exist - nothing to do"
- end
- end
-
- action :delete do
- if current_resource.exists
- logger.trace "#{new_resource} task exists"
- converge_by("delete scheduled task #{new_resource}") do
- ts = TaskScheduler.new
- ts.delete(current_resource.task_name)
- end
- else
- logger.warn "#{new_resource} task does not exist - nothing to do"
- end
- end
-
- action :end do
- if current_resource.exists
- logger.trace "#{new_resource} task exists"
- if current_resource.task.status != "running"
- logger.trace "#{new_resource} is not running - nothing to do"
- else
- converge_by("#{new_resource} task ended") do
- current_resource.task.stop
- end
- end
- else
- logger.warn "#{new_resource} task does not exist - nothing to do"
- end
- end
-
- action :enable do
- if current_resource.exists
- logger.trace "#{new_resource} task exists"
- if current_resource.task.status == "not scheduled"
- converge_by("#{new_resource} task enabled") do
- # TODO wind32-taskscheduler currently not having any method to handle this so using schtasks.exe here
- run_schtasks "CHANGE", "ENABLE" => ""
- end
- else
- logger.trace "#{new_resource} already enabled - nothing to do"
- end
- else
- logger.fatal "#{new_resource} task does not exist - nothing to do"
- raise Errno::ENOENT, "#{new_resource}: task does not exist, cannot enable"
- end
- end
-
- action :disable do
- if current_resource.exists
- logger.info "#{new_resource} task exists"
- if %w{ready running}.include?(current_resource.task.status)
- converge_by("#{new_resource} task disabled") do
- # TODO: in win32-taskscheduler there is no method which disables the task so currently calling disable with schtasks.exe
- run_schtasks "CHANGE", "DISABLE" => ""
- end
- else
- logger.warn "#{new_resource} already disabled - nothing to do"
- end
- else
- logger.warn "#{new_resource} task does not exist - nothing to do"
- end
- end
-
- alias_method :action_change, :action_create
-
- private
-
- # separated command arguments from :command property
- def set_command_and_arguments
- cmd, *args = Chef::Util::PathHelper.split_args(new_resource.command)
- new_resource.command = cmd
- new_resource.command_arguments = args.join(" ")
- end
-
- def set_start_day_and_time
- new_resource.start_day = Time.now.strftime("%m/%d/%Y") unless new_resource.start_day
- new_resource.start_time = Time.now.strftime("%H:%M") unless new_resource.start_time
- end
-
- def update_task(task)
- converge_by("#{new_resource} task updated") do
- task.set_account_information(new_resource.user, new_resource.password, new_resource.interactive_enabled)
- task.application_name = new_resource.command if new_resource.command
- task.parameters = new_resource.command_arguments if new_resource.command_arguments
- task.working_directory = new_resource.cwd if new_resource.cwd
- task.trigger = trigger unless new_resource.frequency == :none
- task.configure_settings(config_settings)
- task.creator = new_resource.user
- task.description = new_resource.description unless new_resource.description.nil?
- task.configure_principals(principal_settings)
- end
- end
-
- def trigger
- start_month, start_day, start_year = new_resource.start_day.to_s.split("/")
- start_hour, start_minute = new_resource.start_time.to_s.split(":")
- # TODO currently end_month, end_year and end_year needs to be set to 0. If not set win32-taskscheduler throwing nil into integer error.
- trigger_hash = {
- start_year: start_year.to_i,
- start_month: start_month.to_i,
- start_day: start_day.to_i,
- start_hour: start_hour.to_i,
- start_minute: start_minute.to_i,
- end_month: 0,
- end_day: 0,
- end_year: 0,
- trigger_type: trigger_type,
- type: type,
- random_minutes_interval: new_resource.random_delay,
- }
-
- if new_resource.frequency == :minute
- trigger_hash[:minutes_interval] = new_resource.frequency_modifier
- end
-
- if new_resource.frequency == :hourly
- minutes = convert_hours_in_minutes(new_resource.frequency_modifier.to_i)
- trigger_hash[:minutes_interval] = minutes
- end
-
- if new_resource.minutes_interval
- trigger_hash[:minutes_interval] = new_resource.minutes_interval
- end
-
- if new_resource.minutes_duration
- trigger_hash[:minutes_duration] = new_resource.minutes_duration
- end
-
- if trigger_type == TaskScheduler::MONTHLYDOW && frequency_modifier_contains_last_week?(new_resource.frequency_modifier)
- trigger_hash[:run_on_last_week_of_month] = true
- else
- trigger_hash[:run_on_last_week_of_month] = false
- end
-
- if trigger_type == TaskScheduler::MONTHLYDATE && day_includes_last_or_lastday?(new_resource.day)
- trigger_hash[:run_on_last_day_of_month] = true
- else
- trigger_hash[:run_on_last_day_of_month] = false
- end
- trigger_hash
- end
-
- def frequency_modifier_contains_last_week?(frequency_modifier)
- frequency_modifier = frequency_modifier.to_s.split(",")
- frequency_modifier.map! { |value| value.strip.upcase }
- frequency_modifier.include?("LAST")
- end
-
- def day_includes_last_or_lastday?(day)
- day = day.to_s.split(",")
- day.map! { |value| value.strip.upcase }
- day.include?("LAST") || day.include?("LASTDAY")
- end
-
- def convert_hours_in_minutes(hours)
- hours.to_i * 60 if hours
- end
-
- # TODO : Try to optimize this method
- # known issue : Since start_day and time is not mandatory while updating weekly frequency for which start_day is not mentioned by user idempotency
- # is not getting maintained as new_resource.start_day is nil and we fetch the day of week from start_day to set and its currently coming as nil and don't match with current_task
- def task_needs_update?(task)
- flag = false
- if new_resource.frequency == :none
- flag = (task.author != new_resource.user ||
- task.application_name != new_resource.command ||
- description_needs_update?(task) ||
- task.parameters != new_resource.command_arguments.to_s ||
- task.principals[:run_level] != run_level ||
- task.settings[:disallow_start_if_on_batteries] != new_resource.disallow_start_if_on_batteries ||
- task.settings[:stop_if_going_on_batteries] != new_resource.stop_if_going_on_batteries ||
- task.settings[:start_when_available] != new_resource.start_when_available)
- else
- current_task_trigger = task.trigger(0)
- new_task_trigger = trigger
- flag = (ISO8601::Duration.new(task.idle_settings[:idle_duration])) != (ISO8601::Duration.new(new_resource.idle_time * 60)) if new_resource.frequency == :on_idle
- flag = (ISO8601::Duration.new(task.execution_time_limit)) != (ISO8601::Duration.new(new_resource.execution_time_limit * 60)) unless new_resource.execution_time_limit.nil?
-
- # if trigger not found updating the task to add the trigger
- if current_task_trigger.nil?
- flag = true
- else
- flag = true if start_day_updated?(current_task_trigger, new_task_trigger) == true ||
- start_time_updated?(current_task_trigger, new_task_trigger) == true ||
- current_task_trigger[:trigger_type] != new_task_trigger[:trigger_type] ||
- current_task_trigger[:type] != new_task_trigger[:type] ||
- current_task_trigger[:random_minutes_interval].to_i != new_task_trigger[:random_minutes_interval].to_i ||
- current_task_trigger[:minutes_interval].to_i != new_task_trigger[:minutes_interval].to_i ||
- task.author.to_s.casecmp(new_resource.user.to_s) != 0 ||
- task.application_name != new_resource.command ||
- description_needs_update?(task) ||
- task.parameters != new_resource.command_arguments.to_s ||
- task.working_directory != new_resource.cwd.to_s ||
- task.principals[:logon_type] != logon_type ||
- task.principals[:run_level] != run_level ||
- PRIORITY[task.priority] != new_resource.priority ||
- task.settings[:disallow_start_if_on_batteries] != new_resource.disallow_start_if_on_batteries ||
- task.settings[:stop_if_going_on_batteries] != new_resource.stop_if_going_on_batteries ||
- task.settings[:start_when_available] != new_resource.start_when_available
- if trigger_type == TaskScheduler::MONTHLYDATE
- flag = true if current_task_trigger[:run_on_last_day_of_month] != new_task_trigger[:run_on_last_day_of_month]
- end
-
- if trigger_type == TaskScheduler::MONTHLYDOW
- flag = true if current_task_trigger[:run_on_last_week_of_month] != new_task_trigger[:run_on_last_week_of_month]
- end
- end
- end
- flag
- end
-
- def start_day_updated?(current_task_trigger, new_task_trigger)
- ( new_resource.start_day && (current_task_trigger[:start_year].to_i != new_task_trigger[:start_year] ||
- current_task_trigger[:start_month].to_i != new_task_trigger[:start_month] ||
- current_task_trigger[:start_day].to_i != new_task_trigger[:start_day]) )
- end
-
- def start_time_updated?(current_task_trigger, new_task_trigger)
- ( new_resource.start_time && ( current_task_trigger[:start_hour].to_i != new_task_trigger[:start_hour] ||
- current_task_trigger[:start_minute].to_i != new_task_trigger[:start_minute] ) )
- end
-
- def trigger_type
- case new_resource.frequency
- when :once, :minute, :hourly
- TaskScheduler::ONCE
- when :daily
- TaskScheduler::DAILY
- when :weekly
- TaskScheduler::WEEKLY
- when :monthly
- # If frequency modifier is set with frequency :monthly we are setting taskscheduler as monthlydow
- # Ref https://msdn.microsoft.com/en-us/library/windows/desktop/aa382061(v=vs.85).aspx
- new_resource.frequency_modifier.to_i.between?(1, 12) ? TaskScheduler::MONTHLYDATE : TaskScheduler::MONTHLYDOW
- when :on_idle
- TaskScheduler::ON_IDLE
- when :onstart
- TaskScheduler::AT_SYSTEMSTART
- when :on_logon
- TaskScheduler::AT_LOGON
- else
- raise ArgumentError, "Please set frequency"
- end
- end
-
- def type
- case trigger_type
- when TaskScheduler::ONCE
- { once: nil }
- when TaskScheduler::DAILY
- { days_interval: new_resource.frequency_modifier.to_i }
- when TaskScheduler::WEEKLY
- { weeks_interval: new_resource.frequency_modifier.to_i, days_of_week: days_of_week.to_i }
- when TaskScheduler::MONTHLYDATE
- { months: months_of_year.to_i, days: days_of_month.to_i }
- when TaskScheduler::MONTHLYDOW
- { months: months_of_year.to_i, days_of_week: days_of_week.to_i, weeks_of_month: weeks_of_month.to_i }
- when TaskScheduler::ON_IDLE
- # TODO: handle option for this trigger
- when TaskScheduler::AT_LOGON
- # TODO: handle option for this trigger
- when TaskScheduler::AT_SYSTEMSTART
- # TODO: handle option for this trigger
- end
- end
-
- # Deleting last from the array of weeks of month since last week is handled in :run_on_last_week_of_month parameter.
- def weeks_of_month
- weeks_of_month = []
- if new_resource.frequency_modifier
- weeks = new_resource.frequency_modifier.split(",")
- weeks.map! { |week| week.to_s.strip.upcase }
- weeks.delete("LAST") if weeks.include?("LAST")
- weeks_of_month = get_binary_values_from_constants(weeks, WEEKS_OF_MONTH)
- end
- weeks_of_month
- end
-
- # Deleting the "LAST" and "LASTDAY" from days since last day is handled in :run_on_last_day_of_month parameter.
- def days_of_month
- days_of_month = []
- if new_resource.day
- days = new_resource.day.to_s.split(",")
- days.map! { |day| day.to_s.strip.upcase }
- days.delete("LAST") if days.include?("LAST")
- days.delete("LASTDAY") if days.include?("LASTDAY")
- if days - (1..31).to_a
- days.each do |day|
- days_of_month << DAYS_OF_MONTH[day.to_i]
- end
- days_of_month = days_of_month.size > 1 ? days_of_month.inject(:|) : days_of_month[0]
- end
- else
- days_of_month = DAYS_OF_MONTH[1]
- end
- days_of_month
- end
-
- def days_of_week
- if new_resource.day
- # this line of code is just to support backward compatibility of wild card *
- new_resource.day = "mon, tue, wed, thu, fri, sat, sun" if new_resource.day == "*" && new_resource.frequency == :weekly
- days = new_resource.day.to_s.split(",")
- days.map! { |day| day.to_s.strip.upcase }
- weeks_days = get_binary_values_from_constants(days, DAYS_OF_WEEK)
- else
- # following condition will make the frequency :weekly idempotent if start_day is not provided by user setting day as the current_resource day
- if (current_resource) && (current_resource.task) && (current_resource.task.trigger(0)[:type][:days_of_week]) && (new_resource.start_day.nil?)
- weeks_days = current_resource.task.trigger(0)[:type][:days_of_week]
- else
- day = get_day(new_resource.start_day).to_sym if new_resource.start_day
- DAYS_OF_WEEK[day]
- end
- end
- end
-
- def months_of_year
- months_of_year = []
- if new_resource.frequency_modifier.to_i.between?(1, 12) && !(new_resource.months)
- new_resource.months = set_months(new_resource.frequency_modifier.to_i)
- end
-
- if new_resource.months
- # this line of code is just to support backward compatibility of wild card *
- new_resource.months = "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec" if new_resource.months == "*" && new_resource.frequency == :monthly
- months = new_resource.months.split(",")
- months.map! { |month| month.to_s.strip.upcase }
- months_of_year = get_binary_values_from_constants(months, MONTHS)
- else
- MONTHS.each do |key, value|
- months_of_year << MONTHS[key]
- end
- months_of_year = months_of_year.inject(:|)
- end
- months_of_year
- end
-
- # This values are set for frequency_modifier set as 1-12
- # This is to give backward compatibility validated this values with earlier code and running schtask.exe
- # Used this as reference https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks#d-dayday--
- def set_months(frequency_modifier)
- case frequency_modifier
- when 1
- "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec"
- when 2
- "feb, apr, jun, aug, oct, dec"
- when 3
- "mar, jun, sep, dec"
- when 4
- "apr, aug, dec"
- when 5
- "may, oct"
- when 6
- "jun, dec"
- when 7
- "jul"
- when 8
- "aug"
- when 9
- "sep"
- when 10
- "oct"
- when 11
- "nov"
- when 12
- "dec"
- end
- end
-
- def get_binary_values_from_constants(array_values, constant)
- data = []
- array_values.each do |value|
- value = value.to_sym
- data << constant[value]
- end
- data.size > 1 ? data.inject(:|) : data[0]
- end
-
- def run_level
- case new_resource.run_level
- when :highest
- TaskScheduler::TASK_RUNLEVEL_HIGHEST
- when :limited
- TaskScheduler::TASK_RUNLEVEL_LUA
- end
- end
-
- # TODO: while creating the configuration settings win32-taskscheduler it accepts execution time limit values in ISO8601 format
- def config_settings
- settings = {
- execution_time_limit: new_resource.execution_time_limit,
- enabled: true,
- }
- settings[:idle_duration] = new_resource.idle_time if new_resource.idle_time
- settings[:run_only_if_idle] = true if new_resource.idle_time
- settings[:priority] = new_resource.priority
- settings[:disallow_start_if_on_batteries] = new_resource.disallow_start_if_on_batteries
- settings[:stop_if_going_on_batteries] = new_resource.stop_if_going_on_batteries
- settings[:start_when_available] = new_resource.start_when_available
- settings
- end
-
- def principal_settings
- settings = {}
- settings[:run_level] = run_level
- settings[:logon_type] = logon_type
- settings
- end
-
- def description_needs_update?(task)
- task.description != new_resource.description unless new_resource.description.nil?
- end
-
- def logon_type
- # Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383566(v=vs.85).aspx
- # if nothing is passed as logon_type the TASK_LOGON_SERVICE_ACCOUNT is getting set as default so using that for comparison.
- user_id = new_resource.user.to_s
- password = new_resource.password.to_s
- if Chef::ReservedNames::Win32::Security::SID.service_account_user?(user_id)
- TaskScheduler::TASK_LOGON_SERVICE_ACCOUNT
- elsif Chef::ReservedNames::Win32::Security::SID.group_user?(user_id)
- TaskScheduler::TASK_LOGON_GROUP
- elsif !user_id.empty? && !password.empty?
- if new_resource.interactive_enabled
- TaskScheduler::TASK_LOGON_INTERACTIVE_TOKEN
- else
- TaskScheduler::TASK_LOGON_PASSWORD
- end
- else
- TaskScheduler::TASK_LOGON_INTERACTIVE_TOKEN
- end
- end
-
- # This method checks if task and command properties exist since those two are mandatory properties to create a schedules task.
- def basic_validation
- validate = []
- validate << "Command" if new_resource.command.nil? || new_resource.command.empty?
- validate << "Task Name" if new_resource.task_name.nil? || new_resource.task_name.empty?
- return true if validate.empty?
-
- raise Chef::Exceptions::ValidationFailed.new "Value for '#{validate.join(", ")}' option cannot be empty"
- end
-
- # rubocop:disable Style/StringLiteralsInInterpolation
- def run_schtasks(task_action, options = {})
- cmd = "schtasks /#{task_action} /TN \"#{new_resource.task_name}\" "
- options.each_key do |option|
- unless option == "TR"
- cmd += "/#{option} "
- cmd += "\"#{options[option].to_s.gsub('"', "\\\"")}\" " unless options[option] == ""
- end
- end
- # Appending Task Run [TR] option at the end since appending causing sometimes to append other options in option["TR"] value
- if options["TR"]
- cmd += "/TR \"#{options["TR"]} \" " unless task_action == "DELETE"
- end
- logger.trace("running: ")
- logger.trace(" #{cmd}")
- shell_out!(cmd, returns: [0])
- end
- # rubocop:enable Style/StringLiteralsInInterpolation
-
- def get_day(date)
- Date.strptime(date, "%m/%d/%Y").strftime("%a").upcase
- end
- end
- end
- end
-end
diff --git a/lib/chef/provider/zypper_repository.rb b/lib/chef/provider/zypper_repository.rb
index 6427a27746..53dae74948 100644
--- a/lib/chef/provider/zypper_repository.rb
+++ b/lib/chef/provider/zypper_repository.rb
@@ -20,7 +20,7 @@ require_relative "../resource"
require_relative "../dsl/declare_resource"
require_relative "noop"
require "shellwords" unless defined?(Shellwords)
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Provider
@@ -110,7 +110,7 @@ class Chef
logger.trace("Will use :cookbook_file resource to cache the gpg key locally")
:cookbook_file
else
- raise Chef::Exceptions::FileNotFound, "Cannot determine location of gpgkey. Must start with 'http' or be a file managed by #{Chef::Dist::PRODUCT}."
+ raise Chef::Exceptions::FileNotFound, "Cannot determine location of gpgkey. Must start with 'http' or be a file managed by #{ChefUtils::Dist::Infra::PRODUCT}."
end
end
diff --git a/lib/chef/provider_resolver.rb b/lib/chef/provider_resolver.rb
index b0dd0d9376..94727a1043 100644
--- a/lib/chef/provider_resolver.rb
+++ b/lib/chef/provider_resolver.rb
@@ -113,7 +113,7 @@ class Chef
# if resource.provider is set, just return one of those objects
def maybe_explicit_provider(resource)
- resource.provider if resource.provider
+ resource.provider
end
# try dynamically finding a provider based on querying the providers to see what they support
diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb
index 6b099fc2b7..7652d60896 100644
--- a/lib/chef/providers.rb
+++ b/lib/chef/providers.rb
@@ -47,11 +47,8 @@ require_relative "provider/systemd_unit"
require_relative "provider/template"
require_relative "provider/user"
require_relative "provider/whyrun_safe_ruby_block"
-require_relative "provider/windows_env"
require_relative "provider/yum_repository"
-require_relative "provider/windows_task"
require_relative "provider/zypper_repository"
-require_relative "provider/windows_path"
require_relative "provider/package/apt"
require_relative "provider/package/chocolatey"
diff --git a/lib/chef/pwsh.rb b/lib/chef/pwsh.rb
new file mode 100644
index 0000000000..3d067eb0d6
--- /dev/null
+++ b/lib/chef/pwsh.rb
@@ -0,0 +1,71 @@
+#
+# Author:: Matt Wrock (<mwrock@chef.io>)
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+class Chef
+ class Pwsh < Chef::PowerShell
+
+ # Run a command under pwsh (powershell core) via FFI
+ # This implementation requires the managed dll, native wrapper and a
+ # published, self contained dotnet core directory tree to exist in the
+ # bindir directory.
+ #
+ # @param script [String] script to run
+ # @return [Object] output
+ def initialize(script)
+ @dll = Pwsh.dll
+ super
+ end
+
+ protected
+
+ def exec(script)
+ # Note that we need to override the location of the shared dotnet core library
+ # location. With most .net core applications, you can simply publish them as a
+ # "self-contained" application allowing consumers of the application to run them
+ # and use its own stand alone version of the .net core runtime. However because
+ # this is simply a dll and not an exe, it will look for the runtime in the shared
+ # .net core installation folder. By setting DOTNET_MULTILEVEL_LOOKUP to 0 we can
+ # override that folder's location with DOTNET_ROOT. To avoid the possibility of
+ # interfering with other .net core processes that might rely on the common shared
+ # location, we revert these variables after the script completes.
+ original_dml = ENV["DOTNET_MULTILEVEL_LOOKUP"]
+ original_dotnet_root = ENV["DOTNET_ROOT"]
+ original_dotnet_root_x86 = ENV["DOTNET_ROOT(x86)"]
+
+ ENV["DOTNET_MULTILEVEL_LOOKUP"] = "0"
+ ENV["DOTNET_ROOT"] = RbConfig::CONFIG["bindir"]
+ ENV["DOTNET_ROOT(x86)"] = RbConfig::CONFIG["bindir"]
+
+ super
+ ensure
+ ENV["DOTNET_MULTILEVEL_LOOKUP"] = original_dml
+ ENV["DOTNET_ROOT"] = original_dotnet_root
+ ENV["DOTNET_ROOT(x86)"] = original_dotnet_root_x86
+ end
+
+ def self.dll
+ # This Powershell DLL source lives here: https://github.com/chef/chef-powershell-shim
+ # Every merge into that repo triggers a Habitat build and promotion. Running
+ # the rake :update_chef_exec_dll task in this (chef/chef) repo will pull down
+ # the built packages and copy the binaries to distro/ruby_bin_folder. Bundle install
+ # ensures that the correct architecture binaries are installed into the path.
+ # Also note that the version of pwsh is determined by which assemblies the dll was
+ # built with. To update powershell, those dependencies must be bumped.
+ @dll ||= Dir.glob("#{RbConfig::CONFIG["bindir"]}/**/Chef.PowerShell.Wrapper.Core.dll").last
+ end
+ end
+end
diff --git a/lib/chef/recipe.rb b/lib/chef/recipe.rb
index be188817d6..972edf9649 100644
--- a/lib/chef/recipe.rb
+++ b/lib/chef/recipe.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require "yaml" unless defined?(YAML)
+autoload :YAML, "yaml"
require_relative "dsl/recipe"
require_relative "mixin/from_file"
require_relative "mixin/deprecation"
@@ -122,7 +122,7 @@ class Chef
end
def to_s
- "cookbook: #{cookbook_name ? cookbook_name : "(none)"}, recipe: #{recipe_name ? recipe_name : "(none)"} "
+ "cookbook: #{cookbook_name || "(none)"}, recipe: #{recipe_name || "(none)"} "
end
def inspect
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 735ef47b63..e572f0667d 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -36,7 +36,7 @@ require_relative "resource/resource_notification"
require_relative "provider_resolver"
require_relative "resource_resolver"
require_relative "provider"
-require "set" unless defined?(Set)
+autoload :Set, "set"
require_relative "mixin/deprecation"
require_relative "mixin/properties"
@@ -1480,7 +1480,7 @@ class Chef
def self.use(partial)
dirname = ::File.dirname(partial)
basename = ::File.basename(partial, ".rb")
- basename = basename[1..-1] if basename.start_with?("_")
+ basename = basename[1..] if basename.start_with?("_")
class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
end
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index bc0c904745..da8ca78413 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -19,7 +19,9 @@
require_relative "../resource"
require_relative "../http/simple"
require "tmpdir" unless defined?(Dir.mktmpdir)
-require "addressable" unless defined?(Addressable)
+module Addressable
+ autoload :URI, "addressable/uri"
+end
class Chef
class Resource
@@ -60,15 +62,14 @@ class Chef
end
```
- **Add the JuJu PPA, grab the key from the keyserver, and add source repo**:
+ **Add the JuJu PPA, grab the key from the Ubuntu keyserver, and add source repo**:
```ruby
apt_repository 'juju' do
- uri 'http://ppa.launchpad.net/juju/stable/ubuntu'
+ uri 'ppa:juju/stable'
components ['main']
distribution 'xenial'
key 'C8068B11'
- keyserver 'keyserver.ubuntu.com'
action :add
deb_src true
end
@@ -168,7 +169,7 @@ class Chef
# is the provided ID a key ID from a keyserver. Looks at length and HEX only values
# @param [String] id the key value passed by the user that *may* be an ID
def is_key_id?(id)
- id = id[2..-1] if id.start_with?("0x")
+ id = id[2..] if id.start_with?("0x")
id =~ /^\h+$/ && [8, 16, 40].include?(id.length)
end
diff --git a/lib/chef/resource/bash.rb b/lib/chef/resource/bash.rb
index bf59c87a9e..9ed6dc68d5 100644
--- a/lib/chef/resource/bash.rb
+++ b/lib/chef/resource/bash.rb
@@ -25,7 +25,125 @@ class Chef
provides :bash
- description "Use the **bash** resource to execute scripts using the Bash interpreter. This resource may also use any of the actions and properties that are available to the execute resource. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence."
+ description "Use the **bash** resource to execute scripts using the Bash interpreter. This resource may also use any of the actions and properties that are available to the **execute** resource. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` to guard this resource for idempotence."
+ examples <<~'DOC'
+ **Compile an application**
+
+ ```ruby
+ bash 'install_something' do
+ user 'root'
+ cwd '/tmp'
+ code <<-EOH
+ wget http://www.example.com/tarball.tar.gz
+ tar -zxf tarball.tar.gz
+ cd tarball
+ ./configure
+ make
+ make install
+ EOH
+ end
+ ```
+
+ **Install a file from a remote location**
+
+ The following is an example of how to install the foo123 module for Nginx. This module adds shell-style functionality to an Nginx configuration file and does the following:
+
+ - Declares three variables
+ - Gets the Nginx file from a remote location
+ - Installs the file using Bash to the path specified by the `src_filepath` variable
+
+ ```ruby
+ src_filename = "foo123-nginx-module-v#{node['nginx']['foo123']['version']}.tar.gz"
+ src_filepath = "#{Chef::Config['file_cache_path']}/#{src_filename}"
+ extract_path = "#{Chef::Config['file_cache_path']}/nginx_foo123_module/#{node['nginx']['foo123']['checksum']}"
+
+ remote_file 'src_filepath' do
+ source node['nginx']['foo123']['url']
+ checksum node['nginx']['foo123']['checksum']
+ owner 'root'
+ group 'root'
+ mode '0755'
+ end
+
+ bash 'extract_module' do
+ cwd ::File.dirname(src_filepath)
+ code <<-EOH
+ mkdir -p #{extract_path}
+ tar xzf #{src_filename} -C #{extract_path}
+ mv #{extract_path}/*/* #{extract_path}/
+ EOH
+ not_if { ::File.exist?(extract_path) }
+ end
+ ```
+
+ **Install an application from git**
+
+ ```ruby
+ git "#{Chef::Config[:file_cache_path]}/ruby-build" do
+ repository 'git://github.com/rbenv/ruby-build.git'
+ revision 'master'
+ action :sync
+ end
+
+ bash 'install_ruby_build' do
+ cwd "#{Chef::Config[:file_cache_path]}/ruby-build"
+ user 'rbenv'
+ group 'rbenv'
+ code <<-EOH
+ ./install.sh
+ EOH
+ environment 'PREFIX' => '/usr/local'
+ end
+ ```
+
+ **Using Attributes in Bash Code**
+
+ The following recipe shows how an attributes file can be used to store certain settings. An attributes file is located in the `attributes/`` directory in the same cookbook as the recipe which calls the attributes file. In this example, the attributes file specifies certain settings for Python that are then used across all nodes against which this recipe will run.
+
+ Python packages have versions, installation directories, URLs, and checksum files. An attributes file that exists to support this type of recipe would include settings like the following:
+
+ ```ruby
+ default['python']['version'] = '2.7.1'
+
+ if python['install_method'] == 'package'
+ default['python']['prefix_dir'] = '/usr'
+ else
+ default['python']['prefix_dir'] = '/usr/local'
+ end
+
+ default['python']['url'] = 'http://www.python.org/ftp/python'
+ default['python']['checksum'] = '80e387...85fd61'
+ ```
+
+ and then the methods in the recipe may refer to these values. A recipe that is used to install Python will need to do the following:
+
+ - Identify each package to be installed (implied in this example, not shown)
+ - Define variables for the package `version` and the `install_path`
+ - Get the package from a remote location, but only if the package does not already exist on the target system
+ - Use the **bash** resource to install the package on the node, but only when the package is not already installed
+
+ ```ruby
+ version = node['python']['version']
+ install_path = "#{node['python']['prefix_dir']}/lib/python#{version.split(/(^\d+\.\d+)/)[1]}"
+
+ remote_file "#{Chef::Config[:file_cache_path]}/Python-#{version}.tar.bz2" do
+ source "#{node['python']['url']}/#{version}/Python-#{version}.tar.bz2"
+ checksum node['python']['checksum']
+ mode '0755'
+ not_if { ::File.exist?(install_path) }
+ end
+
+ bash 'build-and-install-python' do
+ cwd Chef::Config[:file_cache_path]
+ code <<-EOF
+ tar -jxvf Python-#{version}.tar.bz2
+ (cd Python-#{version} && ./configure #{configure_options})
+ (cd Python-#{version} && make && make install)
+ EOF
+ not_if { ::File.exist?(install_path) }
+ end
+ ```
+ DOC
def initialize(name, run_context = nil)
super
diff --git a/lib/chef/resource/batch.rb b/lib/chef/resource/batch.rb
index 4a9935a920..bbb5e73905 100644
--- a/lib/chef/resource/batch.rb
+++ b/lib/chef/resource/batch.rb
@@ -25,7 +25,7 @@ class Chef
provides :batch
- description "Use the **batch** resource to execute a batch script using the cmd.exe interpreter on Windows. The batch resource creates and executes a temporary file (similar to how the script resource behaves), rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence."
+ description "Use the **batch** resource to execute a batch script using the cmd.exe interpreter on Windows. The batch resource creates and executes a temporary file (similar to how the script resource behaves), rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` to guard this resource for idempotence."
def initialize(*args)
super
diff --git a/lib/chef/resource/bff_package.rb b/lib/chef/resource/bff_package.rb
index d0b67d081b..ffe5dfac1b 100644
--- a/lib/chef/resource/bff_package.rb
+++ b/lib/chef/resource/bff_package.rb
@@ -17,6 +17,7 @@
#
require_relative "package"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -27,6 +28,27 @@ class Chef
description "Use the **bff_package** resource to manage packages for the AIX platform using the installp utility. When a package is installed from a local file, it must be added to the node using the **remote_file** or **cookbook_file** resources."
introduced "12.0"
+ examples <<~DOC
+ The **bff_package** resource is the default package provider on the AIX platform. The base **package** resource may be used, and then when the platform is AIX, #{ChefUtils::Dist::Infra::PRODUCT} will identify the correct package provider. The following examples show how to install part of the IBM XL C/C++ compiler.
+
+ **Installing using the base package resource**
+
+ ```ruby
+ package 'xlccmp.13.1.0' do
+ source '/var/tmp/IBM_XL_C_13.1.0/usr/sys/inst.images/xlccmp.13.1.0'
+ action :install
+ end
+ ```
+
+ **Installing using the bff_package resource**
+
+ ```ruby
+ bff_package 'xlccmp.13.1.0' do
+ source '/var/tmp/IBM_XL_C_13.1.0/usr/sys/inst.images/xlccmp.13.1.0'
+ action :install
+ end
+ ```
+ DOC
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb
index d1e6bbf179..50e2d06391 100644
--- a/lib/chef/resource/breakpoint.rb
+++ b/lib/chef/resource/breakpoint.rb
@@ -17,7 +17,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -26,8 +26,65 @@ class Chef
provides :breakpoint, target_mode: true
- description "Use the **breakpoint** resource to add breakpoints to recipes. Run the #{Chef::Dist::SHELL} in #{Chef::Dist::PRODUCT} mode, and then use those breakpoints to debug recipes. Breakpoints are ignored by the #{Chef::Dist::CLIENT} during an actual #{Chef::Dist::CLIENT} run. That said, breakpoints are typically used to debug recipes only when running them in a non-production environment, after which they are removed from those recipes before the parent cookbook is uploaded to the Chef server."
+ description "Use the **breakpoint** resource to add breakpoints to recipes. Run the #{ChefUtils::Dist::Infra::SHELL} in #{ChefUtils::Dist::Infra::PRODUCT} mode, and then use those breakpoints to debug recipes. Breakpoints are ignored by the #{ChefUtils::Dist::Infra::CLIENT} during an actual #{ChefUtils::Dist::Infra::CLIENT} run. That said, breakpoints are typically used to debug recipes only when running them in a non-production environment, after which they are removed from those recipes before the parent cookbook is uploaded to the Chef server."
introduced "12.0"
+ examples <<~DOC
+ **A recipe without a breakpoint**
+
+ ```ruby
+ yum_key node['yum']['elrepo']['key'] do
+ url node['yum']['elrepo']['key_url']
+ action :add
+ end
+
+ yum_repository 'elrepo' do
+ description 'ELRepo.org Community Enterprise Linux Extras Repository'
+ key node['yum']['elrepo']['key']
+ mirrorlist node['yum']['elrepo']['url']
+ includepkgs node['yum']['elrepo']['includepkgs']
+ exclude node['yum']['elrepo']['exclude']
+ action :create
+ end
+ ```
+
+ **The same recipe with breakpoints**
+
+ In the following example, the name of each breakpoint is an arbitrary string.
+
+ ```ruby
+ breakpoint "before yum_key node['yum']['repo_name']['key']" do
+ action :break
+ end
+
+ yum_key node['yum']['repo_name']['key'] do
+ url node['yum']['repo_name']['key_url']
+ action :add
+ end
+
+ breakpoint "after yum_key node['yum']['repo_name']['key']" do
+ action :break
+ end
+
+ breakpoint "before yum_repository 'repo_name'" do
+ action :break
+ end
+
+ yum_repository 'repo_name' do
+ description 'description'
+ key node['yum']['repo_name']['key']
+ mirrorlist node['yum']['repo_name']['url']
+ includepkgs node['yum']['repo_name']['includepkgs']
+ exclude node['yum']['repo_name']['exclude']
+ action :create
+ end
+
+ breakpoint "after yum_repository 'repo_name'" do
+ action :break
+ end
+ ```
+
+ In the previous examples, the names are used to indicate if the breakpoint is before or after a resource and also to specify which resource it is before or after.
+ DOC
default_action :break
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index ad37d3924f..3039f709c8 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -15,7 +15,6 @@
#
require_relative "../resource"
-require "plist"
class Chef
class Resource
@@ -130,8 +129,8 @@ class Chef
pkg_label = xcode_cli_package_label
# With upgrade action we should install if it's not installed or if there's an available update.
- # `xcode_cli_package_label` will be nil if there's no update.
- install_xcode_cli_tools(pkg_label) if !xcode_cli_installed? || xcode_cli_package_label
+ # `pkg_label` will be nil if there's no update.
+ install_xcode_cli_tools(pkg_label) if !xcode_cli_installed? || pkg_label
else
Chef::Log.info "The build_essential resource :upgrade action is only supported on macOS systems. Skipping..."
end
@@ -160,14 +159,12 @@ class Chef
end
#
- # Determine if the XCode Command Line Tools are installed by parsing the install history plist.
- # We parse the plist data install of running pkgutil because we found that pkgutils doesn't always contain all the packages
+ # Determine if the XCode Command Line Tools are installed by checking
+ # for success from `xcode-select -p`
#
# @return [true, false]
def xcode_cli_installed?
- packages = ::Plist.parse_xml(::File.open("/Library/Receipts/InstallHistory.plist", "r"))
- packages.select! { |package| package["displayName"].match? "Command Line Tools" }
- !packages.empty?
+ !shell_out("xcode-select", "-p").error?
end
#
diff --git a/lib/chef/resource/cab_package.rb b/lib/chef/resource/cab_package.rb
index 374eac56a4..904fe81701 100644
--- a/lib/chef/resource/cab_package.rb
+++ b/lib/chef/resource/cab_package.rb
@@ -29,6 +29,35 @@ class Chef
description "Use the **cab_package** resource to install or remove Microsoft Windows cabinet (.cab) packages."
introduced "12.15"
+ examples <<~'DOC'
+ **Using local path in source**
+
+ ```ruby
+ cab_package 'Install .NET 3.5 sp1 via KB958488' do
+ source 'C:\Users\xyz\AppData\Local\Temp\Windows6.1-KB958488-x64.cab'
+ action :install
+ end
+
+ cab_package 'Remove .NET 3.5 sp1 via KB958488' do
+ source 'C:\Users\xyz\AppData\Local\Temp\Windows6.1-KB958488-x64.cab'
+ action :remove
+ end
+ ```
+
+ **Using URL in source**
+
+ ```ruby
+ cab_package 'Install .NET 3.5 sp1 via KB958488' do
+ source 'https://s3.amazonaws.com/my_bucket/Windows6.1-KB958488-x64.cab'
+ action :install
+ end
+
+ cab_package 'Remove .NET 3.5 sp1 via KB958488' do
+ source 'https://s3.amazonaws.com/my_bucket/Temp\Windows6.1-KB958488-x64.cab'
+ action :remove
+ end
+ ```
+ DOC
allowed_actions :install, :remove
diff --git a/lib/chef/resource/chef_client_config.rb b/lib/chef/resource/chef_client_config.rb
new file mode 100644
index 0000000000..b3ea86c476
--- /dev/null
+++ b/lib/chef/resource/chef_client_config.rb
@@ -0,0 +1,313 @@
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "../resource"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
+
+class Chef
+ class Resource
+ class ChefClientConfig < Chef::Resource
+ unified_mode true
+
+ provides :chef_client_config
+
+ description "Use the **chef_client_config** resource to create a client.rb file in the #{ChefUtils::Dist::Infra::PRODUCT} configuration directory. See the [client.rb docs](https://docs.chef.io/config_rb_client/) for more details on options available in the client.rb configuration file."
+ introduced "16.6"
+ examples <<~DOC
+ **Bare minimum #{ChefUtils::Dist::Infra::PRODUCT} client.rb**:
+
+ The absolute minimum configuration necessary for a node to communicate with the Infra Server is the URL of the Infra Server. All other configuration options either have values at the server side (Policyfiles, Roles, Environments, etc) or have default values determined at client startup.
+
+ ```ruby
+ chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+ end
+ ```
+
+ **More complex #{ChefUtils::Dist::Infra::PRODUCT} client.rb**:
+
+ ```ruby
+ chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+ log_level :info
+ log_location :syslog
+ http_proxy 'proxy.example.dmz'
+ https_proxy 'proxy.example.dmz'
+ no_proxy %w(internal.example.dmz)
+ end
+ ```
+
+ **Adding additional config content to the client.rb**:
+
+ This resource aims to provide common configuration options. Some configuration options are missing and some users may want to use arbitrary Ruby code within their configuration. For this we offer an `additional_config` property that can be used to add any configuration or code to the bottom of the `client.rb` file. Also keep in mind that within the configuration directory is a `client.d` directory where you can put additional `.rb` files containing configuration options. These can be created using `file` or `template` resources within your cookbooks as necessary.
+
+ ```ruby
+ chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+ additional_config <<~CONFIG
+ # Extra config code to safely load a gem into the client run.
+ # Since the config is Ruby you can run any Ruby code you want via the client.rb.
+ # It's a great way to break things, so be careful
+ begin
+ require 'aws-sdk'
+ rescue LoadError
+ Chef::Log.warn "Failed to load aws-sdk."
+ end
+ CONFIG
+ end
+ ```
+
+ **Setup two report handlers in the client.rb**:
+
+ ```ruby
+ chef_client_config 'Create client.rb' do
+ chef_server_url 'https://chef.example.dmz'
+ report_handlers [
+ {
+ 'class' => 'ReportHandler1Class',
+ 'arguments' => ["'FirstArgument'", "'SecondArgument'"],
+ },
+ {
+ 'class' => 'ReportHandler2Class',
+ 'arguments' => ["'FirstArgument'", "'SecondArgument'"],
+ },
+ ]
+ end
+ ```
+ DOC
+
+ # @todo policy_file or policy_group being set requires the other to be set so enforce that.
+ # @todo all properties for automate report
+ # @todo add all descriptions
+ # @todo validate handler hash structure
+
+ #
+ # @param [String, Symbol] prop_val the value from the property
+ #
+ # @return [Symbol] The symbol form of the symbol-like string, string, or symbol value
+ #
+ def string_to_symbol(prop_val)
+ if prop_val.is_a?(String) && prop_val.start_with?(":")
+ prop_val[1..-1].to_sym
+ else
+ prop_val.to_sym
+ end
+ end
+
+ property :config_directory, String,
+ description: "The directory to store the client.rb in.",
+ default: ChefConfig::Config.etc_chef_dir,
+ default_description: "`/etc/chef/` on *nix-like systems and `C:\\chef\\` on Windows"
+
+ property :user, String,
+ description: "The user that should own the client.rb file and the configuration directory if it needs to be created. Note: The configuration directory will not be created if it already exists, which allows you to further control the setup of that directory outside of this resource."
+
+ property :group, String,
+ description: "The group that should own the client.rb file and the configuration directory if it needs to be created. Note: The configuration directory will not be created if it already exists, which allows you to further control the setup of that directory outside of this resource."
+
+ property :node_name, [String, NilClass], # this accepts nil so people can disable the default
+ description: "The name of the node. This configuration sets the `node.name` value used in cookbooks and the `client_name` value used when authenticating to a #{ChefUtils::Dist::Server::PRODUCT} to determine what configuration to apply. Note: By default this configuration uses the `node.name` value which would be set during bootstrap. Hard coding this value in the `client.rb` config avoids logic within #{ChefUtils::Dist::Server::PRODUCT} that performs DNS lookups and may fail in the event of a DNS outage. To skip this default value and instead use the built-in #{ChefUtils::Dist::Server::PRODUCT} logic, set this property to `nil`",
+ default: lazy { node.name },
+ default_description: "The `node.name` value reported by #{ChefUtils::Dist::Infra::PRODUCT}."
+
+ property :chef_server_url, String,
+ description: "The URL for the #{ChefUtils::Dist::Server::PRODUCT}.",
+ required: true
+
+ # @todo Allow passing this as a string and convert it to the symbol
+ property :ssl_verify_mode, [Symbol, String],
+ equal_to: %i{verify_none verify_peer},
+ coerce: proc { |x| string_to_symbol(x) },
+ description: <<~DESC
+ Set the verify mode for HTTPS requests.
+
+ * Use :verify_none for no validation of SSL certificates.
+ * Use :verify_peer for validation of all SSL certificates, including the #{ChefUtils::Dist::Server::PRODUCT} connections, S3 connections, and any HTTPS remote_file resource URLs used in #{ChefUtils::Dist::Infra::PRODUCT} runs. This is the recommended setting.
+ DESC
+
+ property :formatters, Array,
+ description: "",
+ default: []
+
+ property :event_loggers, Array,
+ description: "",
+ default: []
+
+ property :log_level, Symbol,
+ description: "The level of logging performed by the #{ChefUtils::Dist::Infra::PRODUCT}.",
+ equal_to: %i{auto trace debug info warn fatal}
+
+ property :log_location, [String, Symbol],
+ description: "The location to save logs to. This can either by a path to a log file on disk `:syslog` to log to Syslog, `:win_evt` to log to the Windows Event Log, or `'STDERR'`/`'STDOUT'` to log to the *nix text streams.",
+ callbacks: {
+ "accepts Symbol values of ':win_evt' for Windows Event Log or ':syslog' for Syslog" => lambda { |p|
+ p.is_a?(Symbol) ? %i{win_evt syslog}.include?(p) : true
+ },
+ }
+
+ property :http_proxy, String,
+ description: "The proxy server to use for HTTP connections."
+
+ property :https_proxy, String,
+ description: "The proxy server to use for HTTPS connections."
+
+ property :ftp_proxy, String,
+ description: "The proxy server to use for FTP connections."
+
+ property :no_proxy, [String, Array],
+ description: "A comma-separated list or an array of URLs that do not need a proxy.",
+ coerce: proc { |x| x.is_a?(Array) ? x.join(",") : x },
+ default: []
+
+ # @todo we need to fixup bad plugin naming inputs here
+ property :ohai_disabled_plugins, Array,
+ description: "Ohai plugins that should be disabled in order to speed up the #{ChefUtils::Dist::Infra::PRODUCT} run and reduce the size of node data sent to #{ChefUtils::Dist::Infra::PRODUCT}",
+ coerce: proc { |x| x.map { |v| string_to_symbol(v).capitalize } },
+ default: []
+
+ # @todo we need to fixup bad plugin naming inputs here
+ property :ohai_optional_plugins, Array,
+ description: "Optional Ohai plugins that should be enabled to provide additional Ohai data for use in cookbooks.",
+ coerce: proc { |x| x.map { |v| string_to_symbol(v).capitalize } },
+ default: []
+
+ property :minimal_ohai, [true, false],
+ description: "Run a minimal set of Ohai plugins providing data necessary for the execution of #{ChefUtils::Dist::Infra::PRODUCT}'s built-in resources. Setting this to true will skip many large and time consuming data sets such as `cloud` or `packages`. Setting this this to true may break cookbooks that assume all Ohai data will be present."
+
+ property :start_handlers, Array,
+ description: %q(An array of hashes that contain a report handler class and the arguments to pass to that class on initialization. The hash should include `class` and `argument` keys where `class` is a String and `argument` is an array of quoted String values. For example: `[{'class' => 'MyHandler', %w('"argument1"', '"argument2"')}]`),
+ default: []
+
+ property :report_handlers, Array,
+ description: %q(An array of hashes that contain a report handler class and the arguments to pass to that class on initialization. The hash should include `class` and `argument` keys where `class` is a String and `argument` is an array of quoted String values. For example: `[{'class' => 'MyHandler', %w('"argument1"', '"argument2"')}]`),
+ default: []
+
+ property :exception_handlers, Array,
+ description: %q(An array of hashes that contain a exception handler class and the arguments to pass to that class on initialization. The hash should include `class` and `argument` keys where `class` is a String and `argument` is an array of quoted String values. For example: `[{'class' => 'MyHandler', %w('"argument1"', '"argument2"')}]`),
+ default: []
+
+ property :chef_license, String,
+ description: "Accept the [Chef EULA](https://www.chef.io/end-user-license-agreement/)",
+ equal_to: %w{accept accept-no-persist accept-silent}
+
+ property :policy_name, String,
+ description: "The name of a policy, as identified by the `name` setting in a Policyfile.rb file. `policy_group` when setting this property."
+
+ property :policy_group, String,
+ description: "The name of a `policy group` that exists on the #{ChefUtils::Dist::Server::PRODUCT}. `policy_name` must also be specified when setting this property."
+
+ property :named_run_list, String,
+ description: "A specific named runlist defined in the node's applied Policyfile, which the should be used when running #{ChefUtils::Dist::Infra::PRODUCT}."
+
+ property :pid_file, String,
+ description: "The location in which a process identification number (pid) is saved. An executable, when started as a daemon, writes the pid to the specified file. "
+
+ property :file_cache_path, String,
+ description: "The location in which cookbooks (and other transient data) files are stored when they are synchronized. This value can also be used in recipes to download files with the `remote_file` resource."
+
+ property :file_backup_path, String,
+ description: "The location in which backup files are stored. If this value is empty, backup files are stored in the directory of the target file"
+
+ property :file_staging_uses_destdir, String,
+ description: "How file staging (via temporary files) is done. When `true`, temporary files are created in the directory in which files will reside. When `false`, temporary files are created under `ENV['TMP']`"
+
+ property :additional_config, String,
+ description: "Additional text to add at the bottom of the client.rb config. This can be used to run custom Ruby or to add less common config options"
+
+ action :create do
+ unless ::Dir.exist?(new_resource.config_directory)
+ directory new_resource.config_directory do
+ user new_resource.user unless new_resource.user.nil?
+ group new_resource.group unless new_resource.group.nil?
+ mode "0750"
+ recursive true
+ end
+ end
+
+ unless ::Dir.exist?(::File.join(new_resource.config_directory, "client.d"))
+ directory ::File.join(new_resource.config_directory, "client.d") do
+ user new_resource.user unless new_resource.user.nil?
+ group new_resource.group unless new_resource.group.nil?
+ mode "0750"
+ recursive true
+ end
+ end
+
+ template ::File.join(new_resource.config_directory, "client.rb") do
+ source ::File.expand_path("support/client.erb", __dir__)
+ user new_resource.user unless new_resource.user.nil?
+ group new_resource.group unless new_resource.group.nil?
+ local true
+ variables(
+ chef_license: new_resource.chef_license,
+ chef_server_url: new_resource.chef_server_url,
+ event_loggers: new_resource.event_loggers,
+ exception_handlers: format_handler(new_resource.exception_handlers),
+ file_backup_path: new_resource.file_backup_path,
+ file_cache_path: new_resource.file_cache_path,
+ file_staging_uses_destdir: new_resource.file_staging_uses_destdir,
+ formatters: new_resource.formatters,
+ http_proxy: new_resource.http_proxy,
+ https_proxy: new_resource.https_proxy,
+ ftp_proxy: new_resource.ftp_proxy,
+ log_level: new_resource.log_level,
+ log_location: new_resource.log_location,
+ minimal_ohai: new_resource.minimal_ohai,
+ named_run_list: new_resource.named_run_list,
+ no_proxy: new_resource.no_proxy,
+ node_name: new_resource.node_name,
+ ohai_disabled_plugins: new_resource.ohai_disabled_plugins,
+ ohai_optional_plugins: new_resource.ohai_optional_plugins,
+ pid_file: new_resource.pid_file,
+ policy_group: new_resource.policy_group,
+ policy_name: new_resource.policy_name,
+ report_handlers: format_handler(new_resource.report_handlers),
+ ssl_verify_mode: new_resource.ssl_verify_mode,
+ start_handlers: format_handler(new_resource.start_handlers),
+ additional_config: new_resource.additional_config
+ )
+ mode "0640"
+ action :create
+ end
+ end
+
+ action :remove do
+ file ::File.join(new_resource.config_directory, "client.rb") do
+ action :delete
+ end
+ end
+
+ action_class do
+ #
+ # Format the handler document in the way we want it presented in the client.rb file
+ #
+ # @param [Hash] a handler property
+ #
+ # @return [Array] Array of handler data
+ #
+ def format_handler(handler_property)
+ handler_data = []
+
+ handler_property.each do |handler|
+ handler_data << "#{handler["class"]}.new(#{handler["arguments"].join(",")})"
+ end
+
+ handler_data
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/resource/chef_client_cron.rb b/lib/chef/resource/chef_client_cron.rb
index ab435c39f8..003b28d7b3 100644
--- a/lib/chef/resource/chef_client_cron.rb
+++ b/lib/chef/resource/chef_client_cron.rb
@@ -15,7 +15,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require_relative "helpers/cron_validations"
require "digest/md5" unless defined?(Digest::MD5)
@@ -26,29 +26,29 @@ class Chef
provides :chef_client_cron
- description "Use the **chef_client_cron** resource to setup the #{Chef::Dist::PRODUCT} to run as a cron job. This resource will also create the specified log directory if it doesn't already exist."
+ description "Use the **chef_client_cron** resource to setup the #{ChefUtils::Dist::Infra::PRODUCT} to run as a cron job. This resource will also create the specified log directory if it doesn't already exist."
introduced "16.0"
examples <<~DOC
- **Setup #{Chef::Dist::PRODUCT} to run using the default 30 minute cadence**:
+ **Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
```ruby
- chef_client_cron "Run #{Chef::Dist::PRODUCT} as a cron job"
+ chef_client_cron 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a cron job'
```
- **Run #{Chef::Dist::PRODUCT} twice a day**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} twice a day**:
```ruby
- chef_client_cron "Run #{Chef::Dist::PRODUCT} every 12 hours" do
+ chef_client_cron 'Run #{ChefUtils::Dist::Infra::PRODUCT} every 12 hours' do
minute 0
- hour "0,12"
+ hour '0,12'
end
```
- **Run #{Chef::Dist::PRODUCT} with extra options passed to the client**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
```ruby
- chef_client_cron "Run an override recipe" do
- daemon_options ["--override-runlist mycorp_base::default"]
+ chef_client_cron 'Run an override recipe' do
+ daemon_options ['--override-runlist mycorp_base::default']
end
```
DOC
@@ -56,42 +56,42 @@ class Chef
extend Chef::ResourceHelpers::CronValidations
property :job_name, String,
- default: Chef::Dist::CLIENT,
+ default: ChefUtils::Dist::Infra::CLIENT,
description: "The name of the cron job to create."
property :comment, String,
description: "A comment to place in the cron.d file."
property :user, String,
- description: "The name of the user that #{Chef::Dist::PRODUCT} runs as.",
+ description: "The name of the user that #{ChefUtils::Dist::Infra::PRODUCT} runs as.",
default: "root"
property :minute, [Integer, String],
- description: "The minute at which #{Chef::Dist::PRODUCT} is to run (0 - 59) or a cron pattern such as '0,30'.",
+ description: "The minute at which #{ChefUtils::Dist::Infra::PRODUCT} is to run (0 - 59) or a cron pattern such as '0,30'.",
default: "0,30", callbacks: {
"should be a valid minute spec" => method(:validate_minute),
}
property :hour, [Integer, String],
- description: "The hour at which #{Chef::Dist::PRODUCT} is to run (0 - 23) or a cron pattern such as '0,12'.",
+ description: "The hour at which #{ChefUtils::Dist::Infra::PRODUCT} is to run (0 - 23) or a cron pattern such as '0,12'.",
default: "*", callbacks: {
"should be a valid hour spec" => method(:validate_hour),
}
property :day, [Integer, String],
- description: "The day of month at which #{Chef::Dist::PRODUCT} is to run (1 - 31) or a cron pattern such as '1,7,14,21,28'.",
+ description: "The day of month at which #{ChefUtils::Dist::Infra::PRODUCT} is to run (1 - 31) or a cron pattern such as '1,7,14,21,28'.",
default: "*", callbacks: {
"should be a valid day spec" => method(:validate_day),
}
property :month, [Integer, String],
- description: "The month in the year on which #{Chef::Dist::PRODUCT} is to run (1 - 12, jan-dec, or *).",
+ description: "The month in the year on which #{ChefUtils::Dist::Infra::PRODUCT} is to run (1 - 12, jan-dec, or *).",
default: "*", callbacks: {
"should be a valid month spec" => method(:validate_month),
}
property :weekday, [Integer, String],
- description: "The day of the week on which #{Chef::Dist::PRODUCT} is to run (0-7, mon-sun, or *), where Sunday is both 0 and 7.",
+ description: "The day of the week on which #{ChefUtils::Dist::Infra::PRODUCT} is to run (0-7, mon-sun, or *), where Sunday is both 0 and 7.",
default: "*", callbacks: {
"should be a valid weekday spec" => method(:validate_dow),
}
@@ -100,7 +100,7 @@ class Chef
default: 300,
coerce: proc { |x| Integer(x) },
callbacks: { "should be a positive number" => proc { |v| v > 0 } },
- description: "A random number of seconds between 0 and X to add to interval so that all #{Chef::Dist::CLIENT} commands don't execute at the same time."
+ description: "A random number of seconds between 0 and X to add to interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time."
property :mailto, String,
description: "The e-mail address to e-mail any cron task failures to."
@@ -110,12 +110,12 @@ class Chef
default: false
property :config_directory, String,
- default: Chef::Dist::CONF_DIR,
+ default: ChefConfig::Config.etc_chef_dir,
description: "The path of the config directory."
property :log_directory, String,
- default: lazy { platform?("mac_os_x") ? "/Library/Logs/#{Chef::Dist::DIR_SUFFIX.capitalize}" : "/var/log/#{Chef::Dist::DIR_SUFFIX}" },
- default_description: "/Library/Logs/#{Chef::Dist::DIR_SUFFIX.capitalize} on macOS and /var/log/#{Chef::Dist::DIR_SUFFIX} otherwise",
+ default: lazy { platform?("mac_os_x") ? "/Library/Logs/#{ChefUtils::Dist::Infra::DIR_SUFFIX.capitalize}" : "/var/log/#{ChefUtils::Dist::Infra::DIR_SUFFIX}" },
+ default_description: "/Library/Logs/#{ChefUtils::Dist::Infra::DIR_SUFFIX.capitalize} on macOS and /var/log/#{ChefUtils::Dist::Infra::DIR_SUFFIX} otherwise",
description: "The path of the directory to create the log file in."
property :log_file_name, String,
@@ -127,19 +127,19 @@ class Chef
description: "Append to the log file instead of overwriting the log file on each run."
property :chef_binary_path, String,
- default: "/opt/#{Chef::Dist::DIR_SUFFIX}/bin/#{Chef::Dist::CLIENT}",
- description: "The path to the #{Chef::Dist::CLIENT} binary."
+ default: "/opt/#{ChefUtils::Dist::Infra::DIR_SUFFIX}/bin/#{ChefUtils::Dist::Infra::CLIENT}",
+ description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary."
property :daemon_options, Array,
default: lazy { [] },
- description: "An array of options to pass to the #{Chef::Dist::CLIENT} command."
+ description: "An array of options to pass to the #{ChefUtils::Dist::Infra::CLIENT} command."
property :environment, Hash,
default: lazy { {} },
description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of `({'ENV_VARIABLE' => 'VALUE'})`."
property :nice, [Integer, String],
- description: "The process priority to run the #{Chef::Dist::CLIENT} process at. A value of -20 is the highest priority and 19 is the lowest priority.",
+ description: "The process priority to run the #{ChefUtils::Dist::Infra::CLIENT} process at. A value of -20 is the highest priority and 19 is the lowest priority.",
introduced: "16.5",
coerce: proc { |x| Integer(x) },
callbacks: { "should be an Integer between -20 and 19" => proc { |v| v >= -20 && v <= 19 } }
@@ -202,7 +202,7 @@ class Chef
cmd << "-c #{::File.join(new_resource.config_directory, "client.rb")} "
cmd << "--chef-license accept " if new_resource.accept_chef_license
cmd << log_command
- cmd << " || echo \"#{Chef::Dist::PRODUCT} execution failed\"" if new_resource.mailto
+ cmd << " || echo \"#{ChefUtils::Dist::Infra::PRODUCT} execution failed\"" if new_resource.mailto
cmd
end
diff --git a/lib/chef/resource/chef_client_launchd.rb b/lib/chef/resource/chef_client_launchd.rb
index a2b024c030..0e173050d0 100644
--- a/lib/chef/resource/chef_client_launchd.rb
+++ b/lib/chef/resource/chef_client_launchd.rb
@@ -15,7 +15,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
class ChefClientLaunchd < Chef::Resource
@@ -23,37 +23,37 @@ class Chef
provides :chef_client_launchd
- description "Use the **chef_client_launchd** resource to configure the #{Chef::Dist::PRODUCT} to run on a schedule."
+ description "Use the **chef_client_launchd** resource to configure the #{ChefUtils::Dist::Infra::PRODUCT} to run on a schedule."
introduced "16.5"
examples <<~DOC
- **Set the #{Chef::Dist::PRODUCT} to run on a schedule**:
+ **Set the #{ChefUtils::Dist::Infra::PRODUCT} to run on a schedule**:
```ruby
- chef_client_launchd 'Setup the #{Chef::Dist::PRODUCT} to run every 30 minutes' do
+ chef_client_launchd 'Setup the #{ChefUtils::Dist::Infra::PRODUCT} to run every 30 minutes' do
interval 30
action :enable
end
```
- **Disable the #{Chef::Dist::PRODUCT} running on a schedule**:
+ **Disable the #{ChefUtils::Dist::Infra::PRODUCT} running on a schedule**:
```ruby
- chef_client_launchd 'Prevent the #{Chef::Dist::PRODUCT} from running on a schedule' do
+ chef_client_launchd 'Prevent the #{ChefUtils::Dist::Infra::PRODUCT} from running on a schedule' do
action :disable
end
```
DOC
property :user, String,
- description: "The name of the user that #{Chef::Dist::PRODUCT} runs as.",
+ description: "The name of the user that #{ChefUtils::Dist::Infra::PRODUCT} runs as.",
default: "root"
property :working_directory, String,
- description: "The working directory to run the #{Chef::Dist::PRODUCT} from.",
+ description: "The working directory to run the #{ChefUtils::Dist::Infra::PRODUCT} from.",
default: "/var/root"
property :interval, [Integer, String],
- description: "Time in minutes between #{Chef::Dist::PRODUCT} executions.",
+ description: "Time in minutes between #{ChefUtils::Dist::Infra::PRODUCT} executions.",
coerce: proc { |x| Integer(x) },
callbacks: { "should be a positive number" => proc { |v| v > 0 } },
default: 30
@@ -62,7 +62,7 @@ class Chef
default: 300,
coerce: proc { |x| Integer(x) },
callbacks: { "should be a positive number" => proc { |v| v > 0 } },
- description: "A random number of seconds between 0 and X to add to interval so that all #{Chef::Dist::CLIENT} commands don't execute at the same time."
+ description: "A random number of seconds between 0 and X to add to interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time."
property :accept_chef_license, [true, false],
description: "Accept the Chef Online Master License and Services Agreement. See <https://www.chef.io/online-master-agreement/>",
@@ -70,7 +70,7 @@ class Chef
property :config_directory, String,
description: "The path of the config directory.",
- default: Chef::Dist::CONF_DIR
+ default: ChefConfig::Config.etc_chef_dir
property :log_directory, String,
description: "The path of the directory to create the log file in.",
@@ -81,11 +81,11 @@ class Chef
default: "client.log"
property :chef_binary_path, String,
- description: "The path to the #{Chef::Dist::CLIENT} binary.",
- default: "/opt/#{Chef::Dist::DIR_SUFFIX}/bin/#{Chef::Dist::CLIENT}"
+ description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary.",
+ default: "/opt/#{ChefUtils::Dist::Infra::DIR_SUFFIX}/bin/#{ChefUtils::Dist::Infra::CLIENT}"
property :daemon_options, Array,
- description: "An array of options to pass to the #{Chef::Dist::CLIENT} command.",
+ description: "An array of options to pass to the #{ChefUtils::Dist::Infra::CLIENT} command.",
default: lazy { [] }
property :environment, Hash,
@@ -93,12 +93,12 @@ class Chef
default: lazy { {} }
property :nice, [Integer, String],
- description: "The process priority to run the #{Chef::Dist::CLIENT} process at. A value of -20 is the highest priority and 19 is the lowest priority.",
+ description: "The process priority to run the #{ChefUtils::Dist::Infra::CLIENT} process at. A value of -20 is the highest priority and 19 is the lowest priority.",
coerce: proc { |x| Integer(x) },
callbacks: { "should be an Integer between -20 and 19" => proc { |v| v >= -20 && v <= 19 } }
property :low_priority_io, [true, false],
- description: "Run the #{Chef::Dist::CLIENT} process with low priority disk IO",
+ description: "Run the #{ChefUtils::Dist::Infra::CLIENT} process with low priority disk IO",
default: true
action :enable do
@@ -110,7 +110,7 @@ class Chef
end
end
- launchd "com.chef.chef-client" do
+ launchd "com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}" do
username new_resource.user
working_directory new_resource.working_directory
start_interval new_resource.interval * 60
@@ -118,13 +118,43 @@ class Chef
environment_variables new_resource.environment unless new_resource.environment.empty?
nice new_resource.nice
low_priority_io true
- action :enable
+ notifies :sleep, "chef_sleep[Sleep before client restart]", :immediately
+ action :create # create only creates the file. No service restart triggering
+ end
+
+ # Launchd doesn't have the concept of a reload aka restart. Instead to update a daemon config you have
+ # to unload it and then reload the new plist. That's usually fine, but not if chef-client is trying
+ # to restart itself. If the chef-client process uses launchd or macosx_service resources to restart itself
+ # we'll end up with a stopped service that will never get started back up. Instead we use this daemon
+ # that triggers when the chef-client plist file is updated, and handles the restart outside the run.
+ launchd "com.#{ChefUtils::Dist::Infra::SHORT}.restarter" do
+ username "root"
+ watch_paths ["/Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist"]
+ standard_out_path ::File.join(new_resource.log_directory, new_resource.log_file_name)
+ standard_error_path ::File.join(new_resource.log_directory, new_resource.log_file_name)
+ program_arguments ["/bin/bash",
+ "-c",
+ "echo; echo #{ChefUtils::Dist::Infra::PRODUCT} launchd daemon config has been updated. Manually unloading and reloading the daemon; echo Now unloading the daemon; launchctl unload /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist; sleep 2; echo Now loading the daemon; launchctl load /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist"]
+ action :enable # enable creates the plist & triggers service restarts on change
+ end
+
+ # We want to make sure that after we update the chef-client launchd config that we don't move on to another recipe
+ # before the restarter daemon can do its thing. This sleep avoids killing the client while it's doing something like
+ # installing a package, which could be problematic. It also makes it a bit more clear in the log that the killed process
+ # was intentional.
+ chef_sleep "Sleep before client restart" do
+ seconds 10
+ action :nothing
end
end
action :disable do
- service "chef-client" do
- service_name "com.chef.chef-client"
+ service ChefUtils::Dist::Infra::PRODUCT do
+ service_name "com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}"
+ action :disable
+ end
+
+ service "com.#{ChefUtils::Dist::Infra::SHORT}.restarter" do
action :disable
end
end
@@ -161,4 +191,4 @@ class Chef
end
end
end
-end \ No newline at end of file
+end
diff --git a/lib/chef/resource/chef_client_scheduled_task.rb b/lib/chef/resource/chef_client_scheduled_task.rb
index 7fde581763..25780afdf4 100644
--- a/lib/chef/resource/chef_client_scheduled_task.rb
+++ b/lib/chef/resource/chef_client_scheduled_task.rb
@@ -15,7 +15,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -24,35 +24,35 @@ class Chef
provides :chef_client_scheduled_task
- description "Use the **chef_client_scheduled_task** resource to setup the #{Chef::Dist::PRODUCT} to run as a Windows scheduled task. This resource will also create the specified log directory if it doesn't already exist."
+ description "Use the **chef_client_scheduled_task** resource to setup the #{ChefUtils::Dist::Infra::PRODUCT} to run as a Windows scheduled task. This resource will also create the specified log directory if it doesn't already exist."
introduced "16.0"
examples <<~DOC
- **Setup #{Chef::Dist::PRODUCT} to run using the default 30 minute cadence**:
+ **Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
```ruby
- chef_client_scheduled_task "Run #{Chef::Dist::PRODUCT} as a scheduled task"
+ chef_client_scheduled_task 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a scheduled task'
```
- **Run #{Chef::Dist::PRODUCT} on system start**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} on system start**:
```ruby
- chef_client_scheduled_task '#{Chef::Dist::PRODUCT} on start' do
+ chef_client_scheduled_task '#{ChefUtils::Dist::Infra::PRODUCT} on start' do
frequency 'onstart'
end
```
- **Run #{Chef::Dist::PRODUCT} with extra options passed to the client**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
```ruby
- chef_client_scheduled_task "Run an override recipe" do
- daemon_options ["--override-runlist mycorp_base::default"]
+ chef_client_scheduled_task 'Run an override recipe' do
+ daemon_options ['--override-runlist mycorp_base::default']
end
```
- **Run #{Chef::Dist::PRODUCT} daily at 01:00 am, specifying a named run-list**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} daily at 01:00 am, specifying a named run-list**:
```ruby
- chef_client_scheduled_task "Run chef-client named run-list daily" do
+ chef_client_scheduled_task 'Run chef-client named run-list daily' do
frequency 'daily'
start_time '01:00'
daemon_options ['-n audit_only']
@@ -64,14 +64,14 @@ class Chef
property :task_name, String,
description: "The name of the scheduled task to create.",
- default: Chef::Dist::CLIENT
+ default: ChefUtils::Dist::Infra::CLIENT
property :user, String,
- description: "The name of the user that #{Chef::Dist::PRODUCT} runs as.",
+ description: "The name of the user that #{ChefUtils::Dist::Infra::PRODUCT} runs as.",
default: "System", sensitive: true
property :password, String,
- description: "The password for the user that #{Chef::Dist::PRODUCT} runs as.",
+ description: "The password for the user that #{ChefUtils::Dist::Infra::PRODUCT} runs as.",
sensitive: true
property :frequency, String,
@@ -101,16 +101,16 @@ class Chef
property :splay, [Integer, String],
coerce: proc { |x| Integer(x) },
callbacks: { "should be a positive number" => proc { |v| v > 0 } },
- description: "A random number of seconds between 0 and X to add to interval so that all #{Chef::Dist::CLIENT} commands don't execute at the same time.",
+ description: "A random number of seconds between 0 and X to add to interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time.",
default: 300
property :run_on_battery, [true, false],
- description: "Run the #{Chef::Dist::PRODUCT} task when the system is on batteries.",
+ description: "Run the #{ChefUtils::Dist::Infra::PRODUCT} task when the system is on batteries.",
default: true
property :config_directory, String,
description: "The path of the config directory.",
- default: Chef::Dist::CONF_DIR
+ default: ChefConfig::Config.etc_chef_dir
property :log_directory, String,
description: "The path of the directory to create the log file in.",
@@ -122,11 +122,11 @@ class Chef
default: "client.log"
property :chef_binary_path, String,
- description: "The path to the #{Chef::Dist::CLIENT} binary.",
- default: "C:/#{Chef::Dist::LEGACY_CONF_DIR}/#{Chef::Dist::DIR_SUFFIX}/bin/#{Chef::Dist::CLIENT}"
+ description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary.",
+ default: "C:/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/#{ChefUtils::Dist::Infra::DIR_SUFFIX}/bin/#{ChefUtils::Dist::Infra::CLIENT}"
property :daemon_options, Array,
- description: "An array of options to pass to the #{Chef::Dist::CLIENT} command.",
+ description: "An array of options to pass to the #{ChefUtils::Dist::Infra::CLIENT} command.",
default: lazy { [] }
action :add do
diff --git a/lib/chef/resource/chef_client_systemd_timer.rb b/lib/chef/resource/chef_client_systemd_timer.rb
index fa59798009..e911fc2cb0 100644
--- a/lib/chef/resource/chef_client_systemd_timer.rb
+++ b/lib/chef/resource/chef_client_systemd_timer.rb
@@ -15,7 +15,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -24,42 +24,42 @@ class Chef
provides :chef_client_systemd_timer
- description "Use the **chef_client_systemd_timer** resource to setup the #{Chef::Dist::PRODUCT} to run as a systemd timer."
+ description "Use the **chef_client_systemd_timer** resource to setup the #{ChefUtils::Dist::Infra::PRODUCT} to run as a systemd timer."
introduced "16.0"
examples <<~DOC
- **Setup #{Chef::Dist::PRODUCT} to run using the default 30 minute cadence**:
+ **Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
```ruby
- chef_client_systemd_timer "Run #{Chef::Dist::PRODUCT} as a systemd timer"
+ chef_client_systemd_timer 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a systemd timer'
```
- **Run #{Chef::Dist::PRODUCT} every 1 hour**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} every 1 hour**:
```ruby
- chef_client_systemd_timer "Run #{Chef::Dist::PRODUCT} every 1 hour" do
- interval "1hr"
+ chef_client_systemd_timer 'Run #{ChefUtils::Dist::Infra::PRODUCT} every 1 hour' do
+ interval '1hr'
end
```
- **Run #{Chef::Dist::PRODUCT} with extra options passed to the client**:
+ **Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
```ruby
- chef_client_systemd_timer "Run an override recipe" do
- daemon_options ["--override-runlist mycorp_base::default"]
+ chef_client_systemd_timer 'Run an override recipe' do
+ daemon_options ['--override-runlist mycorp_base::default']
end
```
DOC
property :job_name, String,
description: "The name of the system timer to create.",
- default: Chef::Dist::CLIENT
+ default: ChefUtils::Dist::Infra::CLIENT
property :description, String,
description: "The description to add to the systemd timer. This will be displayed when running `systemctl status` for the timer.",
- default: "#{Chef::Dist::PRODUCT} periodic execution"
+ default: "#{ChefUtils::Dist::Infra::PRODUCT} periodic execution"
property :user, String,
- description: "The name of the user that #{Chef::Dist::PRODUCT} runs as.",
+ description: "The name of the user that #{ChefUtils::Dist::Infra::PRODUCT} runs as.",
default: "root"
property :delay_after_boot, String,
@@ -71,7 +71,7 @@ class Chef
default: "30min"
property :splay, String,
- description: "A interval between 0 and X to add to the interval so that all #{Chef::Dist::CLIENT} commands don't execute at the same time. This is expressed as a systemd time span such as `300seconds`, `1hr`, or `1m`. See <https://www.freedesktop.org/software/systemd/man/systemd.time.html> for a complete list of allowed time span values.",
+ description: "A interval between 0 and X to add to the interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time. This is expressed as a systemd time span such as `300seconds`, `1hr`, or `1m`. See <https://www.freedesktop.org/software/systemd/man/systemd.time.html> for a complete list of allowed time span values.",
default: "5min"
property :accept_chef_license, [true, false],
@@ -79,25 +79,31 @@ class Chef
default: false
property :run_on_battery, [true, false],
- description: "Run the timer for #{Chef::Dist::PRODUCT} if the system is on battery.",
+ description: "Run the timer for #{ChefUtils::Dist::Infra::PRODUCT} if the system is on battery.",
default: true
property :config_directory, String,
description: "The path of the config directory.",
- default: Chef::Dist::CONF_DIR
+ default: ChefConfig::Config.etc_chef_dir
property :chef_binary_path, String,
- description: "The path to the #{Chef::Dist::CLIENT} binary.",
- default: "/opt/#{Chef::Dist::DIR_SUFFIX}/bin/#{Chef::Dist::CLIENT}"
+ description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary.",
+ default: "/opt/#{ChefUtils::Dist::Infra::DIR_SUFFIX}/bin/#{ChefUtils::Dist::Infra::CLIENT}"
property :daemon_options, Array,
- description: "An array of options to pass to the #{Chef::Dist::CLIENT} command.",
+ description: "An array of options to pass to the #{ChefUtils::Dist::Infra::CLIENT} command.",
default: lazy { [] }
property :environment, Hash,
description: "A Hash containing additional arbitrary environment variables under which the systemd timer will be run in the form of `({'ENV_VARIABLE' => 'VALUE'})`.",
default: lazy { {} }
+ property :cpu_quota, [Integer, String],
+ description: "The systemd CPUQuota to run the #{ChefUtils::Dist::Infra::CLIENT} process with. This is a percentage value of the total CPU time available on the system. If the system has more than 1 core this may be a value greater than 100.",
+ introduced: "16.5",
+ coerce: proc { |x| Integer(x) },
+ callbacks: { "should be a positive Integer" => proc { |v| v > 0 } }
+
action :add do
systemd_unit "#{new_resource.job_name}.service" do
content service_content
@@ -127,7 +133,7 @@ class Chef
# @return [String]
#
def chef_client_cmd
- cmd = "#{new_resource.chef_binary_path}"
+ cmd = new_resource.chef_binary_path.dup
cmd << " #{new_resource.daemon_options.join(" ")}" unless new_resource.daemon_options.empty?
cmd << " --chef-license accept" if new_resource.accept_chef_license
cmd << " -c #{::File.join(new_resource.config_directory, "client.rb")}"
@@ -171,6 +177,7 @@ class Chef
}
unit["Service"]["ConditionACPower"] = "true" unless new_resource.run_on_battery
+ unit["Service"]["CPUQuota"] = new_resource.cpu_quota if new_resource.cpu_quota
unit["Service"]["Environment"] = new_resource.environment.collect { |k, v| "\"#{k}=#{v}\"" } unless new_resource.environment.empty?
unit
end
diff --git a/lib/chef/resource/chef_client_trusted_certificate.rb b/lib/chef/resource/chef_client_trusted_certificate.rb
index 855407b12a..b5272fbe01 100644
--- a/lib/chef/resource/chef_client_trusted_certificate.rb
+++ b/lib/chef/resource/chef_client_trusted_certificate.rb
@@ -15,7 +15,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -24,7 +24,7 @@ class Chef
provides :chef_client_trusted_certificate
- description "Use the **chef_client_trusted_certificate** resource to add certificates to #{Chef::Dist::PRODUCT}'s trusted certificate directory. This allows the #{Chef::Dist::PRODUCT} to communicate with internal encrypted resources without errors."
+ description "Use the **chef_client_trusted_certificate** resource to add certificates to #{ChefUtils::Dist::Infra::PRODUCT}'s trusted certificate directory. This allows the #{ChefUtils::Dist::Infra::PRODUCT} to communicate with internal encrypted resources without errors."
introduced "16.5"
examples <<~DOC
**Trust a self signed certificate**:
@@ -98,4 +98,4 @@ class Chef
end
end
end
-end \ No newline at end of file
+end
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index b44f9e1771..2c5b342bce 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -18,7 +18,7 @@
require_relative "package"
require_relative "gem_package"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -27,29 +27,29 @@ class Chef
provides :chef_gem
description <<~DESC
- Use the **chef_gem** resource to install a gem only for the instance of Ruby that is dedicated to the #{Chef::Dist::CLIENT}.
+ Use the **chef_gem** resource to install a gem only for the instance of Ruby that is dedicated to the #{ChefUtils::Dist::Infra::CLIENT}.
When a gem is installed from a local file, it must be added to the node using the **remote_file** or **cookbook_file** resources.
The **chef_gem** resource works with all of the same properties and options as the **gem_package** resource, but does not
- accept the `gem_binary` property because it always uses the `CurrentGemEnvironment` under which the `#{Chef::Dist::CLIENT}` is
+ accept the `gem_binary` property because it always uses the `CurrentGemEnvironment` under which the `#{ChefUtils::Dist::Infra::CLIENT}` is
running. In addition to performing actions similar to the **gem_package** resource, the **chef_gem** resource does the
following:
- Runs its actions immediately, before convergence, allowing a gem to be used in a recipe immediately after it is installed.
- Runs `Gem.clear_paths` after the action, ensuring that gem is aware of changes so that it can be required immediately after it is installed.
- Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{Chef::Dist::PRODUCT} is
+ Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{ChefUtils::Dist::Infra::PRODUCT} is
installed, there are two instances of Ruby. One is the standard, system-wide instance of Ruby and the other is a dedicated instance that is
- available only to #{Chef::Dist::PRODUCT}.
- Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{Chef::Dist::PRODUCT}.
+ available only to #{ChefUtils::Dist::Infra::PRODUCT}.
+ Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{ChefUtils::Dist::Infra::PRODUCT}.
Use the **gem_package** resource to install all other gems (i.e. install gems system-wide).
DESC
examples <<~EXAMPLES
**Compile time vs. converge time installation of gems**
- To install a gem while #{Chef::Dist::PRODUCT} is configuring the node (the converge phase), set the `compile_time` property to `false`:
+ To install a gem while #{ChefUtils::Dist::Infra::PRODUCT} is configuring the node (the converge phase), set the `compile_time` property to `false`:
```ruby
- chef_gem 'right_aws' do
+ chef_gem 'loofah' do
compile_time false
action :install
end
@@ -57,13 +57,13 @@ class Chef
To install a gem while the resource collection is being built (the compile phase), set the `compile_time` property to `true`:
```ruby
- chef_gem 'right_aws' do
+ chef_gem 'loofah' do
compile_time true
action :install
end
```
- Install MySQL for Chef
+ **Install MySQL gem into #{ChefUtils::Dist::Infra::PRODUCT}***
```ruby
apt_update
@@ -84,8 +84,8 @@ class Chef
property :gem_binary, String,
default: "#{RbConfig::CONFIG["bindir"]}/gem",
- default_description: "The `gem` binary included with #{Chef::Dist::PRODUCT}.",
- description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by #{Chef::Dist::PRODUCT} will be used.",
+ default_description: "The `gem` binary included with #{ChefUtils::Dist::Infra::PRODUCT}.",
+ description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by #{ChefUtils::Dist::Infra::PRODUCT} will be used.",
callbacks: {
"The `chef_gem` resource is restricted to the current gem environment, use `gem_package` to install to other environments." =>
proc { |v| v == "#{RbConfig::CONFIG["bindir"]}/gem" },
diff --git a/lib/chef/resource/chef_handler.rb b/lib/chef/resource/chef_handler.rb
index f2daab3d6e..a006b2648a 100644
--- a/lib/chef/resource/chef_handler.rb
+++ b/lib/chef/resource/chef_handler.rb
@@ -16,7 +16,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -25,8 +25,153 @@ class Chef
provides(:chef_handler) { true }
- description "Use the **chef_handler** resource to install or uninstall reporting/exception handlers."
+ description "Use the **chef_handler** resource to enable handlers during a #{ChefUtils::Dist::Infra::PRODUCT} run. The resource allows arguments to be passed to #{ChefUtils::Dist::Infra::PRODUCT}, which then applies the conditions defined by the custom handler to the node attribute data collected during a #{ChefUtils::Dist::Infra::PRODUCT} run, and then processes the handler based on that data.\nThe **chef_handler** resource is typically defined early in a node's run-list (often being the first item). This ensures that all of the handlers will be available for the entire #{ChefUtils::Dist::Infra::PRODUCT} run."
introduced "14.0"
+ examples <<~'DOC'
+ **Enable the 'MyHandler' handler**
+
+ The following example shows how to enable a fictional 'MyHandler' handler which is located on disk at `/etc/chef/my_handler.rb`. The handler will be configured to run with Chef Infra Client and will be passed values to the handler's initializer method:
+
+ ```ruby
+ chef_handler 'MyHandler' do
+ source '/etc/chef/my_handler.rb' # the file should already be at this path
+ arguments path: '/var/chef/reports'
+ action :enable
+ end
+ ```
+
+ **Enable handlers during the compile phase**
+
+ ```ruby
+ chef_handler 'Chef::Handler::JsonFile' do
+ source 'chef/handler/json_file'
+ arguments path: '/var/chef/reports'
+ action :enable
+ compile_time true
+ end
+ ```
+
+ **Handle only exceptions**
+
+ ```ruby
+ chef_handler 'Chef::Handler::JsonFile' do
+ source 'chef/handler/json_file'
+ arguments path: '/var/chef/reports'
+ type exception: true
+ action :enable
+ end
+ ```
+
+ **Cookbook Versions (a custom handler)**
+
+ [@juliandunn](https://github.com/juliandunn) created a custom report handler that logs all of the cookbooks and cookbook versions that were used during a Chef Infra Client run, and then reports after the run is complete.
+
+ cookbook_versions.rb:
+
+ The following custom handler defines how cookbooks and cookbook versions that are used during a Chef Infra Client run will be compiled into a report using the `Chef::Log` class in Chef Infra Client:
+
+ ```ruby
+ require 'chef/log'
+
+ module Chef
+ class CookbookVersionsHandler < Chef::Handler
+ def report
+ cookbooks = run_context.cookbook_collection
+ Chef::Log.info('Cookbooks and versions run: #{cookbooks.map {|x| x.name.to_s + ' ' + x.version }}')
+ end
+ end
+ end
+ ```
+
+ default.rb:
+
+ The following recipe is added to the run-list for every node on which a list of cookbooks and versions will be generated as report output after every Chef Infra Client run.
+
+ ```ruby
+ cookbook_file '/etc/chef/cookbook_versions.rb' do
+ source 'cookbook_versions.rb'
+ action :create
+ end
+
+ chef_handler 'Chef::CookbookVersionsHandler' do
+ source '/etc/chef/cookbook_versions.rb'
+ type report: true
+ action :enable
+ end
+ ```
+
+ This recipe will generate report output similar to the following:
+
+ ```
+ [2013-11-26T03:11:06+00:00] INFO: Chef Infra Client Run complete in 0.300029878 seconds
+ [2013-11-26T03:11:06+00:00] INFO: Running report handlers
+ [2013-11-26T03:11:06+00:00] INFO: Cookbooks and versions run: ["cookbook_versions_handler 1.0.0"]
+ [2013-11-26T03:11:06+00:00] INFO: Report handlers complete
+ ```
+
+ **JsonFile Handler**
+
+ The JsonFile handler is available from the `chef_handler` cookbook and can be used with exceptions and reports. It serializes run status data to a JSON file. This handler may be enabled in one of the following ways.
+
+ By adding the following lines of Ruby code to either the client.rb file or the solo.rb file, depending on how Chef Infra Client is being run:
+
+ ```ruby
+ require 'chef/handler/json_file'
+ report_handlers << Chef::Handler::JsonFile.new(path: '/var/chef/reports')
+ exception_handlers << Chef::Handler::JsonFile.new(path: '/var/chef/reports')
+ ```
+
+ By using the `chef_handler` resource in a recipe, similar to the following:
+
+ ```ruby
+ chef_handler 'Chef::Handler::JsonFile' do
+ source 'chef/handler/json_file'
+ arguments path: '/var/chef/reports'
+ action :enable
+ end
+ ```
+
+ After it has run, the run status data can be loaded and inspected via Interactive Ruby (IRb):
+
+ ```
+ irb(main):002:0> require 'json' => true
+ irb(main):003:0> require 'chef' => true
+ irb(main):004:0> r = JSON.parse(IO.read('/var/chef/reports/chef-run-report-20110322060731.json')) => ... output truncated
+ irb(main):005:0> r.keys => ['end_time', 'node', 'updated_resources', 'exception', 'all_resources', 'success', 'elapsed_time', 'start_time', 'backtrace']
+ irb(main):006:0> r['elapsed_time'] => 0.00246
+ ```
+
+ Register the JsonFile handler
+
+ ```ruby
+ chef_handler 'Chef::Handler::JsonFile' do
+ source 'chef/handler/json_file'
+ arguments path: '/var/chef/reports'
+ action :enable
+ end
+ ```
+
+ **ErrorReport Handler**
+
+ The ErrorReport handler is built into Chef Infra Client and can be used for both exceptions and reports. It serializes error report data to a JSON file. This handler may be enabled in one of the following ways.
+
+ By adding the following lines of Ruby code to either the client.rb file or the solo.rb file, depending on how Chef Infra Client is being run:
+
+ ```ruby
+ require 'chef/handler/error_report'
+ report_handlers << Chef::Handler::ErrorReport.new
+ exception_handlers << Chef::Handler::ErrorReport.new
+ ```
+
+ By using the `chef_handler` resource in a recipe, similar to the following:
+
+ ```ruby
+ chef_handler 'Chef::Handler::ErrorReport' do
+ source 'chef/handler/error_report'
+ action :enable
+ end
+ ```
+ DOC
property :class_name, String,
description: "The name of the handler class. This can be module name-spaced.",
@@ -50,7 +195,7 @@ class Chef
# This action needs to find an rb file that presumably contains the indicated class in it and the
# load that file. It then instantiates that class by name and registers it as a handler.
action :enable do
- description "Enables the handler for the current #{Chef::Dist::PRODUCT} run on the current node"
+ description "Enables the handler for the current #{ChefUtils::Dist::Infra::PRODUCT} run on the current node"
class_name = new_resource.class_name
new_resource.type.each do |type, enable|
@@ -74,7 +219,7 @@ class Chef
end
action :disable do
- description "Disables the handler for the current #{Chef::Dist::PRODUCT} run on the current node"
+ description "Disables the handler for the current #{ChefUtils::Dist::Infra::PRODUCT} run on the current node"
new_resource.type.each_key do |type|
unregister_handler(type, new_resource.class_name)
diff --git a/lib/chef/resource/chef_sleep.rb b/lib/chef/resource/chef_sleep.rb
index 828ce07bc9..c6d3e45877 100644
--- a/lib/chef/resource/chef_sleep.rb
+++ b/lib/chef/resource/chef_sleep.rb
@@ -15,7 +15,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -24,7 +24,7 @@ class Chef
unified_mode true
- description "Use the **chef_sleep** resource to pause (sleep) for a number of seconds during a #{Chef::Dist::PRODUCT} run. Only use this resource when a command or service exits successfully but is not ready for the next step in a recipe."
+ description "Use the **chef_sleep** resource to pause (sleep) for a number of seconds during a #{ChefUtils::Dist::Infra::PRODUCT} run. Only use this resource when a command or service exits successfully but is not ready for the next step in a recipe."
introduced "15.5"
examples <<~DOC
**Sleep for 10 seconds**:
@@ -39,7 +39,7 @@ class Chef
chef_sleep 'wait for the service to start' do
seconds 10
end
- ````
+ ```
**Use a notification from another resource to sleep only when necessary**:
diff --git a/lib/chef/resource/chef_vault_secret.rb b/lib/chef/resource/chef_vault_secret.rb
index d8a2e89ffe..1c8fa985f9 100644
--- a/lib/chef/resource/chef_vault_secret.rb
+++ b/lib/chef/resource/chef_vault_secret.rb
@@ -16,7 +16,7 @@
#
require_relative "../resource"
-require "chef-vault"
+autoload :ChefVault, "chef-vault"
class Chef
class Resource
diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb
index 5981aab194..f1ae195426 100644
--- a/lib/chef/resource/cookbook_file.rb
+++ b/lib/chef/resource/cookbook_file.rb
@@ -21,7 +21,7 @@
require_relative "file"
require_relative "../provider/cookbook_file"
require_relative "../mixin/securable"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -31,7 +31,7 @@ class Chef
provides :cookbook_file
- description "Use the **cookbook_file** resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path located on a host that is running the #{Chef::Dist::PRODUCT}. The file is selected according to file specificity, which allows different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate), or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any platform.\n\nDuring a #{Chef::Dist::PRODUCT} run, the checksum for each local file is calculated and then compared against the checksum for the same file as it currently exists in the cookbook on the #{Chef::Dist::SERVER_PRODUCT}. A file is not transferred when the checksums match. Only files that require an update are transferred from the #{Chef::Dist::SERVER_PRODUCT} to a node."
+ description "Use the **cookbook_file** resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path located on a host that is running the #{ChefUtils::Dist::Infra::PRODUCT}. The file is selected according to file specificity, which allows different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate), or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any platform.\n\nDuring a #{ChefUtils::Dist::Infra::PRODUCT} run, the checksum for each local file is calculated and then compared against the checksum for the same file as it currently exists in the cookbook on the #{ChefUtils::Dist::Server::PRODUCT}. A file is not transferred when the checksums match. Only files that require an update are transferred from the #{ChefUtils::Dist::Server::PRODUCT} to a node."
property :source, [ String, Array ],
description: "The name of the file in COOKBOOK_NAME/files/default or the path to a file located in COOKBOOK_NAME/files. The path must include the file name and its extension. This can be used to distribute specific files depending upon the platform used.",
diff --git a/lib/chef/resource/cron/_cron_shared.rb b/lib/chef/resource/cron/_cron_shared.rb
index 2f6a116a05..6d11035862 100644
--- a/lib/chef/resource/cron/_cron_shared.rb
+++ b/lib/chef/resource/cron/_cron_shared.rb
@@ -89,6 +89,7 @@ property :time_out, Hash,
}
private
+
# Convert weekday input value into crontab format that
# could be written in the crontab
# @return [Integer, String] A weekday formed as per the user inputs.
diff --git a/lib/chef/resource/cron/cron_d.rb b/lib/chef/resource/cron/cron_d.rb
index 882544a8bc..6262ef453a 100644
--- a/lib/chef/resource/cron/cron_d.rb
+++ b/lib/chef/resource/cron/cron_d.rb
@@ -18,7 +18,6 @@
require_relative "../../resource"
require_relative "../helpers/cron_validations"
require "shellwords" unless defined?(Shellwords)
-require_relative "../../dist"
class Chef
class Resource
@@ -63,7 +62,7 @@ class Chef
hour '8'
weekday '6'
mailto 'admin@example.com'
- command "/bin/true"
+ command '/bin/true'
action :create
end
```
@@ -77,7 +76,7 @@ class Chef
day '*'
month '11'
weekday '1-5'
- command "/bin/true"
+ command '/bin/true'
action :create
end
```
diff --git a/lib/chef/resource/csh.rb b/lib/chef/resource/csh.rb
index 6bfb4ddf8e..6f0c37d01e 100644
--- a/lib/chef/resource/csh.rb
+++ b/lib/chef/resource/csh.rb
@@ -27,9 +27,9 @@ class Chef
description "Use the **csh** resource to execute scripts using the csh interpreter."\
" This resource may also use any of the actions and properties that are"\
- " available to the execute resource. Commands that are executed with this"\
+ " available to the **execute** resource. Commands that are executed with this"\
" resource are (by their nature) not idempotent, as they are typically"\
- " unique to the environment in which they are run. Use not_if and only_if"\
+ " unique to the environment in which they are run. Use `not_if` and `only_if`"\
" to guard this resource for idempotence."
def initialize(name, run_context = nil)
diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb
index b2401c797d..80727de7d0 100644
--- a/lib/chef/resource/dnf_package.rb
+++ b/lib/chef/resource/dnf_package.rb
@@ -18,7 +18,7 @@
require_relative "package"
require_relative "../mixin/which"
require_relative "../mixin/shell_out"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -52,7 +52,7 @@ class Chef
# Flush the in-memory available/installed cache, this does not flush the dnf caches on disk
property :flush_cache, Hash,
- description: "Flush the in-memory cache before or after a DNF operation that installs, upgrades, or removes a package. DNF automatically synchronizes remote metadata to a local cache. The #{Chef::Dist::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{Chef::Dist::CLIENT} run. The in-memory cache allows packages to be installed during the #{Chef::Dist::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{Chef::Dist::CLIENT} run is in-progress.",
+ description: "Flush the in-memory cache before or after a DNF operation that installs, upgrades, or removes a package. DNF automatically synchronizes remote metadata to a local cache. The #{ChefUtils::Dist::Infra::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{ChefUtils::Dist::Infra::CLIENT} run. The in-memory cache allows packages to be installed during the #{ChefUtils::Dist::Infra::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{ChefUtils::Dist::Infra::CLIENT} run is in-progress.",
default: { before: false, after: false },
coerce: proc { |v|
if v.is_a?(Hash)
diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb
index 76d0b37b37..679deef47b 100644
--- a/lib/chef/resource/dsc_resource.rb
+++ b/lib/chef/resource/dsc_resource.rb
@@ -16,7 +16,6 @@
# limitations under the License.
#
require_relative "../dsl/powershell"
-require_relative "../dist"
class Chef
class Resource
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index 2a4392630b..3a14da15f0 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -19,7 +19,7 @@
require_relative "../resource"
require_relative "../exceptions"
require_relative "../dsl/powershell"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -29,7 +29,14 @@ class Chef
unified_mode true
provides :dsc_script
- description "Many DSC resources are comparable to built-in #{Chef::Dist::PRODUCT} resources. For example, both DSC and #{Chef::Dist::PRODUCT} have file, package, and service resources. The dsc_script resource is most useful for those DSC resources that do not have a direct comparison to a resource in #{Chef::Dist::PRODUCT}, such as the Archive resource, a custom DSC resource, an existing DSC script that performs an important task, and so on. Use the dsc_script resource to embed the code that defines a DSC configuration directly within a #{Chef::Dist::PRODUCT} recipe."
+ description <<~DESC
+ Many DSC resources are comparable to built-in #{ChefUtils::Dist::Infra::PRODUCT} resources. For example, both DSC and #{ChefUtils::Dist::Infra::PRODUCT}
+ have file, package, and service resources. The dsc_script resource is most useful for those DSC resources that do not have a direct comparison to a
+ resource in #{ChefUtils::Dist::Infra::PRODUCT}, such as the Archive resource, a custom DSC resource, an existing DSC script that performs an important
+ task, and so on. Use the dsc_script resource to embed the code that defines a DSC configuration directly within a #{ChefUtils::Dist::Infra::PRODUCT} recipe.
+
+ Warning: The **dsc_script** resource may not be used with the 32 bit Chef Infra client. It must be executed from a 64 bit Chef Infra client.
+ DESC
default_action :run
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index e8d74fa178..5a78160642 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -18,7 +18,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -27,7 +27,7 @@ class Chef
provides :execute, target_mode: true
- description "Use the **execute** resource to execute a single command. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence. Note: Use the **script** resource to execute a script using a specific interpreter (Ruby, Python, Perl, csh, or Bash)."
+ description "Use the **execute** resource to execute a single command. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` to guard this resource for idempotence. Note: Use the **script** resource to execute a script using a specific interpreter (Ruby, Python, Perl, csh, or Bash)."
examples <<~EXAMPLES
**Run a command upon notification**:
@@ -533,7 +533,7 @@ class Chef
description: "The group name or group ID that must be changed before running a command."
property :live_stream, [ TrueClass, FalseClass ], default: false,
- description: "Send the output of the command run by this execute resource block to the #{Chef::Dist::PRODUCT} event stream."
+ description: "Send the output of the command run by this execute resource block to the #{ChefUtils::Dist::Infra::PRODUCT} event stream."
# default_env defaults to `false` so that the command execution more exactly matches what the user gets on the command line without magic
property :default_env, [ TrueClass, FalseClass ], desired_state: false, default: false,
@@ -549,11 +549,11 @@ class Chef
desired_state: false
property :user, [ String, Integer ],
- description: "The user name of the user identity with which to launch the new process. The user name may optionally be specified with a domain, i.e. domainuser or user@my.dns.domain.com via Universal Principal Name (UPN)format. It can also be specified without a domain simply as user if the domain is instead specified using the domain property. On Windows only, if this property is specified, the password property must be specified."
+ description: "The user name of the user identity with which to launch the new process. The user name may optionally be specified with a domain, i.e. `domainuser` or `user@my.dns.domain.com` via Universal Principal Name (UPN)format. It can also be specified without a domain simply as user if the domain is instead specified using the domain property. On Windows only, if this property is specified, the password property must be specified."
property :domain, String,
introduced: "12.21",
- description: "Windows only: The domain of the user user specified by the user property. If not specified, the user name and password specified by the user and password properties will be used to resolve that user against the domain in which the system running #{Chef::Dist::PRODUCT} is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property."
+ description: "Windows only: The domain of the user user specified by the user property. If not specified, the username and password specified by the `user` and `password` properties will be used to resolve that user against the domain in which the system running #{ChefUtils::Dist::Infra::PRODUCT} is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property."
property :password, String, sensitive: true,
introduced: "12.21",
@@ -561,11 +561,11 @@ class Chef
# lazy used to set default value of sensitive to true if password is set
property :sensitive, [ TrueClass, FalseClass ],
- description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::PRODUCT}.",
+ description: "Ensure that sensitive resource data is not logged by the #{ChefUtils::Dist::Infra::PRODUCT}.",
default: lazy { password ? true : false }, default_description: "True if the password property is set. False otherwise."
property :elevated, [ TrueClass, FalseClass ], default: false,
- description: "Determines whether the script will run with elevated permissions to circumvent User Access Control (UAC) interactively blocking the process.\nThis will cause the process to be run under a batch login instead of an interactive login. The user running #{Chef::Dist::CLIENT} needs the 'Replace a process level token' and 'Adjust Memory Quotas for a process' permissions. The user that is running the command needs the 'Log on as a batch job' permission.\nBecause this requires a login, the user and password properties are required.",
+ description: "Determines whether the script will run with elevated permissions to circumvent User Access Control (UAC) from interactively blocking the process.\nThis will cause the process to be run under a batch login instead of an interactive login. The user running #{ChefUtils::Dist::Infra::CLIENT} needs the 'Replace a process level token' and 'Adjust Memory Quotas for a process' permissions. The user that is running the command needs the 'Log on as a batch job' permission.\nBecause this requires a login, the user and password properties are required.",
introduced: "13.3"
property :input, [String],
@@ -587,7 +587,7 @@ class Chef
ancestor_attributes = superclass.guard_inherited_attributes
end
- ancestor_attributes.concat(@class_inherited_attributes ? @class_inherited_attributes : []).uniq
+ ancestor_attributes.concat(@class_inherited_attributes || []).uniq
end
# post resource creation validation
@@ -661,8 +661,10 @@ class Chef
set_guard_inherited_attributes(
:cwd,
+ :domain,
:environment,
:group,
+ :password,
:user,
:umask
)
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index eacddd02af..b2bba06185 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -22,7 +22,7 @@ require_relative "../platform/query_helpers"
require_relative "../mixin/securable"
require_relative "file/verification"
require "pathname" unless defined?(Pathname)
-require_relative "../dist"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
class Chef
class Resource
@@ -32,7 +32,7 @@ class Chef
provides :file
- description "Use the **file** resource to manage files directly on a node."
+ description "Use the **file** resource to manage files directly on a node. Note: Use the **cookbook_file** resource to copy a file from a cookbook's `/files` directory. Use the **template** resource to create a file based on a template in a cookbook's `/templates` directory. And use the **remote_file** resource to transfer a file to a node from a remote location."
if ChefUtils.windows?
# Use Windows rights instead of standard *nix permissions
@@ -56,7 +56,7 @@ class Chef
allowed_actions :create, :delete, :touch, :create_if_missing
property :path, String, name_property: true,
- description: "The full path to the file, including the file name and its extension. For example: /files/file.txt. Default value: the name of the resource block. Microsoft Windows: A path that begins with a forward slash (/) will point to the root of the current working directory of the #{Chef::Dist::CLIENT} process. This path can vary from system to system. Therefore, using a path that begins with a forward slash (/) is not recommended."
+ description: "The full path to the file, including the file name and its extension. For example: /files/file.txt. Default value: the name of the resource block. Microsoft Windows: A path that begins with a forward slash `/` will point to the root of the current working directory of the #{ChefUtils::Dist::Infra::PRODUCT} process. This path can vary from system to system. Therefore, using a path that begins with a forward slash `/` is not recommended."
property :atomic_update, [ TrueClass, FalseClass ], desired_state: false, default: lazy { docker? && special_docker_files?(path) ? false : Chef::Config[:file_atomic_update] },
default_description: "False if modifying /etc/hosts, /etc/hostname, or /etc/resolv.conf within Docker containers. Otherwise default to the client.rb 'file_atomic_update' config value.",
@@ -76,10 +76,10 @@ class Chef
property :diff, [ String, nil ], desired_state: false, skip_docs: true
property :force_unlink, [ TrueClass, FalseClass ], desired_state: false, default: false,
- description: "How #{Chef::Dist::PRODUCT} handles certain situations when the target file turns out not to be a file. For example, when a target file is actually a symlink. Set to `true` for #{Chef::Dist::PRODUCT} to delete the non-file target and replace it with the specified file. Set to `false` for #{Chef::Dist::PRODUCT} to raise an error."
+ description: "How #{ChefUtils::Dist::Infra::PRODUCT} handles certain situations when the target file turns out not to be a file. For example, when a target file is actually a symlink. Set to `true` for #{ChefUtils::Dist::Infra::PRODUCT} to delete the non-file target and replace it with the specified file. Set to `false` for #{ChefUtils::Dist::Infra::PRODUCT} to raise an error."
property :manage_symlink_source, [ TrueClass, FalseClass ], desired_state: false,
- description: "Change the behavior of the file resource if it is pointed at a symlink. When this value is set to true, #{Chef::Dist::PRODUCT} will manage the symlink's permissions or will replace the symlink with a normal file if the resource has content. When this value is set to false, #{Chef::Dist::PRODUCT} will follow the symlink and will manage the permissions and content of symlink's target file. The default behavior is true but emits a warning that the default value will be changed to false in a future version; setting this explicitly to true or false suppresses this warning."
+ description: "Change the behavior of the file resource if it is pointed at a symlink. When this value is set to true, #{ChefUtils::Dist::Infra::PRODUCT} will manage the symlink's permissions or will replace the symlink with a normal file if the resource has content. When this value is set to false, #{ChefUtils::Dist::Infra::PRODUCT} will follow the symlink and will manage the permissions and content of symlink's target file. The default behavior is true but emits a warning that the default value will be changed to false in a future version; setting this explicitly to true or false suppresses this warning."
property :verifications, Array, default: lazy { [] }
diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb
index 05f8611233..a3ad5f614b 100644
--- a/lib/chef/resource/gem_package.rb
+++ b/lib/chef/resource/gem_package.rb
@@ -17,7 +17,7 @@
#
require_relative "package"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -31,10 +31,10 @@ class Chef
Note: The **gem_package** resource must be specified as `gem_package` and cannot be shortened to `package` in a recipe.
- Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{Chef::Dist::PRODUCT} is
+ Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{ChefUtils::Dist::Infra::PRODUCT} is
installed, there are two instances of Ruby. One is the standard, system-wide instance of Ruby and the other is a dedicated instance that is
- available only to #{Chef::Dist::PRODUCT}.
- Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{Chef::Dist::PRODUCT}.
+ available only to #{ChefUtils::Dist::Infra::PRODUCT}.
+ Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{ChefUtils::Dist::Infra::PRODUCT}.
Use the **gem_package** resource to install all other gems (i.e. install gems system-wide).
DESC
@@ -44,8 +44,8 @@ class Chef
**Install a gem file from the local file system**
```ruby
- gem_package 'right_aws' do
- source '/tmp/right_aws-1.11.0.gem'
+ gem_package 'loofah' do
+ source '/tmp/loofah-2.7.0.gem'
action :install
end
```
@@ -86,7 +86,7 @@ class Chef
default: lazy { Chef::Config[:clear_gem_sources] }, desired_state: false
property :gem_binary, String, desired_state: false,
- description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by #{Chef::Dist::PRODUCT} will be used."
+ description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by #{ChefUtils::Dist::Infra::PRODUCT} will be used."
property :include_default_source, [ TrueClass, FalseClass, nil ],
description: "Set to `false` to not include `Chef::Config[:rubygems_url]` in the sources.",
diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb
index fef0561e38..3874622005 100644
--- a/lib/chef/resource/homebrew_package.rb
+++ b/lib/chef/resource/homebrew_package.rb
@@ -19,7 +19,7 @@
require_relative "../provider/package"
require_relative "package"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -29,7 +29,7 @@ class Chef
provides :homebrew_package
provides :package, os: "darwin"
- description "Use the **homebrew_package** resource to manage packages for the macOS platform. Note: Starting with #{Chef::Dist::PRODUCT} 16 the homebrew resource now accepts an array of packages for installing multiple packages at once."
+ description "Use the **homebrew_package** resource to manage packages for the macOS platform. Note: Starting with #{ChefUtils::Dist::Infra::PRODUCT} 16 the homebrew resource now accepts an array of packages for installing multiple packages at once."
introduced "12.0"
examples <<~DOC
**Install a package**:
@@ -62,7 +62,7 @@ class Chef
DOC
property :homebrew_user, [ String, Integer ],
- description: "The name or uid of the Homebrew owner to be used by #{Chef::Dist::PRODUCT} when executing a command."
+ description: "The name or uid of the Homebrew owner to be used by #{ChefUtils::Dist::Infra::PRODUCT} when executing a command."
end
end
diff --git a/lib/chef/resource/homebrew_update.rb b/lib/chef/resource/homebrew_update.rb
index 2bf1f8023f..27b352bfb6 100644
--- a/lib/chef/resource/homebrew_update.rb
+++ b/lib/chef/resource/homebrew_update.rb
@@ -19,11 +19,14 @@
#
require_relative "../resource"
-require_relative "../dist"
+require_relative "../mixin/homebrew_user"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
class HomebrewUpdate < Chef::Resource
+ include Chef::Mixin::HomebrewUser
+
unified_mode true
provides(:homebrew_update) { true }
@@ -38,7 +41,7 @@ class Chef
action :periodic
end
```
- **Update the Homebrew repository at the start of a #{Chef::Dist::PRODUCT} run**:
+ **Update the Homebrew repository at the start of a #{ChefUtils::Dist::Infra::PRODUCT} run**:
```ruby
homebrew_update 'update'
```
@@ -62,8 +65,8 @@ class Chef
#
# @return [Boolean]
def brew_up_to_date?
- ::File.exist?("#{BREW_STAMP}") &&
- ::File.mtime("#{BREW_STAMP}") > Time.now - new_resource.frequency
+ ::File.exist?(BREW_STAMP) &&
+ ::File.mtime(BREW_STAMP) > Time.now - new_resource.frequency
end
def do_update
@@ -71,7 +74,7 @@ class Chef
recursive true
end
- file "#{BREW_STAMP}" do
+ file BREW_STAMP do
content "BREW::Update::Post-Invoke-Success\n"
action :create_if_missing
end
@@ -79,7 +82,7 @@ class Chef
execute "brew update" do
command %w{brew update}
default_env true
- user Homebrew.owner
+ user find_homebrew_uid
notifies :touch, "file[#{BREW_STAMP}]", :immediately
end
end
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index e76ea88e8d..6a2656e049 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -16,7 +16,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -131,18 +131,18 @@ class Chef
# darwin
declare_resource(:execute, "set HostName via scutil") do
command "/usr/sbin/scutil --set HostName #{new_resource.hostname}"
- not_if { shell_out!("/usr/sbin/scutil --get HostName").stdout.chomp == new_resource.hostname }
+ not_if { shell_out("/usr/sbin/scutil --get HostName").stdout.chomp == new_resource.hostname }
notifies :reload, "ohai[reload hostname]"
end
declare_resource(:execute, "set ComputerName via scutil") do
command "/usr/sbin/scutil --set ComputerName #{new_resource.hostname}"
- not_if { shell_out!("/usr/sbin/scutil --get ComputerName").stdout.chomp == new_resource.hostname }
+ not_if { shell_out("/usr/sbin/scutil --get ComputerName").stdout.chomp == new_resource.hostname }
notifies :reload, "ohai[reload hostname]"
end
shortname = new_resource.hostname[/[^\.]*/]
declare_resource(:execute, "set LocalHostName via scutil") do
command "/usr/sbin/scutil --set LocalHostName #{shortname}"
- not_if { shell_out!("/usr/sbin/scutil --get LocalHostName").stdout.chomp == shortname }
+ not_if { shell_out("/usr/sbin/scutil --get LocalHostName").stdout.chomp == shortname }
notifies :reload, "ohai[reload hostname]"
end
when linux?
@@ -224,7 +224,7 @@ class Chef
else # windows
WINDOWS_EC2_CONFIG = 'C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml'.freeze
- raise "Windows hostnames cannot contain a period." if new_resource.hostname.match?(/\./)
+ raise "Windows hostnames cannot contain a period." if new_resource.hostname.include?(".")
# suppress EC2 config service from setting our hostname
if ::File.exist?(WINDOWS_EC2_CONFIG)
@@ -240,7 +240,7 @@ class Chef
unless Socket.gethostbyname(Socket.gethostname).first == new_resource.hostname
converge_by "set hostname to #{new_resource.hostname}" do
- powershell_out! <<~EOH
+ powershell_exec! <<~EOH
$sysInfo = Get-WmiObject -Class Win32_ComputerSystem
$sysInfo.Rename("#{new_resource.hostname}")
EOH
@@ -248,7 +248,7 @@ class Chef
# reboot because $windows
reboot "setting hostname" do
- reason "#{Chef::Dist::PRODUCT} updated system hostname"
+ reason "#{ChefUtils::Dist::Infra::PRODUCT} updated system hostname"
only_if { new_resource.windows_reboot }
action :request_reboot
end
diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb
index de714ab4ab..f53d3e731f 100644
--- a/lib/chef/resource/http_request.rb
+++ b/lib/chef/resource/http_request.rb
@@ -26,7 +26,7 @@ class Chef
provides :http_request
- description "Use the **http_request** resource to send an HTTP request (GET, PUT, POST, DELETE, HEAD, or OPTIONS) with an arbitrary message. This resource is often useful when custom callbacks are necessary."
+ description "Use the **http_request** resource to send an HTTP request (`GET`, `PUT`, `POST`, `DELETE`, `HEAD`, or `OPTIONS`) with an arbitrary message. This resource is often useful when custom callbacks are necessary."
default_action :get
allowed_actions :get, :patch, :put, :post, :delete, :head, :options
diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb
index ed62ab5952..2c5262fa97 100644
--- a/lib/chef/resource/ifconfig.rb
+++ b/lib/chef/resource/ifconfig.rb
@@ -21,16 +21,59 @@ require_relative "../resource"
class Chef
class Resource
- # @example set a static ip on eth1
- # ifconfig '33.33.33.80' do
- # device 'eth1'
- # end
class Ifconfig < Chef::Resource
unified_mode true
provides :ifconfig
- description "Use the **ifconfig** resource to manage interfaces on Unix and Linux systems."
+ description "Use the **ifconfig** resource to manage interfaces on Unix and Linux systems. Note: This resource requires the ifconfig binary to be present on the system and may require additional packages to be installed first. On Ubuntu 18.04 or later you will need to install the `ifupdown` package, which disables the built in Netplan functionality. Warning: This resource will not work with Fedora release 33 or later."
+ examples <<~DOC
+ **Configure a network interface with a static IP**
+
+ ```ruby
+ ifconfig '33.33.33.80' do
+ device 'eth1'
+ end
+ ```
+
+ will create the following interface configuration:
+
+ ```
+ iface eth1 inet static
+ address 33.33.33.80
+ ```
+
+ **Configure an interface to use DHCP**
+
+ ```ruby
+ ifconfig 'Set eth1 to DHCP' do
+ device 'eth1'
+ bootproto 'dhcp'
+ end
+ ```
+
+ will create the following interface configuration:
+
+ ```
+ iface eth1 inet dhcp
+ ```
+
+ **Update a static IP address with a boot protocol**
+
+ ```ruby
+ ifconfig "33.33.33.80" do
+ bootproto "dhcp"
+ device "eth1"
+ end
+ ```
+
+ will update the interface configuration from static to dhcp:
+
+ ```
+ iface eth1 inet dhcp
+ address 33.33.33.80
+ ```
+ DOC
state_attrs :inet_addr, :mask
@@ -102,6 +145,10 @@ class Chef
property :gateway, String,
introduced: "14.4",
description: "The gateway to use for the interface."
+
+ property :bridge, String,
+ introduced: "16.7",
+ description: "The bridge interface this interface is a member of on Red Hat based systems."
end
end
end
diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb
index 87a1d79d24..485511470e 100644
--- a/lib/chef/resource/kernel_module.rb
+++ b/lib/chef/resource/kernel_module.rb
@@ -31,7 +31,7 @@ class Chef
kernel_module 'loop' do
options [
'max_loop=4',
- 'max_part=8'
+ 'max_part=8',
]
end
```
diff --git a/lib/chef/resource/ksh.rb b/lib/chef/resource/ksh.rb
index 90f1a784c9..28d71970e7 100644
--- a/lib/chef/resource/ksh.rb
+++ b/lib/chef/resource/ksh.rb
@@ -27,10 +27,10 @@ class Chef
description "Use the **ksh** resource to execute scripts using the Korn shell (ksh)"\
" interpreter. This resource may also use any of the actions and properties"\
- " that are available to the execute resource. Commands that are executed"\
+ " that are available to the **execute** resource. Commands that are executed"\
" with this resource are (by their nature) not idempotent, as they are"\
- " typically unique to the environment in which they are run. Use not_if"\
- " and only_if to guard this resource for idempotence."
+ " typically unique to the environment in which they are run. Use `not_if`"\
+ " and `only_if` to guard this resource for idempotence."
introduced "12.6"
def initialize(name, run_context = nil)
diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb
index a6125f7981..c8e3d93afc 100644
--- a/lib/chef/resource/launchd.rb
+++ b/lib/chef/resource/launchd.rb
@@ -131,35 +131,35 @@ class Chef
description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes."
property :debug, [ TrueClass, FalseClass ],
- description: "Sets the log mask to LOG_DEBUG for this job."
+ description: "Sets the log mask to `LOG_DEBUG` for this job."
property :disabled, [ TrueClass, FalseClass ], default: false,
- description: "Hints to launchctl to not submit this job to launchd."
+ description: "Hints to `launchctl` to not submit this job to launchd."
property :enable_globbing, [ TrueClass, FalseClass ],
description: "Update program arguments before invocation."
property :enable_transactions, [ TrueClass, FalseClass ],
- description: "Track in-progress transactions; if none, then send the SIGKILL signal."
+ description: "Track in-progress transactions; if none, then send the `SIGKILL` signal."
property :environment_variables, Hash,
description: "Additional environment variables to set before running a job."
property :exit_timeout, Integer,
- description: "The amount of time (in seconds) launchd waits before sending a SIGKILL signal."
+ description: "The amount of time (in seconds) launchd waits before sending a `SIGKILL` signal."
property :hard_resource_limits, Hash,
description: "A Hash of resource limits to be imposed on a job."
property :inetd_compatibility, Hash,
- description: "Specifies if a daemon expects to be run as if it were launched from inetd. Set to wait => true to pass standard input, output, and error file descriptors. Set to wait => false to call the accept system call on behalf of the job, and then pass standard input, output, and error file descriptors."
+ description: "Specifies if a daemon expects to be run as if it were launched from inetd. Set to `wait => true` to pass standard input, output, and error file descriptors. Set to `wait => false` to call the accept system call on behalf of the job, and then pass standard input, output, and error file descriptors."
property :init_groups, [ TrueClass, FalseClass ],
- description: "Specify if initgroups is called before running a job."
+ description: "Specify if `initgroups` is called before running a job."
property :keep_alive, [ TrueClass, FalseClass, Hash ],
introduced: "12.14",
- description: "Keep a job running continuously (true) or allow demand and conditions on the node to determine if the job keeps running (false)."
+ description: "Keep a job running continuously (true) or allow demand and conditions on the node to determine if the job keeps running (`false`)."
property :launch_events, [ Hash ],
introduced: "15.1",
@@ -191,10 +191,10 @@ class Chef
callbacks: { "should be a Integer between -20 and 19" => proc { |v| v >= -20 && v <= 19 } }
property :on_demand, [ TrueClass, FalseClass ],
- description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use keep_alive instead for newer versions."
+ description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use `keep_alive` instead for newer versions."
property :process_type, String,
- description: "The intended purpose of the job: Adaptive, Background, Interactive, or Standard."
+ description: "The intended purpose of the job: `Adaptive`, `Background`, `Interactive`, or `Standard`."
property :program, String,
description: "The first argument of execvp, typically the file name associated with the file to be executed. This value must be specified if program_arguments is not specified, and vice-versa."
@@ -206,7 +206,7 @@ class Chef
description: "An array of non-empty directories which, if any are modified, will cause a job to be started."
property :root_directory, String,
- description: "chroot to this directory, and then run the job."
+ description: "`chroot` to this directory, and then run the job."
property :run_at_load, [ TrueClass, FalseClass ],
description: "Launch a job once (at the time it is loaded)."
@@ -218,13 +218,13 @@ class Chef
description: "A Hash of resource limits to be imposed on a job."
property :standard_error_path, String,
- description: "The file to which standard error (stderr) is sent."
+ description: "The file to which standard error (`stderr`) is sent."
property :standard_in_path, String,
- description: "The file to which standard input (stdin) is sent."
+ description: "The file to which standard input (`stdin`) is sent."
property :standard_out_path, String,
- description: "The file to which standard output (stdout) is sent."
+ description: "The file to which standard output (`stdout`) is sent."
property :start_interval, Integer,
description: "The frequency (in seconds) at which a job is started."
@@ -239,7 +239,7 @@ class Chef
description: "The amount of time (in seconds) a job may be idle before it times out. If no value is specified, the default timeout value for launchd will be used."
property :umask, Integer,
- description: "A decimal value to pass to umask before running a job."
+ description: "A decimal value to pass to `umask` before running a job."
property :username, String,
description: "When launchd is run as the root user, the user to run the job as."
@@ -251,7 +251,7 @@ class Chef
description: "An array of paths which, if any are modified, will cause a job to be started."
property :working_directory, String,
- description: "Chdir to this directory, and then run the job."
+ description: "`chdir` to this directory, and then run the job."
end
end
end
diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb
index ea7f5098ab..fafa1a5caa 100644
--- a/lib/chef/resource/locale.rb
+++ b/lib/chef/resource/locale.rb
@@ -16,7 +16,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -71,7 +71,7 @@ class Chef
#
def lc_all(arg = nil)
unless arg.nil?
- Chef.deprecated(:locale_lc_all, "Changing LC_ALL can break #{Chef::Dist::PRODUCT}'s parsing of command output in unexpected ways.\n Use one of the more specific LC_ properties as needed.")
+ Chef.deprecated(:locale_lc_all, "Changing LC_ALL can break #{ChefUtils::Dist::Infra::PRODUCT}'s parsing of command output in unexpected ways.\n Use one of the more specific LC_ properties as needed.")
end
end
@@ -125,7 +125,7 @@ class Chef
# @raise [Mixlib::ShellOut::ShellCommandFailed] not a supported language or locale
#
def generate_locales
- shell_out!("locale-gen #{unavailable_locales.join(" ")}")
+ shell_out!("locale-gen #{unavailable_locales.join(" ")}", timeout: 1800)
end
# Sets the system locale for the current computer.
diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb
index a1d2afd791..2cf891d530 100644
--- a/lib/chef/resource/lwrp_base.rb
+++ b/lib/chef/resource/lwrp_base.rb
@@ -63,17 +63,15 @@ class Chef
Chef::Log.trace("Loaded contents of #{filename} into resource #{resource_name} (#{resource_class})")
- LWRPBase.loaded_lwrps[filename] = true
-
# wire up the default resource name after the class is parsed only if we haven't declared one.
# (this ordering is important for MapCollision deprecation warnings)
resource_class.provides resource_name.to_sym unless Chef::ResourceResolver.includes_handler?(resource_name.to_sym, self)
+ LWRPBase.loaded_lwrps[filename] = resource_class
+
resource_class
end
- alias :attribute :property
-
# Adds +action_names+ to the list of valid actions for this resource.
# Does not include superclass's action list when appending.
def actions(*action_names)
@@ -88,7 +86,7 @@ class Chef
# @deprecated
def valid_actions(*args)
- Chef::Log.warn("`valid_actions' is deprecated, please use allowed_actions `instead'!")
+ Chef::Log.warn("`valid_actions` is deprecated, please use `allowed_actions` instead!")
allowed_actions(*args)
end
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb
index d163fd8402..a150aeb9ed 100644
--- a/lib/chef/resource/macos_userdefaults.rb
+++ b/lib/chef/resource/macos_userdefaults.rb
@@ -16,8 +16,8 @@
#
require_relative "../resource"
-require_relative "../dist"
-require "plist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
+autoload :Plist, "plist"
class Chef
class Resource
@@ -97,7 +97,7 @@ class Chef
desired_state: false
property :sudo, [TrueClass, FalseClass],
- description: "Set to true if the setting you wish to modify requires privileged access. This requires passwordless sudo for the '/usr/bin/defaults' command to be setup for the user running #{Chef::Dist::PRODUCT}.",
+ description: "Set to true if the setting you wish to modify requires privileged access. This requires passwordless sudo for the '/usr/bin/defaults' command to be setup for the user running #{ChefUtils::Dist::Infra::PRODUCT}.",
default: false,
desired_state: false
diff --git a/lib/chef/resource/mdadm.rb b/lib/chef/resource/mdadm.rb
index 7c1d066488..f2e610c1cf 100644
--- a/lib/chef/resource/mdadm.rb
+++ b/lib/chef/resource/mdadm.rb
@@ -36,7 +36,7 @@ class Chef
property :chunk, Integer,
default: 16,
- description: "The chunk size. This property should not be used for a RAID 1 mirrored pair (i.e. when the level property is set to 1)."
+ description: "The chunk size. This property should not be used for a RAID 1 mirrored pair (i.e. when the `level` property is set to `1`)."
property :devices, Array,
default: lazy { [] },
@@ -63,7 +63,7 @@ class Chef
description: "An optional property to specify the name of the RAID device if it differs from the resource block's name."
property :layout, String,
- description: "The RAID5 parity algorithm. Possible values: left-asymmetric (or la), left-symmetric (or ls), right-asymmetric (or ra), or right-symmetric (or rs)."
+ description: "The RAID5 parity algorithm. Possible values: `left-asymmetric` (or `la`), `left-symmetric` (or ls), `right-asymmetric` (or `ra`), or `right-symmetric` (or `rs`)."
action_class do
def load_current_resource
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb
index f6dd4f70f0..c23ba9bbee 100644
--- a/lib/chef/resource/mount.rb
+++ b/lib/chef/resource/mount.rb
@@ -41,6 +41,7 @@ class Chef
sensitive: true
property :mount_point, String, name_property: true,
+ coerce: proc { |arg| arg.chomp("/") }, # Removed "/" from the end of str, because it was causing idempotency issue.
description: "The directory (or path) in which the device is to be mounted. Defaults to the name of the resource block if not provided."
property :device, String, identity: true,
@@ -65,7 +66,7 @@ class Chef
property :options, [Array, String, nil],
description: "An array or comma separated list of options for the mount.",
- coerce: proc { |arg| arg.is_a?(String) ? arg.split(",") : arg },
+ coerce: proc { |arg| mount_options(arg) }, # Please see #mount_options method.
default: %w{defaults}
property :dump, [Integer, FalseClass],
@@ -84,7 +85,7 @@ class Chef
description: "Windows only: Use to specify the user name."
property :domain, String,
- description: "Windows only: Use to specify the domain in which the username and password are located."
+ description: "Windows only: Use to specify the domain in which the `username` and `password` are located."
private
@@ -94,6 +95,11 @@ class Chef
@fstype = nil
end
+ # Returns array of string without leading and trailing whitespace.
+ def mount_options(options)
+ (options.is_a?(String) ? options.split(",") : options).collect(&:strip)
+ end
+
end
end
end
diff --git a/lib/chef/resource/notify_group.rb b/lib/chef/resource/notify_group.rb
index a8bc71527d..9a1edf3eb8 100644
--- a/lib/chef/resource/notify_group.rb
+++ b/lib/chef/resource/notify_group.rb
@@ -15,7 +15,6 @@
#
require_relative "../resource"
-require_relative "../dist"
class Chef
class Resource
diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb
index 93fdb82676..560a15353a 100644
--- a/lib/chef/resource/ohai.rb
+++ b/lib/chef/resource/ohai.rb
@@ -19,7 +19,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require "ohai" unless defined?(Ohai::System)
class Chef
@@ -29,10 +29,53 @@ class Chef
provides :ohai
- description "Use the **ohai** resource to reload the Ohai configuration on a node. This allows recipes that change system attributes (like a recipe that adds a user) to refer to those attributes later on during the #{Chef::Dist::CLIENT} run."
+ description "Use the **ohai** resource to reload the Ohai configuration on a node. This allows recipes that change system attributes (like a recipe that adds a user) to refer to those attributes later on during the #{ChefUtils::Dist::Infra::PRODUCT} run."
+
+ examples <<~DOC
+ Reload All Ohai Plugins
+
+ ```ruby
+ ohai 'reload' do
+ action :reload
+ end
+ ```
+
+ Reload A Single Ohai Plugin
+
+ ```ruby
+ ohai 'reload' do
+ plugin 'ipaddress'
+ action :reload
+ end
+ ```
+
+ Reload Ohai after a new user is created
+
+ ```ruby
+ ohai 'reload_passwd' do
+ action :nothing
+ plugin 'etc'
+ end
+
+ user 'daemon_user' do
+ home '/dev/null'
+ shell '/sbin/nologin'
+ system true
+ notifies :reload, 'ohai[reload_passwd]', :immediately
+ end
+
+ ruby_block 'just an example' do
+ block do
+ # These variables will now have the new values
+ puts node['etc']['passwd']['daemon_user']['uid']
+ puts node['etc']['passwd']['daemon_user']['gid']
+ end
+ end
+ ```
+ DOC
property :plugin, String,
- description: "The name of an Ohai plugin to be reloaded. If this property is not specified, #{Chef::Dist::PRODUCT} will reload all plugins."
+ description: "Specific Ohai attribute data to reload. This property behaves similar to specifying attributes when running Ohai on the command line and takes the attribute that you wish to reload instead of the actual plugin name. For instance, you can pass `ipaddress` to reload `node['ipaddress']` even though that data comes from the `Network` plugin. If this property is not specified, #{ChefUtils::Dist::Infra::PRODUCT} will reload all plugins."
def load_current_resource
true
diff --git a/lib/chef/resource/ohai_hint.rb b/lib/chef/resource/ohai_hint.rb
index 2c962f0957..88ea02c809 100644
--- a/lib/chef/resource/ohai_hint.rb
+++ b/lib/chef/resource/ohai_hint.rb
@@ -26,6 +26,39 @@ class Chef
description "Use the **ohai_hint** resource to aid in configuration detection by passing hint data to Ohai."
introduced "14.0"
+ examples <<~DOC
+ **Create a hint file**
+
+ ```ruby
+ ohai_hint 'example' do
+ content a: 'test_content'
+ end
+ ```
+
+ **Create a hint file with a name that does not match the resource name**
+
+ ```ruby
+ ohai_hint 'example' do
+ hint_name 'custom'
+ end
+ ```
+
+ **Create a hint file that is not loaded at compile time**
+
+ ```ruby
+ ohai_hint 'example' do
+ compile_time false
+ end
+ ```
+
+ **Delete a hint file**
+
+ ```ruby
+ ohai_hint 'example' do
+ action :delete
+ end
+ ```
+ DOC
property :hint_name, String,
description: "An optional property to set the hint name if it differs from the resource block's name.",
diff --git a/lib/chef/resource/openssl_dhparam.rb b/lib/chef/resource/openssl_dhparam.rb
index 087296e9a8..3d20b1b439 100644
--- a/lib/chef/resource/openssl_dhparam.rb
+++ b/lib/chef/resource/openssl_dhparam.rb
@@ -27,15 +27,37 @@ class Chef
provides(:openssl_dhparam) { true }
- description "Use the **openssl_dhparam** resource to generate dhparam.pem files. If a valid dhparam.pem file is found at the specified location, no new file will be created. If a file is found at the specified location but it is not a valid dhparam file, it will be overwritten."
+ description "Use the **openssl_dhparam** resource to generate `dhparam.pem` files. If a valid `dhparam.pem` file is found at the specified location, no new file will be created. If a file is found at the specified location but it is not a valid `dhparam.pem` file, it will be overwritten."
introduced "14.0"
examples <<~DOC
- Create a 1024bit dhparam file
+ **Create a dhparam file**
```ruby
- openssl_dhparam '/etc/ssl_files/dhparam.pem' do
- key_length 1024
- action :create
+ openssl_dhparam '/etc/httpd/ssl/dhparam.pem'
+ ```
+
+ **Create a dhparam file with a specific key length**
+
+ ```ruby
+ openssl_dhparam '/etc/httpd/ssl/dhparam.pem' do
+ key_length 4096
+ end
+ ```
+
+ **Create a dhparam file with specific user/group ownership**
+
+ ```ruby
+ openssl_dhparam '/etc/httpd/ssl/dhparam.pem' do
+ owner 'www-data'
+ group 'www-data'
+ end
+ ```
+
+ **Manually specify the dhparam file path**
+
+ ```ruby
+ openssl_dhparam 'httpd_dhparam' do
+ path '/etc/httpd/ssl/dhparam.pem'
end
```
DOC
diff --git a/lib/chef/resource/openssl_ec_private_key.rb b/lib/chef/resource/openssl_ec_private_key.rb
index 36ad8f43ae..7625b5ea6e 100644
--- a/lib/chef/resource/openssl_ec_private_key.rb
+++ b/lib/chef/resource/openssl_ec_private_key.rb
@@ -66,10 +66,13 @@ class Chef
description: "The desired passphrase for the key."
property :key_cipher, String,
- equal_to: OpenSSL::Cipher.ciphers,
- validation_message: "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options.",
description: "The designed cipher to use when generating your key. Run `openssl list-cipher-algorithms` to see available options.",
- default: "des3"
+ default: lazy { "des3" },
+ default_description: "des3",
+ callbacks: {
+ "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options." =>
+ proc { |v| OpenSSL::Cipher.ciphers.include?(v) },
+ }
property :owner, [String, Integer],
description: "The owner applied to all files created by the resource."
diff --git a/lib/chef/resource/openssl_ec_public_key.rb b/lib/chef/resource/openssl_ec_public_key.rb
index ec61bc95c2..44441eb72d 100644
--- a/lib/chef/resource/openssl_ec_public_key.rb
+++ b/lib/chef/resource/openssl_ec_public_key.rb
@@ -31,7 +31,7 @@ class Chef
description "Use the **openssl_ec_public_key** resource to generate elliptic curve (EC) public key files from a given EC private key."
introduced "14.4"
examples <<~DOC
- Generate new ec public key from a private key on disk
+ **Generate new EC public key from a private key on disk**
```ruby
openssl_ec_public_key '/etc/ssl_files/eckey_prime256v1_des3.pub' do
@@ -41,7 +41,7 @@ class Chef
end
```
- Generate new ec public key by passing in a private key
+ **Generate new EC public key by passing in a private key**
```ruby
openssl_ec_public_key '/etc/ssl_files/eckey_prime256v1_des3_2.pub' do
diff --git a/lib/chef/resource/openssl_rsa_private_key.rb b/lib/chef/resource/openssl_rsa_private_key.rb
index c8129a728e..e9e6ef24ca 100644
--- a/lib/chef/resource/openssl_rsa_private_key.rb
+++ b/lib/chef/resource/openssl_rsa_private_key.rb
@@ -65,10 +65,13 @@ class Chef
description: "The desired passphrase for the key."
property :key_cipher, String,
- equal_to: OpenSSL::Cipher.ciphers,
- validation_message: "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options.",
description: "The designed cipher to use when generating your key. Run `openssl list-cipher-algorithms` to see available options.",
- default: "des3"
+ default: lazy { "des3" },
+ default_description: "des3",
+ callbacks: {
+ "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options." =>
+ proc { |v| OpenSSL::Cipher.ciphers.include?(v) },
+ }
property :owner, [String, Integer],
description: "The owner applied to all files created by the resource."
diff --git a/lib/chef/resource/openssl_x509_certificate.rb b/lib/chef/resource/openssl_x509_certificate.rb
index de0be22f40..c723f47d61 100644
--- a/lib/chef/resource/openssl_x509_certificate.rb
+++ b/lib/chef/resource/openssl_x509_certificate.rb
@@ -86,32 +86,32 @@ class Chef
description: "The permission mode applied to all files created by the resource."
property :country, String,
- description: "Value for the C certificate field."
+ description: "Value for the `C` certificate field."
property :state, String,
- description: "Value for the ST certificate field."
+ description: "Value for the `ST` certificate field."
property :city, String,
- description: "Value for the L certificate field."
+ description: "Value for the `L` certificate field."
property :org, String,
- description: "Value for the O certificate field."
+ description: "Value for the `O` certificate field."
property :org_unit, String,
- description: "Value for the OU certificate field."
+ description: "Value for the `OU` certificate field."
property :common_name, String,
- description: "Value for the CN certificate field."
+ description: "Value for the `CN` certificate field."
property :email, String,
- description: "Value for the email certificate field."
+ description: "Value for the `email` certificate field."
property :extensions, Hash,
- description: "Hash of X509 Extensions entries, in format { 'keyUsage' => { 'values' => %w( keyEncipherment digitalSignature), 'critical' => true } }.",
+ description: "Hash of X509 Extensions entries, in format `{ 'keyUsage' => { 'values' => %w( keyEncipherment digitalSignature), 'critical' => true } }`.",
default: lazy { {} }
property :subject_alt_name, Array,
- description: "Array of Subject Alternative Name entries, in format DNS:example.com or IP:1.2.3.4.",
+ description: "Array of Subject Alternative Name entries, in format `DNS:example.com` or `IP:1.2.3.4`.",
default: lazy { [] }
property :key_file, String,
@@ -122,7 +122,7 @@ class Chef
property :key_type, String,
equal_to: %w{rsa ec},
- description: "The desired type of the generated key (rsa or ec).",
+ description: "The desired type of the generated key.",
default: "rsa"
property :key_length, Integer,
@@ -131,18 +131,18 @@ class Chef
default: 2048
property :key_curve, String,
- description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options.",
+ description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run `openssl ecparam -list_curves` to see available options.",
equal_to: %w{secp384r1 secp521r1 prime256v1},
default: "prime256v1"
property :csr_file, String,
- description: "The path to a X509 Certificate Request (CSR) on the filesystem. If the csr_file property is specified, the resource will attempt to source a CSR from this location. If no CSR file is found, the resource will generate a Self-Signed Certificate and the certificate fields must be specified (common_name at last)."
+ description: "The path to a X509 Certificate Request (CSR) on the filesystem. If the `csr_file` property is specified, the resource will attempt to source a CSR from this location. If no CSR file is found, the resource will generate a Self-Signed Certificate and the certificate fields must be specified (common_name at last)."
property :ca_cert_file, String,
- description: "The path to the CA X509 Certificate on the filesystem. If the ca_cert_file property is specified, the ca_key_file property must also be specified, the certificate will be signed with them."
+ description: "The path to the CA X509 Certificate on the filesystem. If the `ca_cert_file` property is specified, the `ca_key_file` property must also be specified, the certificate will be signed with them."
property :ca_key_file, String,
- description: "The path to the CA private key on the filesystem. If the ca_key_file property is specified, the 'ca_cert_file' property must also be specified, the certificate will be signed with them."
+ description: "The path to the CA private key on the filesystem. If the `ca_key_file` property is specified, the `ca_cert_file` property must also be specified, the certificate will be signed with them."
property :ca_key_pass, String,
description: "The passphrase for CA private key's passphrase."
diff --git a/lib/chef/resource/openssl_x509_crl.rb b/lib/chef/resource/openssl_x509_crl.rb
index 7bc96fa4da..6e7f905084 100644
--- a/lib/chef/resource/openssl_x509_crl.rb
+++ b/lib/chef/resource/openssl_x509_crl.rb
@@ -31,15 +31,24 @@ class Chef
description "Use the **openssl_x509_crl** resource to generate PEM-formatted x509 certificate revocation list (CRL) files."
introduced "14.4"
examples <<~DOC
- Generate a CRL file given a cert file and key file
+ **Create a certificate revocation file**
- ```ruby
- openssl_x509_crl '/etc/ssl_files/my_ca2.crl' do
- ca_cert_file '/etc/ssl_files/my_ca2.crt'
- ca_key_file '/etc/ssl_files/my_ca2.key'
- expire 1
- end
- ```
+ ```ruby
+ openssl_x509_crl '/etc/ssl_test/my_ca.crl' do
+ ca_cert_file '/etc/ssl_test/my_ca.crt'
+ ca_key_file '/etc/ssl_test/my_ca.key'
+ end
+ ```
+
+ **Create a certificate revocation file for a particular serial**
+
+ ```ruby
+ openssl_x509_crl '/etc/ssl_test/my_ca.crl' do
+ ca_cert_file '/etc/ssl_test/my_ca.crt'
+ ca_key_file '/etc/ssl_test/my_ca.key'
+ serial_to_revoke C7BCB6602A2E4251EF4E2827A228CB52BC0CEA2F
+ end
+ ```
DOC
property :path, String,
@@ -62,11 +71,11 @@ class Chef
default: 1
property :ca_cert_file, String,
- description: "The path to the CA X509 Certificate on the filesystem. If the ca_cert_file property is specified, the ca_key_file property must also be specified, the CRL will be signed with them.",
+ description: "The path to the CA X509 Certificate on the filesystem. If the `ca_cert_file` property is specified, the `ca_key_file` property must also be specified, the CRL will be signed with them.",
required: true
property :ca_key_file, String,
- description: "The path to the CA private key on the filesystem. If the ca_key_file property is specified, the ca_cert_file property must also be specified, the CRL will be signed with them.",
+ description: "The path to the CA private key on the filesystem. If the `ca_key_file` property is specified, the `ca_cert_file` property must also be specified, the CRL will be signed with them.",
required: true
property :ca_key_pass, String,
diff --git a/lib/chef/resource/openssl_x509_request.rb b/lib/chef/resource/openssl_x509_request.rb
index 8ebf6fe8eb..0e68337b05 100644
--- a/lib/chef/resource/openssl_x509_request.rb
+++ b/lib/chef/resource/openssl_x509_request.rb
@@ -31,7 +31,7 @@ class Chef
description "Use the **openssl_x509_request** resource to generate PEM-formatted x509 certificates requests. If no existing key is specified, the resource will automatically generate a passwordless key with the certificate."
introduced "14.4"
examples <<~DOC
- Generate new ec key and csr file
+ **Generate new EC key and CSR file**
```ruby
openssl_x509_request '/etc/ssl_files/my_ec_request.csr' do
@@ -42,7 +42,7 @@ class Chef
end
```
- Generate a new csr file from an existing ec key
+ **Generate a new CSR file from an existing EC key**
```ruby
openssl_x509_request '/etc/ssl_files/my_ec_request2.csr' do
@@ -54,7 +54,7 @@ class Chef
end
```
- Generate new rsa key and csr file
+ **Generate new RSA key and CSR file**
```ruby
openssl_x509_request '/etc/ssl_files/my_rsa_request.csr' do
@@ -80,46 +80,44 @@ class Chef
description: "The permission mode applied to all files created by the resource."
property :country, String,
- description: "Value for the C certificate field."
+ description: "Value for the `C` certificate field."
property :state, String,
- description: "Value for the ST certificate field."
+ description: "Value for the `ST` certificate field."
property :city, String,
- description: "Value for the L certificate field."
+ description: "Value for the `L` certificate field."
property :org, String,
- description: "Value for the O certificate field."
+ description: "Value for the `O` certificate field."
property :org_unit, String,
- description: "Value for the OU certificate field."
+ description: "Value for the `OU` certificate field."
property :common_name, String,
required: true,
- description: "Value for the CN certificate field."
+ description: "Value for the `CN` certificate field."
property :email, String,
- description: "Value for the email certificate field."
+ description: "Value for the `email` certificate field."
property :key_file, String,
- description: "The path to a certificate key file on the filesystem. If the key_file property is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the key_file property is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate."
+ description: "The path to a certificate key file on the filesystem. If the `key_file` property is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the `key_file` property is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate."
property :key_pass, String,
description: "The passphrase for an existing key's passphrase."
property :key_type, String,
equal_to: %w{rsa ec}, default: "ec",
- description: "The desired type of the generated key (rsa or ec)."
+ description: "The desired type of the generated key."
property :key_length, Integer,
equal_to: [1024, 2048, 4096, 8192], default: 2048,
- description: "The desired bit length of the generated key (if key_type is equal to 'rsa')."
+ description: "The desired bit length of the generated key (if key_type is equal to `rsa`)."
property :key_curve, String,
equal_to: %w{secp384r1 secp521r1 prime256v1}, default: "prime256v1",
- description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options."
-
- default_action :create
+ description: "The desired curve of the generated key (if key_type is equal to `ec`). Run `openssl ecparam -list_curves` to see available options."
action :create do
description "Generate a certificate request."
diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb
index 23a4e86505..491f30be43 100644
--- a/lib/chef/resource/osx_profile.rb
+++ b/lib/chef/resource/osx_profile.rb
@@ -19,8 +19,8 @@
require_relative "../resource"
require_relative "../log"
require_relative "../resource/file"
-require "uuidtools"
-require "plist"
+autoload :UUIDTools, "uuidtools"
+autoload :Plist, "plist"
class Chef
class Resource
@@ -30,8 +30,72 @@ class Chef
provides :osx_profile
provides :osx_config_profile
- description "Use the **osx_profile** resource to manage configuration profiles (.mobileconfig files) on the macOS platform. The osx_profile resource installs profiles by using the uuidgen library to generate a unique ProfileUUID, and then using the profiles command to install the profile on the system."
+ description "Use the **osx_profile** resource to manage configuration profiles (`.mobileconfig` files) on the macOS platform. The **osx_profile** resource installs profiles by using the uuidgen library to generate a unique `ProfileUUID`, and then using the `profiles` command to install the profile on the system."
introduced "12.7"
+ examples <<~DOC
+ **Install a profile from a cookbook file**
+
+ ```ruby
+ osx_profile 'com.company.screensaver.mobileconfig'
+ ```
+
+ **Install profile from a hash**
+
+ ```ruby
+ profile_hash = {
+ 'PayloadIdentifier' => 'com.company.screensaver',
+ 'PayloadRemovalDisallowed' => false,
+ 'PayloadScope' => 'System',
+ 'PayloadType' => 'Configuration',
+ 'PayloadUUID' => '1781fbec-3325-565f-9022-8aa28135c3cc',
+ 'PayloadOrganization' => 'Chef',
+ 'PayloadVersion' => 1,
+ 'PayloadDisplayName' => 'Screensaver Settings',
+ 'PayloadContent'=> [
+ {
+ 'PayloadType' => 'com.apple.ManagedClient.preferences',
+ 'PayloadVersion' => 1,
+ 'PayloadIdentifier' => 'com.company.screensaver',
+ 'PayloadUUID' => '73fc30e0-1e57-0131-c32d-000c2944c108',
+ 'PayloadEnabled' => true,
+ 'PayloadDisplayName' => 'com.apple.screensaver',
+ 'PayloadContent' => {
+ 'com.apple.screensaver' => {
+ 'Forced' => [
+ {
+ 'mcx_preference_settings' => {
+ 'idleTime' => 0,
+ },
+ },
+ ],
+ },
+ },
+ },
+ ],
+ }
+
+ osx_profile 'Install screensaver profile' do
+ profile profile_hash
+ end
+ ```
+
+ **Remove profile using identifier in resource name**
+
+ ```ruby
+ osx_profile 'com.company.screensaver' do
+ action :remove
+ end
+ ```
+
+ **Remove profile by identifier and user friendly resource name**
+
+ ```ruby
+ osx_profile 'Remove screensaver profile' do
+ identifier 'com.company.screensaver'
+ action :remove
+ end
+ ```
+ DOC
property :profile_name, String,
description: "Use to specify the name of the profile, if different from the name of the resource block.",
@@ -41,7 +105,7 @@ class Chef
description: "Use to specify a profile. This may be the name of a profile contained in a cookbook or a Hash that contains the contents of the profile."
property :identifier, String,
- description: "Use to specify the identifier for the profile, such as com.company.screensaver."
+ description: "Use to specify the identifier for the profile, such as `com.company.screensaver`."
# this is not a property it is necessary for the tempfile this resource uses to work (FIXME: this is terrible)
#
@@ -80,10 +144,6 @@ class Chef
end
def check_resource_semantics!
- if mac? && node["platform_version"] =~ ">= 11.0"
- raise "The osx_profile resource is not available on macOS Big Sur or above due to Apple's removal of support for CLI profile installation"
- end
-
if action == :remove
if new_profile_identifier
if invalid_profile_name?(new_profile_identifier)
@@ -97,6 +157,11 @@ class Chef
end
if action == :install
+ # we only do this check for the install action so that profiles can still be removed on macOS 11+
+ if mac? && node["platform_version"] =~ ">= 11.0"
+ raise "The osx_profile resource is not available on macOS Big Sur or above due to Apple's removal of support for CLI profile installation"
+ end
+
if new_profile_hash.is_a?(Hash) && !new_profile_hash.include?("PayloadIdentifier")
raise "The specified profile does not seem to be valid"
end
@@ -243,19 +308,18 @@ class Chef
#
def get_installed_profiles(update = nil)
+ logger.trace("Saving profile data to node.run_state")
if update
node.run_state[:config_profiles] = query_installed_profiles
else
node.run_state[:config_profiles] ||= query_installed_profiles
end
- logger.trace("Saved profiles to run_state")
end
def query_installed_profiles
- Tempfile.open("allprofiles.plist") do |tempfile|
- shell_out( "/usr/bin/profiles", "-P", "-o", tempfile.path )
- ::Plist.parse_xml(tempfile)
- end
+ logger.trace("Running /usr/bin/profiles -P -o stdout-xml to determine profile state")
+ so = shell_out( "/usr/bin/profiles", "-P", "-o", "stdout-xml" )
+ ::Plist.parse_xml(so.stdout)
end
def profile_installed?
diff --git a/lib/chef/resource/perl.rb b/lib/chef/resource/perl.rb
index 21f9755bc5..ac98c69a8c 100644
--- a/lib/chef/resource/perl.rb
+++ b/lib/chef/resource/perl.rb
@@ -32,9 +32,9 @@ class Chef
description "Use the **perl** resource to execute scripts using the Perl interpreter."\
" This resource may also use any of the actions and properties that are"\
- " available to the execute resource. Commands that are executed with this"\
+ " available to the **execute** resource. Commands that are executed with this"\
" resource are (by their nature) not idempotent, as they are typically"\
- " unique to the environment in which they are run. Use not_if and only_if"\
+ " unique to the environment in which they are run. Use `not_if` and `only_if`"\
" to guard this resource for idempotence."
end
end
diff --git a/lib/chef/resource/plist.rb b/lib/chef/resource/plist.rb
index 06811ea8b6..a7cb88ef57 100644
--- a/lib/chef/resource/plist.rb
+++ b/lib/chef/resource/plist.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
require_relative "../resource"
-require "plist"
+autoload :Plist, "plist"
class Chef
class Resource
@@ -151,9 +151,7 @@ class Chef
value.to_i
when "float"
value.to_f
- when "string"
- value
- when "dictionary"
+ when "string", "dictionary"
value
when nil
""
@@ -168,9 +166,7 @@ class Chef
"array"
when Integer
"integer"
- when FalseClass
- "bool"
- when TrueClass
+ when FalseClass, TrueClass
"bool"
when Hash
"dict"
diff --git a/lib/chef/resource/powershell_package_source.rb b/lib/chef/resource/powershell_package_source.rb
index 051b6d4239..066efc6a72 100644
--- a/lib/chef/resource/powershell_package_source.rb
+++ b/lib/chef/resource/powershell_package_source.rb
@@ -16,7 +16,6 @@
#
require_relative "../resource"
-require_relative "../json_compat"
class Chef
class Resource
@@ -33,7 +32,7 @@ class Chef
name_property: true
property :url, String,
- description: "The url to the package source.",
+ description: "The URL to the package source.",
required: [:register]
property :trusted, [TrueClass, FalseClass],
@@ -43,25 +42,25 @@ class Chef
property :provider_name, String,
equal_to: %w{ Programs msi NuGet msu PowerShellGet psl chocolatey },
validation_message: "The following providers are supported: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' or 'chocolatey'",
- description: "The package management provider for the source. It supports the following providers: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' and 'chocolatey'.",
+ description: "The package management provider for the source.",
default: "NuGet"
property :publish_location, String,
- description: "The url where modules will be published to for this source. Only valid if the provider is 'PowerShellGet'."
+ description: "The URL where modules will be published to for this source. Only valid if the provider is `PowerShellGet`."
property :script_source_location, String,
- description: "The url where scripts are located for this source. Only valid if the provider is 'PowerShellGet'."
+ description: "The URL where scripts are located for this source. Only valid if the provider is `PowerShellGet`."
property :script_publish_location, String,
- description: "The location where scripts will be published to for this source. Only valid if the provider is 'PowerShellGet'."
+ description: "The location where scripts will be published to for this source. Only valid if the provider is `PowerShellGet`."
load_current_value do
cmd = load_resource_state_script(source_name)
- repo = powershell_out!(cmd)
- if repo.stdout.empty?
+ repo = powershell_exec!(cmd)
+ if repo.result.empty?
current_value_does_not_exist!
else
- status = Chef::JSONCompat.from_json(repo.stdout)
+ status = repo.result
end
url status["url"]
trusted status["trusted"]
@@ -78,28 +77,28 @@ class Chef
if package_source_exists?
converge_if_changed :url, :trusted, :publish_location, :script_source_location, :script_publish_location do
update_cmd = build_ps_repository_command("Set", new_resource)
- res = powershell_out(update_cmd)
- raise "Failed to update #{new_resource.source_name}: #{res.stderr}" unless res.stderr.empty?
+ res = powershell_exec(update_cmd)
+ raise "Failed to update #{new_resource.source_name}: #{res.errors}" if res.error?
end
else
converge_by("register source: #{new_resource.source_name}") do
register_cmd = build_ps_repository_command("Register", new_resource)
- res = powershell_out(register_cmd)
- raise "Failed to register #{new_resource.source_name}: #{res.stderr}" unless res.stderr.empty?
+ res = powershell_exec(register_cmd)
+ raise "Failed to register #{new_resource.source_name}: #{res.errors}" if res.error?
end
end
else
if package_source_exists?
converge_if_changed :url, :trusted, :provider_name do
update_cmd = build_package_source_command("Set", new_resource)
- res = powershell_out(update_cmd)
- raise "Failed to update #{new_resource.source_name}: #{res.stderr}" unless res.stderr.empty?
+ res = powershell_exec(update_cmd)
+ raise "Failed to update #{new_resource.source_name}: #{res.errors}" if res.error?
end
else
converge_by("register source: #{new_resource.source_name}") do
register_cmd = build_package_source_command("Register", new_resource)
- res = powershell_out(register_cmd)
- raise "Failed to register #{new_resource.source_name}: #{res.stderr}" unless res.stderr.empty?
+ res = powershell_exec(register_cmd)
+ raise "Failed to register #{new_resource.source_name}: #{res.errors}" if res.error?
end
end
end
@@ -110,16 +109,16 @@ class Chef
if package_source_exists?
unregister_cmd = "Get-PackageSource -Name '#{new_resource.source_name}' | Unregister-PackageSource"
converge_by("unregister source: #{new_resource.source_name}") do
- res = powershell_out(unregister_cmd)
- raise "Failed to unregister #{new_resource.source_name}: #{res.stderr}" unless res.stderr.empty?
+ res = powershell_exec(unregister_cmd)
+ raise "Failed to unregister #{new_resource.source_name}: #{res.errors}" if res.error?
end
end
end
action_class do
def package_source_exists?
- cmd = powershell_out!("(Get-PackageSource -Name '#{new_resource.source_name}' -WarningAction SilentlyContinue).Name")
- cmd.stdout.downcase.strip == new_resource.source_name.downcase
+ cmd = powershell_exec!("(Get-PackageSource -Name '#{new_resource.source_name}' -ErrorAction SilentlyContinue).Name")
+ !cmd.result.empty? && cmd.result.to_s.downcase.strip == new_resource.source_name.downcase
end
def psrepository_cmdlet_appropriate?
@@ -133,6 +132,7 @@ class Chef
cmd << " -PublishLocation '#{new_resource.publish_location}'" if new_resource.publish_location
cmd << " -ScriptSourceLocation '#{new_resource.script_source_location}'" if new_resource.script_source_location
cmd << " -ScriptPublishLocation '#{new_resource.script_publish_location}'" if new_resource.script_publish_location
+ cmd << " | Out-Null"
cmd
end
@@ -141,6 +141,7 @@ class Chef
cmd << " -Location '#{new_resource.url}'" if new_resource.url
cmd << " -Trusted:#{new_resource.trusted ? "$true" : "$false"}"
cmd << " -ProviderName '#{new_resource.provider_name}'" if new_resource.provider_name
+ cmd << " | Out-Null"
cmd
end
end
@@ -157,11 +158,11 @@ class Chef
if ((Get-PackageSource -Name '#{name}').ProviderName -eq 'PowerShellGet') {
(Get-PSRepository -Name '#{name}') | Select @{n='source_name';e={$_.Name}}, @{n='url';e={$_.SourceLocation}},
@{n='trusted';e={$_.Trusted}}, @{n='provider_name';e={$_.PackageManagementProvider}}, @{n='publish_location';e={$_.PublishLocation}},
- @{n='script_source_location';e={$_.ScriptSourceLocation}}, @{n='script_publish_location';e={$_.ScriptPublishLocation}} | ConvertTo-Json
+ @{n='script_source_location';e={$_.ScriptSourceLocation}}, @{n='script_publish_location';e={$_.ScriptPublishLocation}}
}
else {
(Get-PackageSource -Name '#{name}') | Select @{n='source_name';e={$_.Name}}, @{n='url';e={$_.Location}},
- @{n='provider_name';e={$_.ProviderName}}, @{n='trusted';e={$_.IsTrusted}} | ConvertTo-Json
+ @{n='provider_name';e={$_.ProviderName}}, @{n='trusted';e={$_.IsTrusted}}
}
}
EOH
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb
index 7699c0a976..eb72518009 100644
--- a/lib/chef/resource/powershell_script.rb
+++ b/lib/chef/resource/powershell_script.rb
@@ -22,11 +22,24 @@ class Chef
class PowershellScript < Chef::Resource::WindowsScript
unified_mode true
+ set_guard_inherited_attributes(:interpreter)
+
provides :powershell_script, os: "windows"
+ description <<~DESC
+ Use the **powershell_script** resource to execute a script using the Windows PowerShell interpreter, much like how the script and script-based resources **bash**, **csh**, **perl**, **python**, and **ruby** are used. The **powershell_script** resource is specific to the Microsoft Windows platform, but may use both the the Windows PowerShell interpreter or the PowerShell Core (pwsh) interpreter as of Chef Infra Client 16.6 and later.
+
+ The **powershell_script** resource creates and executes a temporary file rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` conditionals to guard this resource for idempotence.
+ DESC
+
property :flags, String,
description: "A string that is passed to the Windows PowerShell command"
+ property :interpreter, String,
+ default: "powershell",
+ equal_to: %w{powershell pwsh},
+ description: "The interpreter type, `powershell` or `pwsh` (PowerShell Core)"
+
property :convert_boolean_return, [true, false],
default: false,
description: <<~DESC
@@ -51,18 +64,8 @@ class Chef
```
DESC
- description "Use the **powershell_script** resource to execute a script using the Windows PowerShell"\
- " interpreter, much like how the script and script-based resources—bash, csh, perl, python,"\
- " and ruby—are used. The powershell_script is specific to the Microsoft Windows platform"\
- " and the Windows PowerShell interpreter.\n\n The powershell_script resource creates and"\
- " executes a temporary file (similar to how the script resource behaves), rather than running"\
- " the command inline. Commands that are executed with this resource are (by their nature) not"\
- " idempotent, as they are typically unique to the environment in which they are run. Use not_if"\
- " and only_if to guard this resource for idempotence."
-
def initialize(*args)
super
- @interpreter = "powershell.exe"
@default_guard_interpreter = resource_name
end
@@ -73,7 +76,7 @@ class Chef
# default for this resource, this method can be removed since
# guard context and recipe resource context will have the
# same behavior.
- def self.get_default_attributes(opts)
+ def self.get_default_attributes
{ convert_boolean_return: true }
end
end
diff --git a/lib/chef/resource/python.rb b/lib/chef/resource/python.rb
index 6c2aeee4b8..0b36ca0bbd 100644
--- a/lib/chef/resource/python.rb
+++ b/lib/chef/resource/python.rb
@@ -31,9 +31,9 @@ class Chef
description "Use the **python** resource to execute scripts using the Python interpreter."\
" This resource may also use any of the actions and properties that are available"\
- " to the execute resource. Commands that are executed with this resource are (by"\
+ " to the **execute** resource. Commands that are executed with this resource are (by"\
" their nature) not idempotent, as they are typically unique to the environment in"\
- " which they are run. Use not_if and only_if to guard this resource for idempotence."
+ " which they are run. Use `not_if` and `only_if` to guard this resource for idempotence."
end
end
end
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index 38a493cfae..6ac19e299b 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -17,7 +17,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -36,7 +36,7 @@ class Chef
property :reason, String,
description: "A string that describes the reboot action.",
- default: "Reboot by #{Chef::Dist::PRODUCT}"
+ default: "Reboot by #{ChefUtils::Dist::Infra::PRODUCT}"
property :delay_mins, Integer,
description: "The amount of time (in minutes) to delay a reboot request.",
diff --git a/lib/chef/resource/registry_key.rb b/lib/chef/resource/registry_key.rb
index 5cce4bd420..6c17146fcb 100644
--- a/lib/chef/resource/registry_key.rb
+++ b/lib/chef/resource/registry_key.rb
@@ -27,7 +27,96 @@ class Chef
provides(:registry_key) { true }
description "Use the **registry_key** resource to create and delete registry keys in Microsoft Windows."
- introduced "11.0"
+ examples <<~'DOC'
+ **Create a registry key**
+
+ ```ruby
+ registry_key 'HKEY_LOCAL_MACHINE\\path-to-key\\Policies\\System' do
+ values [{
+ name: 'EnableLUA',
+ type: :dword,
+ data: 0
+ }]
+ action :create
+ end
+ ```
+
+ **Create a registry key with binary data: "\x01\x02\x03"**:
+
+ ```ruby
+ registry_key 'HKEY_CURRENT_USER\ChefTest' do
+ values [{
+ :name => "test",
+ :type => :binary,
+ :data => [0, 1, 2].map(&:chr).join
+ }]
+ action :create
+ end
+ ```
+
+ **Create 32-bit key in redirected wow6432 tree**
+
+ In 64-bit versions of Microsoft Windows, HKEY_LOCAL_MACHINE\SOFTWARE\Example is a re-directed key. In the following examples, because HKEY_LOCAL_MACHINE\SOFTWARE\Example is a 32-bit key, the output will be “Found 32-bit key” if they are run on a version of Microsoft Windows that is 64-bit:
+
+ ```ruby
+ registry_key 'HKEY_LOCAL_MACHINE\SOFTWARE\Example' do
+ architecture :i386
+ recursive true
+ action :create
+ end
+ ```
+
+ **Set proxy settings to be the same as those used by Chef Infra Client**
+
+ ```ruby
+ proxy = URI.parse(Chef::Config[:http_proxy])
+ registry_key 'HKCU\Software\Microsoft\path\to\key\Internet Settings' do
+ values [{name: 'ProxyEnable', type: :reg_dword, data: 1},
+ {name: 'ProxyServer', data: "#{proxy.host}:#{proxy.port}"},
+ {name: 'ProxyOverride', type: :reg_string, data: <local>},
+ ]
+ action :create
+ end
+ ```
+
+ **Set the name of a registry key to "(Default)"**
+
+ ```ruby
+ registry_key 'Set (Default) value' do
+ key 'HKLM\Software\Test\Key\Path'
+ values [
+ {name: '', type: :string, data: 'test'},
+ ]
+ action :create
+ end
+ ```
+
+ **Delete a registry key value**
+
+ ```ruby
+ registry_key 'HKEY_LOCAL_MACHINE\SOFTWARE\path\to\key\AU' do
+ values [{
+ name: 'NoAutoRebootWithLoggedOnUsers',
+ type: :dword,
+ data: ''
+ }]
+ action :delete
+ end
+ ```
+
+ Note: If data: is not specified, you get an error: Missing data key in RegistryKey values hash
+
+ **Delete a registry key and its subkeys, recursively**
+
+ ```ruby
+ registry_key 'HKCU\SOFTWARE\Policies\path\to\key\Themes' do
+ recursive true
+ action :delete_key
+ end
+ ```
+
+ Note: Be careful when using the :delete_key action with the recursive attribute. This will delete the registry key, all of its values and all of the names, types, and data associated with them. This cannot be undone by Chef Infra Client.
+ DOC
state_attrs :values
@@ -72,6 +161,8 @@ class Chef
property :key, String, name_property: true
+ VALID_VALUE_HASH_KEYS = %i{name type data}.freeze
+
def values(arg = nil)
if not arg.nil?
if arg.is_a?(Hash)
@@ -89,7 +180,7 @@ class Chef
raise ArgumentError, "Missing name key in RegistryKey values hash" unless v.key?(:name)
v.each_key do |key|
- raise ArgumentError, "Bad key #{key} in RegistryKey values hash" unless %i{name type data}.include?(key)
+ raise ArgumentError, "Bad key #{key} in RegistryKey values hash" unless VALID_VALUE_HASH_KEYS.include?(key)
end
raise ArgumentError, "Type of name => #{v[:name]} should be string" unless v[:name].is_a?(String)
diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb
index b6dc0b7a98..b87fe8c085 100644
--- a/lib/chef/resource/remote_directory.rb
+++ b/lib/chef/resource/remote_directory.rb
@@ -29,7 +29,7 @@ class Chef
provides :remote_directory
- description "Use the **remote_directory** resource to incrementally transfer a directory from a cookbook to a node. The director that is copied from the cookbook should be located under COOKBOOK_NAME/files/default/REMOTE_DIRECTORY. The remote_directory resource will obey file specificity."
+ description "Use the **remote_directory** resource to incrementally transfer a directory from a cookbook to a node. The directory that is copied from the cookbook should be located under `COOKBOOK_NAME/files/default/REMOTE_DIRECTORY`. The `remote_directory` resource will obey file specificity."
default_action :create
allowed_actions :create, :create_if_missing, :delete
diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb
index d183fed64f..ac0b2fe6a7 100644
--- a/lib/chef/resource/remote_file.rb
+++ b/lib/chef/resource/remote_file.rb
@@ -22,7 +22,7 @@ require_relative "file"
require_relative "../provider/remote_file"
require_relative "../mixin/securable"
require_relative "../mixin/uris"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -74,7 +74,7 @@ class Chef
end
property :checksum, String,
- description: "Optional, see `use_conditional_get`. The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{Chef::Dist::PRODUCT} does not download it."
+ description: "Optional, see `use_conditional_get`. The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{ChefUtils::Dist::Infra::PRODUCT} does not download it."
# Disable or enable ETag and Last Modified conditional GET. Equivalent to
# use_etag(true_or_false)
@@ -93,7 +93,7 @@ class Chef
description: "Enable `If-Modified-Since` headers. Set to `false` to disable `If-Modified-Since` headers. To use this setting, `use_conditional_get` must also be set to `true`."
property :ftp_active_mode, [ TrueClass, FalseClass ], default: false,
- description: "Whether #{Chef::Dist::PRODUCT} uses active or passive FTP. Set to `true` to use active FTP."
+ description: "Whether #{ChefUtils::Dist::Infra::PRODUCT} uses active or passive FTP. Set to `true` to use active FTP."
property :headers, Hash, default: lazy { {} },
description: "A Hash of custom HTTP headers."
diff --git a/lib/chef/resource/rhsm_register.rb b/lib/chef/resource/rhsm_register.rb
index 7188cecbad..07c4dbc8d7 100644
--- a/lib/chef/resource/rhsm_register.rb
+++ b/lib/chef/resource/rhsm_register.rb
@@ -16,7 +16,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require "shellwords" unless defined?(Shellwords)
class Chef
@@ -47,6 +47,10 @@ class Chef
property :password, String,
description: "The password to use when registering. This property is not applicable if using an activation key. If specified, username and environment are also required."
+ property :system_name, String,
+ description: "The name of the system to register, defaults to the hostname.",
+ introduced: "16.5"
+
property :auto_attach,
[TrueClass, FalseClass],
description: "If true, RHSM will attempt to automatically attach the host to applicable subscriptions. It is generally better to use an activation key with the subscriptions pre-defined.",
@@ -61,7 +65,7 @@ class Chef
default: false, desired_state: false
property :https_for_ca_consumer, [TrueClass, FalseClass],
- description: "If true, #{Chef::Dist::PRODUCT} will fetch the katello-ca-consumer-latest.noarch.rpm from the satellite_host using HTTPS.",
+ description: "If true, #{ChefUtils::Dist::Infra::PRODUCT} will fetch the katello-ca-consumer-latest.noarch.rpm from the satellite_host using HTTPS.",
default: false, desired_state: false,
introduced: "15.9"
@@ -121,24 +125,30 @@ class Chef
end
action_class do
+ #
+ # @return [Symbol] dnf_package or yum_package depending on OS release
+ #
def package_resource
node["platform_version"].to_i >= 8 ? :dnf_package : :yum_package
end
+ #
+ # @return [Boolean] is the node registered with RHSM
+ #
def registered_with_rhsm?
- # FIXME: use shell_out
- cmd = Mixlib::ShellOut.new("subscription-manager status", env: { LANG: "en_US" })
- cmd.run_command
- !cmd.stdout.match(/Overall Status: Unknown/)
+ @registered ||= !shell_out("subscription-manager status").stdout.include?("Overall Status: Unknown")
end
+ #
+ # @return [Boolean] is katello-ca-consumer installed
+ #
def katello_cert_rpm_installed?
- # FIXME: use shell_out
- cmd = Mixlib::ShellOut.new("rpm -qa | grep katello-ca-consumer")
- cmd.run_command
- !cmd.stdout.match(/katello-ca-consumer/).nil?
+ shell_out("rpm -qa").stdout.include?("katello-ca-consumer")
end
+ #
+ # @return [String] The URI to fetch katello-ca-consumer-latest.noarch.rpm from
+ #
def ca_consumer_package_source
protocol = new_resource.https_for_ca_consumer ? "https" : "http"
"#{protocol}://#{new_resource.satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm"
@@ -153,6 +163,7 @@ class Chef
command << new_resource.activation_key.map { |key| "--activationkey=#{Shellwords.shellescape(key)}" }
command << "--org=#{Shellwords.shellescape(new_resource.organization)}"
+ command << "--name=#{Shellwords.shellescape(new_resource.system_name)}" if new_resource.system_name
command << "--force" if new_resource.force
return command.join(" ")
@@ -165,6 +176,7 @@ class Chef
command << "--username=#{Shellwords.shellescape(new_resource.username)}"
command << "--password=#{Shellwords.shellescape(new_resource.password)}"
command << "--environment=#{Shellwords.shellescape(new_resource.environment)}" if using_satellite_host?
+ command << "--name=#{Shellwords.shellescape(new_resource.system_name)}" if new_resource.system_name
command << "--auto-attach" if new_resource.auto_attach
command << "--force" if new_resource.force
diff --git a/lib/chef/resource/route.rb b/lib/chef/resource/route.rb
index 9df2031dcb..82f961679b 100644
--- a/lib/chef/resource/route.rb
+++ b/lib/chef/resource/route.rb
@@ -43,7 +43,7 @@ class Chef
description: "The route metric value."
property :netmask, [String, nil],
- description: "The decimal representation of the network mask. For example: 255.255.255.0."
+ description: "The decimal representation of the network mask. For example: `255.255.255.0`."
property :gateway, [String, nil],
description: "The gateway for the route."
diff --git a/lib/chef/resource/ruby.rb b/lib/chef/resource/ruby.rb
index ba5aec103b..2c0e65e9da 100644
--- a/lib/chef/resource/ruby.rb
+++ b/lib/chef/resource/ruby.rb
@@ -25,11 +25,7 @@ class Chef
provides :ruby
- description "Use the **ruby** resource to execute scripts using the Ruby interpreter. This"\
- " resource may also use any of the actions and properties that are available"\
- " to the execute resource. Commands that are executed with this resource are (by"\
- " their nature) not idempotent, as they are typically unique to the environment"\
- " in which they are run. Use not_if and only_if to guard this resource for idempotence."
+ description "Use the **ruby** resource to execute scripts using the Ruby interpreter. This resource may also use any of the actions and properties that are available to the **execute** resource. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` to guard this resource for idempotence."
def initialize(name, run_context = nil)
super
diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb
index 1fcebe090a..2d7d2fe8b6 100644
--- a/lib/chef/resource/ruby_block.rb
+++ b/lib/chef/resource/ruby_block.rb
@@ -19,7 +19,7 @@
require_relative "../resource"
require_relative "../provider/ruby_block"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -28,7 +28,7 @@ class Chef
provides :ruby_block, target_mode: true
- description "Use the **ruby_block** resource to execute Ruby code during a #{Chef::Dist::PRODUCT} run. Ruby code in the ruby_block resource is evaluated with other resources during convergence, whereas Ruby code outside of a ruby_block resource is evaluated before other resources, as the recipe is compiled."
+ description "Use the **ruby_block** resource to execute Ruby code during a #{ChefUtils::Dist::Infra::PRODUCT} run. Ruby code in the `ruby_block` resource is evaluated with other resources during convergence, whereas Ruby code outside of a `ruby_block` resource is evaluated before other resources, as the recipe is compiled."
default_action :run
allowed_actions :create, :run
diff --git a/lib/chef/resource/scm/_scm.rb b/lib/chef/resource/scm/_scm.rb
index c939246ba1..573d8b9b94 100644
--- a/lib/chef/resource/scm/_scm.rb
+++ b/lib/chef/resource/scm/_scm.rb
@@ -33,7 +33,8 @@ property :revision, String,
default: "HEAD"
property :user, [String, Integer],
- description: "The system user that will own the checked-out code."
+ description: "The system user that will own the checked-out code.",
+ default_description: "`HOME` environment variable of the user running #{ChefUtils::Dist::Infra::CLIENT}"
property :group, [String, Integer],
description: "The system group that will own the checked-out code."
diff --git a/lib/chef/resource/scm/git.rb b/lib/chef/resource/scm/git.rb
index b8c8f06347..8293d1ed4a 100644
--- a/lib/chef/resource/scm/git.rb
+++ b/lib/chef/resource/scm/git.rb
@@ -28,6 +28,87 @@ class Chef
provides :git
description "Use the **git** resource to manage source control resources that exist in a git repository. git version 1.6.5 (or higher) is required to use all of the functionality in the git resource."
+ examples <<~DOC
+ **Use the git mirror**
+
+ ```ruby
+ git '/opt/my_sources/couch' do
+ repository 'git://git.apache.org/couchdb.git'
+ revision 'master'
+ action :sync
+ end
+ ```
+
+ **Use different branches**
+
+ To use different branches, depending on the environment of the node:
+
+ ```ruby
+ branch_name = if node.chef_environment == 'QA'
+ 'staging'
+ else
+ 'master'
+ end
+
+ git '/home/user/deployment' do
+ repository 'git@github.com:git_site/deployment.git'
+ revision branch_name
+ action :sync
+ user 'user'
+ group 'test'
+ end
+ ```
+
+ Where the `branch_name` variable is set to staging or master, depending on the environment of the node. Once this is determined, the `branch_name` variable is used to set the revision for the repository. If the git status command is used after running the example above, it will return the branch name as `deploy`, as this is the default value. Run Chef Infra Client in debug mode to verify that the correct branches are being checked out:
+
+ ```
+ sudo chef-client -l debug
+ ```
+
+ **Install an application from git using bash**
+
+ The following example shows how Bash can be used to install a plug-in for rbenv named ruby-build, which is located in git version source control. First, the application is synchronized, and then Bash changes its working directory to the location in which ruby-build is located, and then runs a command.
+
+ ```ruby
+ git "#{Chef::Config[:file_cache_path]}/ruby-build" do
+ repository 'git://github.com/rbenv/ruby-build.git'
+ revision 'master'
+ action :sync
+ end
+
+ bash 'install_ruby_build' do
+ cwd "#{Chef::Config[:file_cache_path]}/ruby-build"
+ user 'rbenv'
+ group 'rbenv'
+ code <<-EOH
+ ./install.sh
+ EOH
+ environment 'PREFIX' => '/usr/local'
+ end
+ ```
+
+ **Notify a resource post-checkout**
+
+ ```ruby
+ git "#{Chef::Config[:file_cache_path]}/my_app" do
+ repository node['my_app']['git_repository']
+ revision node['my_app']['git_revision']
+ action :sync
+ notifies :run, 'bash[compile_my_app]', :immediately
+ end
+ ```
+
+ **Pass in environment variables**
+
+ ```ruby
+ git '/opt/my_sources/couch' do
+ repository 'git://git.apache.org/couchdb.git'
+ revision 'master'
+ environment 'VAR' => 'whatever'
+ action :sync
+ end
+ ```
+ DOC
property :additional_remotes, Hash,
description: "A Hash of additional remotes that are added to the git repository configuration.",
@@ -41,7 +122,7 @@ class Chef
default: false
property :enable_checkout, [TrueClass, FalseClass],
- description: "Check out a repo from master. Set to false when using the checkout_branch attribute to prevent the git resource from attempting to check out master from master.",
+ description: "Check out a repo from master. Set to `false` when using the `checkout_branch` attribute to prevent the git resource from attempting to check out `master` from `master`.",
default: true
property :remote, String,
diff --git a/lib/chef/resource/scm/subversion.rb b/lib/chef/resource/scm/subversion.rb
index 14360e9816..db20787aa5 100644
--- a/lib/chef/resource/scm/subversion.rb
+++ b/lib/chef/resource/scm/subversion.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require_relative "../../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -29,6 +29,18 @@ class Chef
provides :subversion
description "Use the **subversion** resource to manage source control resources that exist in a Subversion repository."
+ examples <<~DOC
+ **Get the latest version of an application**
+
+ ```ruby
+ subversion 'CouchDB Edge' do
+ repository 'http://svn.apache.org/repos/asf/couchdb/trunk'
+ revision 'HEAD'
+ destination '/opt/my_sources/couch'
+ action :sync
+ end
+ ```
+ DOC
allowed_actions :force_export
@@ -38,7 +50,7 @@ class Chef
default: "--no-auth-cache"
property :svn_info_args, [String, nil, FalseClass],
- description: "Use when the `svn info` command is used by #{Chef::Dist::PRODUCT} and arguments need to be passed. The `svn_arguments` command does not work when the `svn info` command is used.",
+ description: "Use when the `svn info` command is used by #{ChefUtils::Dist::Infra::PRODUCT} and arguments need to be passed. The `svn_arguments` command does not work when the `svn info` command is used.",
coerce: proc { |v| v == false ? nil : v }, # coerce false to nil
default: "--no-auth-cache"
diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb
index 93e30c6a0e..54468a534d 100644
--- a/lib/chef/resource/script.rb
+++ b/lib/chef/resource/script.rb
@@ -29,9 +29,9 @@ class Chef
identity_attr :name
description "Use the **script** resource to execute scripts using a specified interpreter, such as Bash, csh, Perl, Python, or Ruby."\
- " This resource may also use any of the actions and properties that are available to the execute resource. Commands"\
+ " This resource may also use any of the actions and properties that are available to the **execute** resource. Commands"\
" that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the"\
- " environment in which they are run. Use not_if and only_if to guard this resource for idempotence."
+ " environment in which they are run. Use `not_if` and `only_if` to guard this resource for idempotence."
def initialize(name, run_context = nil)
super
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb
index 9a6ad20ee8..63674a3c93 100644
--- a/lib/chef/resource/service.rb
+++ b/lib/chef/resource/service.rb
@@ -20,7 +20,7 @@
require "chef-utils/dsl/service" unless defined?(ChefUtils::DSL::Service)
require_relative "../resource"
require "shellwords" unless defined?(Shellwords)
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -39,7 +39,7 @@ class Chef
# this is a poor API please do not re-use this pattern
property :supports, Hash, default: { restart: nil, reload: nil, status: nil },
- description: "A list of properties that controls how #{Chef::Dist::PRODUCT} is to attempt to manage a service: :restart, :reload, :status. For :restart, the init script or other service provider can use a restart command; if :restart is not specified, the #{Chef::Dist::CLIENT} attempts to stop and then start a service. For :reload, the init script or other service provider can use a reload command. For :status, the init script or other service provider can use a status command to determine if the service is running; if :status is not specified, the #{Chef::Dist::CLIENT} attempts to match the service_name against the process table as a regular expression, unless a pattern is specified as a parameter property. Default value: { restart: false, reload: false, status: false } for all platforms (except for the Red Hat platform family, which defaults to { restart: false, reload: false, status: true }.)",
+ description: "A list of properties that controls how #{ChefUtils::Dist::Infra::PRODUCT} is to attempt to manage a service: :restart, :reload, :status. For :restart, the init script or other service provider can use a restart command; if :restart is not specified, the #{ChefUtils::Dist::Infra::CLIENT} attempts to stop and then start a service. For :reload, the init script or other service provider can use a reload command. For :status, the init script or other service provider can use a status command to determine if the service is running; if :status is not specified, the #{ChefUtils::Dist::Infra::CLIENT} attempts to match the service_name against the process table as a regular expression, unless a pattern is specified as a parameter property. Default value: { restart: false, reload: false, status: false } for all platforms (except for the Red Hat platform family, which defaults to { restart: false, reload: false, status: true }.)",
coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x }
property :service_name, String,
@@ -82,7 +82,7 @@ class Chef
# specify overrides for the start_command, stop_command and
# restart_command properties.
property :init_command, String,
- description: "The path to the init script that is associated with the service. Use init_command to prevent the need to specify overrides for the start_command, stop_command, and restart_command properties. When this property is not specified, the #{Chef::Dist::PRODUCT} will use the default init command for the service provider being used.",
+ description: "The path to the init script that is associated with the service. Use init_command to prevent the need to specify overrides for the start_command, stop_command, and restart_command properties. When this property is not specified, the #{ChefUtils::Dist::Infra::PRODUCT} will use the default init command for the service provider being used.",
desired_state: false
# if the service is enabled or not
diff --git a/lib/chef/resource/solaris_package.rb b/lib/chef/resource/solaris_package.rb
index c6f5d17ce9..381c62a45b 100644
--- a/lib/chef/resource/solaris_package.rb
+++ b/lib/chef/resource/solaris_package.rb
@@ -25,8 +25,6 @@ class Chef
unified_mode true
provides :solaris_package
- provides :package, os: "solaris2", platform_family: "nexentacore"
- provides :package, os: "solaris2", platform_family: "solaris2", platform_version: "<= 5.10"
description "Use the **solaris_package** resource to manage packages on the Solaris platform."
diff --git a/lib/chef/resource/ssh_known_hosts_entry.rb b/lib/chef/resource/ssh_known_hosts_entry.rb
index 533cb42279..1db811978c 100644
--- a/lib/chef/resource/ssh_known_hosts_entry.rb
+++ b/lib/chef/resource/ssh_known_hosts_entry.rb
@@ -18,7 +18,7 @@
# limitations under the License.
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -130,7 +130,7 @@ class Chef
# all this does is send an immediate run_action(:create) to the template resource
action :flush do
- description "Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the #{Chef::Dist::PRODUCT} run so all entries can be accumulated before writing the file out."
+ description "Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the #{ChefUtils::Dist::Infra::PRODUCT} run so all entries can be accumulated before writing the file out."
with_run_context :root do
# if you haven't ever called ssh_known_hosts_entry before you're definitely doing it wrong so we blow up hard.
diff --git a/lib/chef/resource/sudo.rb b/lib/chef/resource/sudo.rb
index 99bea022ef..d6587bd441 100644
--- a/lib/chef/resource/sudo.rb
+++ b/lib/chef/resource/sudo.rb
@@ -30,7 +30,7 @@ class Chef
description "Use the **sudo** resource to add or remove individual sudo entries using sudoers.d files."\
" Sudo version 1.7.2 or newer is required to use the sudo resource, as it relies on the"\
- " '#includedir' directive introduced in version 1.7.2. This resource does not enforce"\
+ " `#includedir` directive introduced in version 1.7.2. This resource does not enforce"\
" installation of the required sudo version. Chef-supported releases of Ubuntu, SuSE, Debian,"\
" and RHEL (6+) all support this feature."
introduced "14.0"
diff --git a/lib/chef/resource/support/client.erb b/lib/chef/resource/support/client.erb
new file mode 100644
index 0000000000..6507c74440
--- /dev/null
+++ b/lib/chef/resource/support/client.erb
@@ -0,0 +1,64 @@
+<% %w(@node_name
+ @chef_license
+ @chef_server_url
+ @event_loggers
+ @file_backup_path
+ @file_cache_path
+ @file_staging_uses_destdir
+ @formatters
+ @http_proxy
+ @https_proxy
+ @ftp_proxy
+ @log_level
+ @minimal_ohai
+ @named_run_list
+ @no_proxy
+ @ohai_disabled_plugins
+ @ohai_optional_plugins
+ @pid_file
+ @policy_group
+ @policy_name
+ @ssl_verify_mode).each do |prop| -%>
+<% next if instance_variable_get(prop).nil? || instance_variable_get(prop).empty? -%>
+<%=prop.delete_prefix("@") %> <%= instance_variable_get(prop).inspect %>
+<% end -%>
+<%# log_location is special due to STDOUT/STDERR from String -> IO Object -%>
+<% unless @log_location.nil? %>
+ <% if @log_location.is_a?(String) && %w(STDOUT STDERR).include?(@log_location) -%>
+log_location <%= @log_location %>
+ <% else -%>
+log_location <%= @log_location.inspect %>
+ <% end -%>
+<% end -%>
+<%# The code below is not DRY on purpose to improve readability -%>
+<% unless @start_handlers.empty? -%>
+ # Do not crash if a start handler is missing / not installed yet
+ begin
+ <% @start_handlers.each do |handler| -%>
+ start_handlers << <%= @handler %>
+ <% end -%>
+ rescue NameError => e
+ Chef::Log.error e
+ end
+<% end -%>
+<% unless @report_handlers.empty? -%>
+ # Do not crash if a report handler is missing / not installed yet
+ begin
+ <% @report_handlers.each do |handler| -%>
+ report_handlers << <%= @handler %>
+ <% end -%>
+ rescue NameError => e
+ Chef::Log.error e
+ end
+<% end -%>
+<% unless @exception_handlers.empty? -%>
+ # Do not crash if an exception handler is missing / not installed yet
+ begin
+ <% @exception_handlers.each do |handler| -%>
+ exception_handlers << <%= @handler %>
+ <% end -%>
+ rescue NameError => e
+ Chef::Log.error e
+ end
+<% end -%>
+<%= @additional_config -%>
diff --git a/lib/chef/resource/support/cron.d.erb b/lib/chef/resource/support/cron.d.erb
index a00b541cd1..579e64f405 100644
--- a/lib/chef/resource/support/cron.d.erb
+++ b/lib/chef/resource/support/cron.d.erb
@@ -1,4 +1,4 @@
-# Generated by <%= Chef::Dist::PRODUCT %>. Changes will be overwritten.
+# Generated by <%= ChefUtils::Dist::Infra::PRODUCT %>. Changes will be overwritten.
<% if @mailto -%>
MAILTO=<%= @mailto %>
<% end -%>
diff --git a/lib/chef/resource/support/cron_access.erb b/lib/chef/resource/support/cron_access.erb
index 5e5813457c..1f4e74ab23 100644
--- a/lib/chef/resource/support/cron_access.erb
+++ b/lib/chef/resource/support/cron_access.erb
@@ -1,4 +1,4 @@
-# Generated by <%= Chef::Dist::PRODUCT %>. Changes will be overwritten.
+# Generated by <%= ChefUtils::Dist::Infra::PRODUCT %>. Changes will be overwritten.
<% @users.sort.uniq.each do |user| -%>
<%= user %>
<% end -%>
diff --git a/lib/chef/resource/support/sudoer.erb b/lib/chef/resource/support/sudoer.erb
index 8c570affdc..f8c9760d94 100644
--- a/lib/chef/resource/support/sudoer.erb
+++ b/lib/chef/resource/support/sudoer.erb
@@ -1,4 +1,4 @@
-# This file is managed by <%= Chef::Dist::PRODUCT %>. Changes will be overwritten.
+# This file is managed by <%= ChefUtils::Dist::Infra::PRODUCT %>. Changes will be overwritten.
<% @command_aliases.each do |a| -%>
Cmnd_Alias <%= a[:name].upcase %> = <%= a[:command_list].join(', ') %>
diff --git a/lib/chef/resource/support/ulimit.erb b/lib/chef/resource/support/ulimit.erb
index 6abfc14e07..25ac0fde5c 100644
--- a/lib/chef/resource/support/ulimit.erb
+++ b/lib/chef/resource/support/ulimit.erb
@@ -1,4 +1,4 @@
-# Generated by <%= Chef::Dist::PRODUCT %>. Changes will be overwritten.
+# Generated by <%= ChefUtils::Dist::Infra::PRODUCT %>. Changes will be overwritten.
# Limits settings for <%= @ulimit_user %>
diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb
index 8b745f709e..bf9424f35f 100644
--- a/lib/chef/resource/sysctl.rb
+++ b/lib/chef/resource/sysctl.rb
@@ -25,11 +25,7 @@ class Chef
provides(:sysctl) { true }
provides(:sysctl_param) { true }
- description "Use the **sysctl** resource to set or remove kernel parameters using the sysctl"\
- " command line tool and configuration files in the system's sysctl.d directory. "\
- "Configuration files managed by this resource are named 99-chef-KEYNAME.conf. If"\
- " an existing value was already set for the value it will be backed up to the node"\
- " and restored if the :remove action is used later."
+ description "Use the **sysctl** resource to set or remove kernel parameters using the `sysctl` command line tool and configuration files in the system's `sysctl.d` directory. Configuration files managed by this resource are named `99-chef-KEYNAME.conf`."
examples <<~DOC
**Set vm.swappiness**:
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb
index 8bb14be636..b028214441 100644
--- a/lib/chef/resource/systemd_unit.rb
+++ b/lib/chef/resource/systemd_unit.rb
@@ -17,7 +17,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require "iniparse"
class Chef
@@ -27,8 +27,49 @@ class Chef
provides(:systemd_unit) { true }
- description "Use the **systemd_unit** resource to create, manage, and run systemd units."
+ description "Use the **systemd_unit** resource to create, manage, and run [systemd units](https://www.freedesktop.org/software/systemd/man/systemd.html#Concepts)."
introduced "12.11"
+ examples <<~DOC
+ **Create systemd service unit file from a Hash**
+
+ ```ruby
+ systemd_unit 'etcd.service' do
+ content({Unit: {
+ Description: 'Etcd',
+ Documentation: ['https://coreos.com/etcd', 'man:etcd(1)'],
+ After: 'network.target',
+ },
+ Service: {
+ Type: 'notify',
+ ExecStart: '/usr/local/etcd',
+ Restart: 'always',
+ },
+ Install: {
+ WantedBy: 'multi-user.target',
+ }})
+ action [:create, :enable]
+ end
+ ```
+
+ **Create systemd service unit file from a String**
+
+ ```ruby
+ systemd_unit 'sysstat-collect.timer' do
+ content <<~EOU
+ [Unit]
+ Description=Run system activity accounting tool every 10 minutes
+
+ [Timer]
+ OnCalendar=*:00/10
+
+ [Install]
+ WantedBy=sysstat.service
+ EOU
+
+ action [:create, :enable]
+ end
+ ```
+ DOC
default_action :nothing
allowed_actions :create, :delete,
@@ -52,7 +93,7 @@ class Chef
description: "The user account that the systemd unit process is run under. The path to the unit for that user would be something like '/etc/systemd/user/sshd.service'. If no user account is specified, the systemd unit will run under a 'system' account, with the path to the unit being something like '/etc/systemd/system/sshd.service'."
property :content, [String, Hash],
- description: "A string or hash that contains a systemd [unit file](https://www.freedesktop.org/software/systemd/man/systemd.unit.html) definition that describes the properties of systemd-managed entities, such as services, sockets, devices, and so on. In #{Chef::Dist::PRODUCT} 14.4 or later, repeatable options can be implemented with an array."
+ description: "A string or hash that contains a systemd [unit file](https://www.freedesktop.org/software/systemd/man/systemd.unit.html) definition that describes the properties of systemd-managed entities, such as services, sockets, devices, and so on. In #{ChefUtils::Dist::Infra::PRODUCT} 14.4 or later, repeatable options can be implemented with an array."
property :triggers_reload, [TrueClass, FalseClass],
description: "Specifies whether to trigger a daemon reload when creating or deleting a unit.",
diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb
index 0ffa2194d8..e3f266740d 100644
--- a/lib/chef/resource/template.rb
+++ b/lib/chef/resource/template.rb
@@ -20,7 +20,7 @@
require_relative "file"
require_relative "../mixin/securable"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -69,7 +69,7 @@ class Chef
property :local, [ TrueClass, FalseClass ],
default: false, desired_state: false,
- description: "Load a template from a local path. By default, the #{Chef::Dist::CLIENT} loads templates from a cookbook's /templates directory. When this property is set to true, use the source property to specify the path to a template on the local node."
+ description: "Load a template from a local path. By default, the #{ChefUtils::Dist::Infra::CLIENT} loads templates from a cookbook's /templates directory. When this property is set to true, use the source property to specify the path to a template on the local node."
# Declares a helper method to be defined in the template context when
# rendering.
@@ -169,8 +169,8 @@ class Chef
elsif module_name.nil?
raise Exceptions::ValidationFailed,
"#helpers requires either a module name or inline module code as a block.\n" +
- "e.g.: helpers do; helper_code; end;\n" +
- "OR: helpers(MyHelpersModule)"
+ "e.g.: helpers do; helper_code; end;\n" +
+ "OR: helpers(MyHelpersModule)"
else
raise Exceptions::ValidationFailed,
"Argument to #helpers must be a module. You gave #{module_name.inspect} (#{module_name.class})"
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb
index 40bf6ed3bb..731ce9333e 100644
--- a/lib/chef/resource/windows_ad_join.rb
+++ b/lib/chef/resource/windows_ad_join.rb
@@ -16,7 +16,7 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -76,10 +76,15 @@ class Chef
property :reboot, Symbol,
equal_to: %i{immediate delayed never request_reboot reboot_now},
- validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)",
- description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.",
+ validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{ChefUtils::Dist::Infra::PRODUCT} run completes), and :never (Don't reboot)",
+ description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the #{ChefUtils::Dist::Infra::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.",
default: :immediate
+ property :reboot_delay, Integer,
+ description: "The amount of time (in minutes) to delay a reboot request.",
+ default: 0,
+ introduced: "16.5"
+
property :new_hostname, String,
description: "Specifies a new hostname for the computer in the new domain.",
introduced: "14.5"
@@ -104,18 +109,19 @@ class Chef
cmd << " -Force"
converge_by("join Active Directory domain #{new_resource.domain_name}") do
- ps_run = powershell_out(cmd)
+ ps_run = powershell_exec(cmd)
if ps_run.error?
if sensitive?
raise "Failed to join the domain #{new_resource.domain_name}: *suppressed sensitive resource output*"
else
- raise "Failed to join the domain #{new_resource.domain_name}: #{ps_run.stderr}"
+ raise "Failed to join the domain #{new_resource.domain_name}: #{ps_run.errors}"
end
end
unless new_resource.reboot == :never
reboot "Reboot to join domain #{new_resource.domain_name}" do
action clarify_reboot(new_resource.reboot)
+ delay_mins new_resource.reboot_delay
reason "Reboot to join domain #{new_resource.domain_name}"
end
end
@@ -137,18 +143,19 @@ class Chef
cmd << " -Force"
converge_by("leave Active Directory domain #{node_domain}") do
- ps_run = powershell_out(cmd)
+ ps_run = powershell_exec(cmd)
if ps_run.error?
if sensitive?
raise "Failed to leave the domain #{node_domain}: *suppressed sensitive resource output*"
else
- raise "Failed to leave the domain #{node_domain}: #{ps_run.stderr}"
+ raise "Failed to leave the domain #{node_domain}: #{ps_run.errors}"
end
end
unless new_resource.reboot == :never
reboot "Reboot to leave domain #{new_resource.domain_name}" do
action clarify_reboot(new_resource.reboot)
+ delay_mins new_resource.reboot_delay
reason "Reboot to leave domain #{new_resource.domain_name}"
end
end
@@ -163,10 +170,10 @@ class Chef
# workgroup the node is a member of.
#
def node_domain
- node_domain = powershell_out!("(Get-WmiObject Win32_ComputerSystem).Domain")
- raise "Failed to check if the system is joined to the domain #{new_resource.domain_name}: #{node_domain.stderr}}" if node_domain.error?
+ node_domain = powershell_exec!("(Get-WmiObject Win32_ComputerSystem).Domain")
+ raise "Failed to check if the system is joined to the domain #{new_resource.domain_name}: #{node_domain.errors}}" if node_domain.error?
- node_domain.stdout.downcase.strip
+ node_domain.result.downcase.strip
end
#
@@ -175,10 +182,10 @@ class Chef
# workgroup.
#
def node_workgroup
- node_workgroup = powershell_out!("(Get-WmiObject Win32_ComputerSystem).Workgroup")
+ node_workgroup = powershell_exec!("(Get-WmiObject Win32_ComputerSystem).Workgroup")
raise "Failed to check if the system is currently a member of a workgroup" if node_workgroup.error?
- node_workgroup.stdout.downcase.strip
+ node_workgroup.result
end
#
diff --git a/lib/chef/resource/windows_audit_policy.rb b/lib/chef/resource/windows_audit_policy.rb
index 230dd3eb80..433e18e197 100644
--- a/lib/chef/resource/windows_audit_policy.rb
+++ b/lib/chef/resource/windows_audit_policy.rb
@@ -152,30 +152,6 @@ class Chef
property :audit_base_directories, [true, false],
description: "Setting this audit policy option to true will force the system to assign a System Access Control List to named objects to enable auditing of container objects such as directories."
- def subcategory_configured?(sub_cat, success_value, failure_value)
- setting = if success_value && failure_value
- "Success and Failure$"
- elsif success_value && !failure_value
- "Success$"
- elsif !success_value && failure_value
- "(Failure$)&!(Success and Failure$)"
- else
- "No Auditing"
- end
- powershell_exec(<<-CODE).result
- $auditpol_config = auditpol /get /subcategory:"#{sub_cat}"
- if ($auditpol_config | Select-String "#{setting}") { return $true } else { return $false }
- CODE
- end
-
- def option_configured?(option_name, option_setting)
- setting = option_setting ? "Enabled$" : "Disabled$"
- powershell_exec(<<-CODE).result
- $auditpol_config = auditpol /get /option:#{option_name}
- if ($auditpol_config | Select-String "#{setting}") { return $true } else { return $false }
- CODE
- end
-
action :set do
unless new_resource.subcategory.nil?
new_resource.subcategory.each do |subcategory|
@@ -225,6 +201,32 @@ class Chef
end
end
end
+
+ action_class do
+ def subcategory_configured?(sub_cat, success_value, failure_value)
+ setting = if success_value && failure_value
+ "Success and Failure$"
+ elsif success_value && !failure_value
+ "Success$"
+ elsif !success_value && failure_value
+ "#{sub_cat}\\s+Failure$"
+ else
+ "No Auditing"
+ end
+ powershell_exec!(<<-CODE).result
+ $auditpol_config = auditpol /get /subcategory:"#{sub_cat}"
+ if ($auditpol_config | Select-String "#{setting}") { return $true } else { return $false }
+ CODE
+ end
+
+ def option_configured?(option_name, option_setting)
+ setting = option_setting ? "Enabled$" : "Disabled$"
+ powershell_exec!(<<-CODE).result
+ $auditpol_config = auditpol /get /option:#{option_name}
+ if ($auditpol_config | Select-String "#{setting}") { return $true } else { return $false }
+ CODE
+ end
+ end
end
end
end
diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb
index ce1bcede40..930c5ae6a4 100644
--- a/lib/chef/resource/windows_certificate.rb
+++ b/lib/chef/resource/windows_certificate.rb
@@ -19,9 +19,11 @@
require_relative "../util/path_helper"
require_relative "../resource"
-require "win32-certstore" if Chef::Platform.windows?
-require "openssl" unless defined?(OpenSSL)
-require_relative "../dist"
+module Win32
+ autoload :Certstore, "win32-certstore" if Chef::Platform.windows?
+end
+autoload :OpenSSL, "openssl"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -78,13 +80,18 @@ class Chef
default: false
property :cert_path, String,
- description: ""
+ description: "The path to the certificate."
# lazy used to set default value of sensitive to true if password is set
property :sensitive, [TrueClass, FalseClass],
- description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.",
+ description: "Ensure that sensitive resource data is not logged by the #{ChefUtils::Dist::Infra::CLIENT}.",
default: lazy { pfx_password ? true : false }, skip_docs: true
+ property :exportable, [TrueClass, FalseClass],
+ description: "Ensure that imported pfx certificate is exportable. Please provide 'true' if you want the certificate to be exportable.",
+ default: false,
+ introduced: "16.8"
+
action :create do
description "Creates or updates a certificate."
@@ -160,8 +167,9 @@ class Chef
end
def add_pfx_cert
+ exportable = new_resource.exportable ? 1 : 0
store = ::Win32::Certstore.open(new_resource.store_name)
- store.add_pfx(new_resource.source, new_resource.pfx_password)
+ store.add_pfx(new_resource.source, new_resource.pfx_password, exportable)
end
def delete_cert
@@ -205,16 +213,16 @@ class Chef
when ".der"
out_file.puts(cert_obj.to_der)
when ".cer"
- cert_out = powershell_out("openssl x509 -text -inform DER -in #{cert_obj.to_pem} -outform CER").stdout
+ cert_out = shell_out("openssl x509 -text -inform DER -in #{cert_obj.to_pem} -outform CER").stdout
out_file.puts(cert_out)
when ".crt"
- cert_out = powershell_out("openssl x509 -text -inform DER -in #{cert_obj.to_pem} -outform CRT").stdout
+ cert_out = shell_out("openssl x509 -text -inform DER -in #{cert_obj.to_pem} -outform CRT").stdout
out_file.puts(cert_out)
when ".pfx"
- cert_out = powershell_out("openssl pkcs12 -export -nokeys -in #{cert_obj.to_pem} -outform PFX").stdout
+ cert_out = shell_out("openssl pkcs12 -export -nokeys -in #{cert_obj.to_pem} -outform PFX").stdout
out_file.puts(cert_out)
when ".p7b"
- cert_out = powershell_out("openssl pkcs7 -export -nokeys -in #{cert_obj.to_pem} -outform P7B").stdout
+ cert_out = shell_out("openssl pkcs7 -export -nokeys -in #{cert_obj.to_pem} -outform P7B").stdout
out_file.puts(cert_out)
else
Chef::Log.info("Supported certificate format .pem, .der, .cer, .crt, .pfx and .p7b")
@@ -325,7 +333,7 @@ class Chef
# @return [Boolean] Whether the certificate file is binary encoded or not
#
def binary_cert?
- powershell_out!("file -b --mime-encoding #{new_resource.source}").stdout.strip == "binary"
+ shell_out!("file -b --mime-encoding #{new_resource.source}").stdout.strip == "binary"
end
# Imports the certificate object into cert store
diff --git a/lib/chef/resource/windows_dfs_server.rb b/lib/chef/resource/windows_dfs_server.rb
index 84b2a18c91..fc161f8189 100644
--- a/lib/chef/resource/windows_dfs_server.rb
+++ b/lib/chef/resource/windows_dfs_server.rb
@@ -49,14 +49,14 @@ class Chef
default: 3600
load_current_value do
- ps_results = powershell_out("Get-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' | Select LdapTimeoutSec, PreferLogonDC, EnableSiteCostedReferrals, SyncIntervalSec, UseFqdn | ConvertTo-Json")
+ ps_results = powershell_exec("Get-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' | Select LdapTimeoutSec, PreferLogonDC, EnableSiteCostedReferrals, SyncIntervalSec, UseFqdn")
if ps_results.error?
raise "The dfs_server resource failed to fetch the current state via the Get-DfsnServerConfiguration PowerShell cmdlet. Is the DFS Windows feature installed?"
end
- Chef::Log.debug("The Get-DfsnServerConfiguration results were #{ps_results.stdout}")
- results = Chef::JSONCompat.from_json(ps_results.stdout)
+ Chef::Log.debug("The Get-DfsnServerConfiguration results were #{ps_results.result}")
+ results = ps_results.result
use_fqdn results["UseFqdn"] || false
ldap_timeout_secs results["LdapTimeoutSec"]
@@ -69,7 +69,10 @@ class Chef
description "Configure DFS settings."
converge_if_changed do
- powershell_out("Set-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' EnableSiteCostedReferrals $#{new_resource.enable_site_costed_referrals} -UseFqdn $#{new_resource.use_fqdn} -LdapTimeoutSec #{new_resource.ldap_timeout_secs} -PreferLogonDC $#{new_resource.prefer_login_dc} -SyncIntervalSec #{new_resource.sync_interval_secs}")
+ dfs_cmd = "Set-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' -UseFqdn $#{new_resource.use_fqdn} -LdapTimeoutSec #{new_resource.ldap_timeout_secs} -SyncIntervalSec #{new_resource.sync_interval_secs}"
+ dfs_cmd << " -EnableSiteCostedReferrals $#{new_resource.enable_site_costed_referrals}" if new_resource.enable_site_costed_referrals != current_resource.enable_site_costed_referrals
+ dfs_cmd << " -PreferLogonDC $#{new_resource.prefer_login_dc}" if new_resource.prefer_login_dc != current_resource.prefer_login_dc
+ powershell_exec!(dfs_cmd)
end
end
end
diff --git a/lib/chef/resource/windows_env.rb b/lib/chef/resource/windows_env.rb
index 35070d6623..ab65465ed6 100644
--- a/lib/chef/resource/windows_env.rb
+++ b/lib/chef/resource/windows_env.rb
@@ -18,10 +18,13 @@
#
require_relative "../resource"
+require_relative "../mixin/windows_env_helper"
class Chef
class Resource
class WindowsEnv < Chef::Resource
+ unified_mode true
+
provides :windows_env
provides :env # backwards compat with the pre-Chef 14 resource name
@@ -52,6 +55,176 @@ class Chef
desired_state: false
property :user, String, default: "<System>"
+
+ action_class do
+ include Chef::Mixin::WindowsEnvHelper
+
+ def whyrun_supported?
+ false
+ end
+
+ def load_current_resource
+ @current_resource = Chef::Resource::WindowsEnv.new(new_resource.name)
+ current_resource.key_name(new_resource.key_name)
+
+ if key_exists?
+ current_resource.value(env_value(new_resource.key_name))
+ else
+ logger.trace("#{new_resource} key does not exist")
+ end
+
+ current_resource
+ end
+
+ def key_exists?
+ @key_exists ||= !!env_value(new_resource.key_name)
+ end
+
+ def requires_modify_or_create?
+ if new_resource.delim
+ # e.g. check for existing value within PATH
+ new_values.inject(0) do |index, val|
+ next_index = current_values.find_index val
+ return true if next_index.nil? || next_index < index
+
+ next_index
+ end
+ false
+ else
+ new_resource.value != current_resource.value
+ end
+ end
+
+ alias_method :compare_value, :requires_modify_or_create?
+
+ # e.g. delete a PATH element
+ #
+ # ==== Returns
+ # <true>:: If we handled the element case and caller should not delete the key
+ # <false>:: Caller should delete the key, either no :delim was specific or value was empty
+ # after we removed the element.
+ def delete_element
+ return false unless new_resource.delim # no delim: delete the key
+
+ needs_delete = new_values.any? { |v| current_values.include?(v) }
+ if !needs_delete
+ logger.trace("#{new_resource} element '#{new_resource.value}' does not exist")
+ true # do not delete the key
+ else
+ new_value =
+ current_values.select do |item|
+ not new_values.include?(item)
+ end.join(new_resource.delim)
+
+ if new_value.empty?
+ false # nothing left here, delete the key
+ else
+ old_value = new_resource.value(new_value)
+ create_env
+ logger.trace("#{new_resource} deleted #{old_value} element")
+ new_resource.updated_by_last_action(true)
+ true # we removed the element and updated; do not delete the key
+ end
+ end
+ end
+
+ def create_env
+ obj = env_obj(@new_resource.key_name)
+ unless obj
+ obj = WIN32OLE.connect("winmgmts://").get("Win32_Environment").spawninstance_
+ obj.name = @new_resource.key_name
+ obj.username = new_resource.user
+ end
+ obj.variablevalue = @new_resource.value
+ obj.put_
+ value = @new_resource.value
+ value = expand_path(value) if @new_resource.key_name.casecmp("PATH") == 0
+ ENV[@new_resource.key_name] = value
+ broadcast_env_change
+ end
+
+ def delete_env
+ obj = env_obj(@new_resource.key_name)
+ if obj
+ obj.delete_
+ broadcast_env_change
+ end
+ if ENV[@new_resource.key_name]
+ ENV.delete(@new_resource.key_name)
+ end
+ end
+
+ def modify_env
+ if new_resource.delim
+ new_resource.value((new_values + current_values).uniq.join(new_resource.delim))
+ end
+ create_env
+ end
+
+ # Returns the current values to split by delimiter
+ def current_values
+ @current_values ||= current_resource.value.split(new_resource.delim)
+ end
+
+ # Returns the new values to split by delimiter
+ def new_values
+ @new_values ||= new_resource.value.split(new_resource.delim)
+ end
+
+ def env_value(key_name)
+ obj = env_obj(key_name)
+ obj.variablevalue if obj
+ end
+
+ def env_obj(key_name)
+ return @env_obj if @env_obj
+
+ wmi = WmiLite::Wmi.new
+ # Note that by design this query is case insensitive with regard to key_name
+ environment_variables = wmi.query("select * from Win32_Environment where name = '#{key_name}'")
+ if environment_variables && environment_variables.length > 0
+ environment_variables.each do |env|
+ @env_obj = env.wmi_ole_object
+ return @env_obj if @env_obj.username.split('\\').last.casecmp(new_resource.user) == 0
+ end
+ end
+ @env_obj = nil
+ end
+ end
+
+ action :create do
+ if key_exists?
+ if requires_modify_or_create?
+ modify_env
+ logger.info("#{new_resource} altered")
+ new_resource.updated_by_last_action(true)
+ end
+ else
+ create_env
+ logger.info("#{new_resource} created")
+ new_resource.updated_by_last_action(true)
+ end
+ end
+
+ action :delete do
+ if ( ENV[new_resource.key_name] || key_exists? ) && !delete_element
+ delete_env
+ logger.info("#{new_resource} deleted")
+ new_resource.updated_by_last_action(true)
+ end
+ end
+
+ action :modify do
+ if key_exists?
+ if requires_modify_or_create?
+ modify_env
+ logger.info("#{new_resource} modified")
+ new_resource.updated_by_last_action(true)
+ end
+ else
+ raise Chef::Exceptions::WindowsEnv, "Cannot modify #{new_resource} - key does not exist!"
+ end
+ end
end
end
end
diff --git a/lib/chef/resource/windows_feature.rb b/lib/chef/resource/windows_feature.rb
index aa90f67a37..760a7fe3f1 100644
--- a/lib/chef/resource/windows_feature.rb
+++ b/lib/chef/resource/windows_feature.rb
@@ -21,6 +21,8 @@ require_relative "../resource"
class Chef
class Resource
class WindowsFeature < Chef::Resource
+ unified_mode true
+
provides(:windows_feature) { true }
description "Use the **windows_feature** resource to add, remove or entirely delete Windows features and roles. This resource calls the 'windows_feature_dism' or 'windows_feature_powershell' resources depending on the specified installation method, and defaults to DISM, which is available on both Workstation and Server editions of Windows."
diff --git a/lib/chef/resource/windows_firewall_profile.rb b/lib/chef/resource/windows_firewall_profile.rb
index b90d9fd4d5..ada9729699 100644
--- a/lib/chef/resource/windows_firewall_profile.rb
+++ b/lib/chef/resource/windows_firewall_profile.rb
@@ -19,8 +19,6 @@
class Chef
class Resource
class WindowsFirewallProfile < Chef::Resource
- unified_mode true
-
provides :windows_firewall_profile
description "Use the **windows_firewall_profile** resource to enable, disable, and configure the Windows firewall."
introduced "16.3"
@@ -85,11 +83,11 @@ class Chef
load_current_value do |desired|
ps_get_net_fw_profile = load_firewall_state(desired.profile)
- output = powershell_out(ps_get_net_fw_profile)
- if output.stdout.empty?
+ output = powershell_exec(ps_get_net_fw_profile)
+ if output.result.empty?
current_value_does_not_exist!
else
- state = Chef::JSONCompat.from_json(output.stdout)
+ state = output.result
end
default_inbound_action state["default_inbound_action"]
@@ -132,7 +130,7 @@ class Chef
unless firewall_enabled?(new_resource.profile)
converge_by "Enable the #{new_resource.profile} Firewall Profile" do
cmd = "Set-NetFirewallProfile -Profile #{new_resource.profile} -Enabled \"True\""
- powershell_out!(cmd)
+ powershell_exec!(cmd)
end
end
end
@@ -141,7 +139,7 @@ class Chef
if firewall_enabled?(new_resource.profile)
converge_by "Disable the #{new_resource.profile} Firewall Profile" do
cmd = "Set-NetFirewallProfile -Profile #{new_resource.profile} -Enabled \"False\""
- powershell_out!(cmd)
+ powershell_exec!(cmd)
end
end
end
@@ -161,24 +159,6 @@ class Chef
cmd
end
- def load_firewall_state(profile_name)
- <<-EOH
- Remove-TypeData System.Array # workaround for PS bug here: https://bit.ly/2SRMQ8M
- $#{profile_name} = Get-NetFirewallProfile -Profile #{profile_name}
- ([PSCustomObject]@{
- default_inbound_action = $#{profile_name}.DefaultInboundAction.ToString()
- default_outbound_action = $#{profile_name}.DefaultOutboundAction.ToString()
- allow_inbound_rules = $#{profile_name}.AllowInboundRules.ToString()
- allow_local_firewall_rules = $#{profile_name}.AllowLocalFirewallRules.ToString()
- allow_local_ipsec_rules = $#{profile_name}.AllowLocalIPsecRules.ToString()
- allow_user_apps = $#{profile_name}.AllowUserApps.ToString()
- allow_user_ports = $#{profile_name}.AllowUserPorts.ToString()
- allow_unicast_response = $#{profile_name}.AllowUnicastResponseToMulticast.ToString()
- display_notification = $#{profile_name}.NotifyOnListen.ToString()
- }) | ConvertTo-Json
- EOH
- end
-
def firewall_enabled?(profile_name)
cmd = <<~CODE
$#{profile_name} = Get-NetFirewallProfile -Profile #{profile_name}
@@ -186,14 +166,31 @@ class Chef
return $true
} else {return $false}
CODE
- firewall_status = powershell_out(cmd).stdout
- if /True/.match?(firewall_status)
- true
- elsif /False/.match?(firewall_status)
- false
- end
+ powershell_exec!(cmd).result
end
end
+
+ private
+
+ # build the command to load the current resource
+ # @return [String] current firewall state
+ def load_firewall_state(profile_name)
+ <<-EOH
+ Remove-TypeData System.Array # workaround for PS bug here: https://bit.ly/2SRMQ8M
+ $#{profile_name} = Get-NetFirewallProfile -Profile #{profile_name}
+ ([PSCustomObject]@{
+ default_inbound_action = $#{profile_name}.DefaultInboundAction.ToString()
+ default_outbound_action = $#{profile_name}.DefaultOutboundAction.ToString()
+ allow_inbound_rules = $#{profile_name}.AllowInboundRules.ToString()
+ allow_local_firewall_rules = $#{profile_name}.AllowLocalFirewallRules.ToString()
+ allow_local_ipsec_rules = $#{profile_name}.AllowLocalIPsecRules.ToString()
+ allow_user_apps = $#{profile_name}.AllowUserApps.ToString()
+ allow_user_ports = $#{profile_name}.AllowUserPorts.ToString()
+ allow_unicast_response = $#{profile_name}.AllowUnicastResponseToMulticast.ToString()
+ display_notification = $#{profile_name}.NotifyOnListen.ToString()
+ })
+ EOH
+ end
end
end
end
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb
index 2010c15f89..a6f0614362 100644
--- a/lib/chef/resource/windows_firewall_rule.rb
+++ b/lib/chef/resource/windows_firewall_rule.rb
@@ -19,8 +19,6 @@
# limitations under the License.
#
-require_relative "../json_compat"
-
class Chef
class Resource
class WindowsFirewallRule < Chef::Resource
@@ -159,11 +157,11 @@ class Chef
load_current_value do
load_state_cmd = load_firewall_state(rule_name)
- output = powershell_out(load_state_cmd)
- if output.stdout.empty?
+ output = powershell_exec(load_state_cmd)
+ if output.result.empty?
current_value_does_not_exist!
else
- state = Chef::JSONCompat.from_json(output.stdout)
+ state = output.result
end
# Need to reverse `$rule.Profile.ToString()` in powershell command
@@ -194,17 +192,17 @@ class Chef
:remote_port, :direction, :protocol, :icmp_type, :firewall_action, :profile, :program, :service,
:interface_type, :enabled do
cmd = firewall_command("Set")
- powershell_out!(cmd)
+ powershell_exec!(cmd)
end
converge_if_changed :group do
- powershell_out!("Remove-NetFirewallRule -Name '#{new_resource.rule_name}'")
+ powershell_exec!("Remove-NetFirewallRule -Name '#{new_resource.rule_name}'")
cmd = firewall_command("New")
- powershell_out!(cmd)
+ powershell_exec!(cmd)
end
else
converge_by("create firewall rule #{new_resource.rule_name}") do
cmd = firewall_command("New")
- powershell_out!(cmd)
+ powershell_exec!(cmd)
end
end
end
@@ -214,7 +212,7 @@ class Chef
if current_resource
converge_by("delete firewall rule #{new_resource.rule_name}") do
- powershell_out!("Remove-NetFirewallRule -Name '#{new_resource.rule_name}'")
+ powershell_exec!("Remove-NetFirewallRule -Name '#{new_resource.rule_name}'")
end
else
Chef::Log.info("Firewall rule \"#{new_resource.rule_name}\" doesn't exist. Skipping.")
@@ -320,7 +318,7 @@ class Chef
service = $serviceFilter.Service
interface_type = $interfaceTypeFilter.InterfaceType.ToString()
enabled = [bool]::Parse($rule.Enabled.ToString())
- }) | ConvertTo-Json
+ })
EOH
end
end
diff --git a/lib/chef/resource/windows_font.rb b/lib/chef/resource/windows_font.rb
index afc8a7a987..c9128aa4b0 100644
--- a/lib/chef/resource/windows_font.rb
+++ b/lib/chef/resource/windows_font.rb
@@ -32,7 +32,7 @@ class Chef
```ruby
windows_font 'Custom.otf' do
- source "https://example.com/Custom.otf"
+ source 'https://example.com/Custom.otf'
end
```
DOC
diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb
index b11567311f..0072d70656 100644
--- a/lib/chef/resource/windows_package.rb
+++ b/lib/chef/resource/windows_package.rb
@@ -20,12 +20,13 @@ require_relative "../mixin/uris"
require_relative "package"
require_relative "../provider/package/windows"
require_relative "../win32/error" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
class WindowsPackage < Chef::Resource::Package
include Chef::Mixin::Uris
+ unified_mode true
provides(:windows_package) { true }
provides :package, os: "windows"
@@ -162,7 +163,7 @@ class Chef
property :checksum, String,
desired_state: false, coerce: (proc { |c| c.downcase }),
- description: "The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{Chef::Dist::PRODUCT} does not download it. Use when a URL is specified by the `source` property."
+ description: "The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{ChefUtils::Dist::Infra::PRODUCT} does not download it. Use when a URL is specified by the `source` property."
property :remote_file_attributes, Hash,
desired_state: false,
diff --git a/lib/chef/resource/windows_path.rb b/lib/chef/resource/windows_path.rb
index 850be66ba0..870ffdef3f 100644
--- a/lib/chef/resource/windows_path.rb
+++ b/lib/chef/resource/windows_path.rb
@@ -16,11 +16,15 @@
# limitations under the License.
#
+require_relative "../mixin/windows_env_helper" if ChefUtils.windows?
+require_relative "../mixin/wide_string"
require_relative "../resource"
class Chef
class Resource
class WindowsPath < Chef::Resource
+ unified_mode true
+
provides(:windows_path) { true }
description "Use the **windows_path** resource to manage the path environment variable on Microsoft Windows."
@@ -49,6 +53,40 @@ class Chef
property :path, String,
description: "An optional property to set the path value if it differs from the resource block's name.",
name_property: true
+
+ action_class do
+ include Chef::Mixin::WindowsEnvHelper if ChefUtils.windows?
+
+ def load_current_resource
+ @current_resource = Chef::Resource::WindowsPath.new(new_resource.name)
+ @current_resource.path(new_resource.path)
+ @current_resource
+ end
+ end
+
+ action :add do
+ # The windows Env provider does not correctly expand variables in
+ # the PATH environment variable. Ruby expects these to be expanded.
+ #
+ path = expand_path(new_resource.path)
+ env "path" do
+ action :modify
+ delim ::File::PATH_SEPARATOR
+ value path.tr("/", '\\')
+ end
+ end
+
+ action :remove do
+ # The windows Env provider does not correctly expand variables in
+ # the PATH environment variable. Ruby expects these to be expanded.
+ #
+ path = expand_path(new_resource.path)
+ env "path" do
+ action :delete
+ delim ::File::PATH_SEPARATOR
+ value path.tr("/", '\\')
+ end
+ end
end
end
end
diff --git a/lib/chef/resource/windows_printer.rb b/lib/chef/resource/windows_printer.rb
index 947477baeb..dea15ba112 100644
--- a/lib/chef/resource/windows_printer.rb
+++ b/lib/chef/resource/windows_printer.rb
@@ -24,7 +24,7 @@ class Chef
class WindowsPrinter < Chef::Resource
unified_mode true
- require "resolv"
+ autoload :Resolv, "resolv"
provides(:windows_printer) { true }
@@ -78,8 +78,10 @@ class Chef
property :ipv4_address, String,
description: "The IPv4 address of the printer, such as `10.4.64.23`",
- validation_message: "The ipv4_address property must be in the IPv4 format of `WWW.XXX.YYY.ZZZ`",
- regex: Resolv::IPv4::Regex
+ callbacks: {
+ "The ipv4_address property must be in the IPv4 format of `WWW.XXX.YYY.ZZZ`" =>
+ proc { |v| v.match(Resolv::IPv4::Regex) },
+ }
PRINTERS_REG_KEY = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\\'.freeze unless defined?(PRINTERS_REG_KEY)
diff --git a/lib/chef/resource/windows_printer_port.rb b/lib/chef/resource/windows_printer_port.rb
index 1b3f8753ba..2a4eaa09b3 100644
--- a/lib/chef/resource/windows_printer_port.rb
+++ b/lib/chef/resource/windows_printer_port.rb
@@ -24,7 +24,7 @@ class Chef
class WindowsPrinterPort < Chef::Resource
unified_mode true
- require "resolv"
+ autoload :Resolv, "resolv"
provides(:windows_printer_port) { true }
@@ -61,9 +61,11 @@ class Chef
property :ipv4_address, String,
name_property: true,
- regex: Resolv::IPv4::Regex,
- validation_message: "The ipv4_address property must be in the format of WWW.XXX.YYY.ZZZ!",
- description: "An optional property for the IPv4 address of the printer if it differs from the resource block's name."
+ description: "An optional property for the IPv4 address of the printer if it differs from the resource block's name.",
+ callbacks: {
+ "The ipv4_address property must be in the format of WWW.XXX.YYY.ZZZ!" =>
+ proc { |v| v.match(Resolv::IPv4::Regex) },
+ }
property :port_name, String,
description: "The port name."
diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb
index 069f240ce5..1b0a285197 100644
--- a/lib/chef/resource/windows_security_policy.rb
+++ b/lib/chef/resource/windows_security_policy.rb
@@ -106,11 +106,11 @@ class Chef
MinimumPasswordAge = $security_options_hash.MinimumPasswordAge
NewGuestName = $security_options_hash.NewGuestName
LockoutBadCount = $security_options_hash.LockoutBadCount
- }) | ConvertTo-Json
+ })
CODE
- output = powershell_out(powershell_code)
- current_value_does_not_exist! if output.stdout.empty?
- state = Chef::JSONCompat.from_json(output.stdout)
+ output = powershell_exec(powershell_code)
+ current_value_does_not_exist! if output.result.empty?
+ state = output.result
if desired.secoption == "ResetLockoutCount" || desired.secoption == "LockoutDuration"
if state["LockoutBadCount"] == "0"
@@ -144,7 +144,7 @@ class Chef
Remove-Item $env:TEMP\\#{security_option}_Export.inf -force
EOH
- powershell_out!(cmd)
+ powershell_exec!(cmd)
end
end
end
diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb
index defdf9fe29..779c0e22ad 100644
--- a/lib/chef/resource/windows_service.rb
+++ b/lib/chef/resource/windows_service.rb
@@ -23,6 +23,7 @@ class Chef
class Resource
class WindowsService < Chef::Resource::Service
include Chef::Win32ServiceConstants
+ unified_mode true
ALLOWED_START_TYPES = {
automatic: SERVICE_AUTO_START,
@@ -38,6 +39,113 @@ class Chef
description "Use the **windows_service** resource to create, delete, or manage a service on the Microsoft Windows platform."
introduced "12.0"
+ examples <<~DOC
+ **Starting Services**
+
+ Start a service with a `manual` startup type:
+
+ ```ruby
+ windows_service 'BITS' do
+ action :configure_startup
+ startup_type :manual
+ end
+ ```
+
+ **Creating Services**
+
+ Create a service named chef-client:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :create
+ binary_path_name "C:\\opscode\\chef\\bin"
+ end
+ ```
+
+ Create a service with `service_name` and `display_name`:
+
+ ```ruby
+ windows_service 'Setup chef-client as a service' do
+ action :create
+ display_name 'CHEF-CLIENT'
+ service_name 'chef-client'
+ binary_path_name "C:\\opscode\\chef\\bin"
+ end
+ ```
+
+ Create a service with the `manual` startup type:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :create
+ binary_path_name "C:\\opscode\\chef\\bin"
+ startup_type :manual
+ end
+ ```
+
+ Create a service with the `disabled` startup type:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :create
+ binary_path_name "C:\\opscode\\chef\\bin"
+ startup_type :disabled
+ end
+ ```
+
+ Create a service with the `automatic` startup type and delayed start enabled:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :create
+ binary_path_name "C:\\opscode\\chef\\bin"
+ startup_type :automatic
+ delayed_start true
+ end
+ ```
+
+ Create a service with a description:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :create
+ binary_path_name "C:\\opscode\\chef\\bin"
+ startup_type :automatic
+ description "Chef client as service"
+ end
+ ```
+
+ **Deleting Services**
+
+ Delete a service named chef-client:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :delete
+ end
+ ```
+
+ Delete a service with the `service_name` property:
+
+ ```ruby
+ windows_service 'Delete chef client' do
+ action :delete
+ service_name 'chef-client'
+ end
+ ```
+
+ **Configuring Services**
+
+ Change an existing service from automatic to manual startup:
+
+ ```ruby
+ windows_service 'chef-client' do
+ action :configure
+ binary_path_name "C:\\opscode\\chef\\bin"
+ startup_type :manual
+ end
+ ```
+ DOC
allowed_actions :configure_startup, :create, :delete, :configure
diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb
index 47bf6cfb19..fe1e976747 100644
--- a/lib/chef/resource/windows_share.rb
+++ b/lib/chef/resource/windows_share.rb
@@ -20,7 +20,6 @@
#
require_relative "../resource"
-require_relative "../json_compat"
require_relative "../util/path_helper"
class Chef
@@ -123,19 +122,19 @@ class Chef
# this command selects individual objects because EncryptData & CachingMode have underlying
# types that get converted to their Integer values by ConvertTo-Json & we need to make sure
# those get written out as strings
- share_state_cmd = "Get-SmbShare -Name '#{desired.share_name}' | Select-Object Name,Path, Description, Temporary, CATimeout, ContinuouslyAvailable, ConcurrentUserLimit, EncryptData | ConvertTo-Json -Compress"
+ share_state_cmd = "Get-SmbShare -Name '#{desired.share_name}' | Select-Object Name,Path, Description, Temporary, CATimeout, ContinuouslyAvailable, ConcurrentUserLimit, EncryptData"
Chef::Log.debug("Running '#{share_state_cmd}' to determine share state'")
- ps_results = powershell_out(share_state_cmd)
+ ps_results = powershell_exec(share_state_cmd)
# detect a failure without raising and then set current_resource to nil
if ps_results.error?
- Chef::Log.debug("Error fetching share state: #{ps_results.stderr}")
+ Chef::Log.debug("Error fetching share state: #{ps_results.errors}")
current_value_does_not_exist!
end
- Chef::Log.debug("The Get-SmbShare results were #{ps_results.stdout}")
- results = Chef::JSONCompat.from_json(ps_results.stdout)
+ Chef::Log.debug("The Get-SmbShare results were #{ps_results.result}")
+ results = ps_results.result
path results["Path"]
description results["Description"]
@@ -147,18 +146,18 @@ class Chef
encrypt_data results["EncryptData"]
# folder_enumeration_mode results['FolderEnumerationMode']
- perm_state_cmd = %{Get-SmbShareAccess -Name "#{desired.share_name}" | Select-Object AccountName,AccessControlType,AccessRight | ConvertTo-Json -Compress}
+ perm_state_cmd = %{Get-SmbShareAccess -Name "#{desired.share_name}" | Select-Object AccountName,AccessControlType,AccessRight}
Chef::Log.debug("Running '#{perm_state_cmd}' to determine share permissions state'")
- ps_perm_results = powershell_out(perm_state_cmd)
+ ps_perm_results = powershell_exec(perm_state_cmd)
# we raise here instead of warning like above because we'd only get here if the above Get-SmbShare
# command was successful and that continuing would leave us with 1/2 known state
raise "Could not determine #{desired.share_name} share permissions by running '#{perm_state_cmd}'" if ps_perm_results.error?
- Chef::Log.debug("The Get-SmbShareAccess results were #{ps_perm_results.stdout}")
+ Chef::Log.debug("The Get-SmbShareAccess results were #{ps_perm_results.result}")
- f_users, c_users, r_users = parse_permissions(ps_perm_results.stdout)
+ f_users, c_users, r_users = parse_permissions(ps_perm_results.result)
full_users f_users
change_users c_users
@@ -167,8 +166,7 @@ class Chef
# given the string output of Get-SmbShareAccess parse out
# arrays of full access users, change users, and read only users
- def parse_permissions(results_string)
- json_results = Chef::JSONCompat.from_json(results_string)
+ def parse_permissions(json_results)
json_results = [json_results] unless json_results.is_a?(Array) # single result is not an array
f_users = []
@@ -246,14 +244,16 @@ class Chef
delete_command = "Remove-SmbShare -Name '#{new_resource.share_name}' -Force"
Chef::Log.debug("Running '#{delete_command}' to remove the share")
- powershell_out!(delete_command)
+ powershell_exec!(delete_command)
end
def update_share
- update_command = "Set-SmbShare -Name '#{new_resource.share_name}' -Description '#{new_resource.description}' -Force"
+ update_command = "Set-SmbShare -Name '#{new_resource.share_name}' -Description '#{new_resource.description}' -ConcurrentUserLimit #{new_resource.concurrent_user_limit} -CATimeout #{new_resource.ca_timeout} -EncryptData:#{bool_string(new_resource.encrypt_data)} -ContinuouslyAvailable:#{bool_string(new_resource.continuously_available)} -Force"
+ update_command << " -ScopeName #{new_resource.scope_name}" unless new_resource.scope_name == "*" # passing * causes the command to fail
+ update_command << " -Temporary:#{bool_string(new_resource.temporary)}" if new_resource.temporary # only set true
Chef::Log.debug("Running '#{update_command}' to update the share")
- powershell_out!(update_command)
+ powershell_exec!(update_command)
end
def create_share
@@ -264,7 +264,7 @@ class Chef
share_cmd << " -Temporary:#{bool_string(new_resource.temporary)}" if new_resource.temporary # only set true
Chef::Log.debug("Running '#{share_cmd}' to create the share")
- powershell_out!(share_cmd)
+ powershell_exec!(share_cmd)
# New-SmbShare adds the "Everyone" user with read access no matter what so we need to remove it
# before we add our permissions
@@ -299,7 +299,7 @@ class Chef
grant_command = "Grant-SmbShareAccess -Name '#{new_resource.share_name}' -AccountName \"#{new_resource.send("#{perm_type}_users").join('","')}\" -Force -AccessRight #{perm_type}"
Chef::Log.debug("Running '#{grant_command}' to update the share permissions")
- powershell_out!(grant_command)
+ powershell_exec!(grant_command)
end
end
@@ -330,7 +330,7 @@ class Chef
def revoke_user_permissions(users)
revoke_command = "Revoke-SmbShareAccess -Name '#{new_resource.share_name}' -AccountName \"#{users.join('","')}\" -Force"
Chef::Log.debug("Running '#{revoke_command}' to revoke share permissions")
- powershell_out!(revoke_command)
+ powershell_exec!(revoke_command)
end
# convert True/False into "$True" & "$False"
diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb
index 4b6b9ba9cf..29bade29ce 100644
--- a/lib/chef/resource/windows_task.rb
+++ b/lib/chef/resource/windows_task.rb
@@ -16,12 +16,18 @@
# limitations under the License.
#
+require "chef-utils" unless defined?(ChefUtils::CANARY)
require_relative "../resource"
-require_relative "../win32/security" if Chef::Platform.windows?
+require_relative "../win32/security" if ChefUtils.windows_ruby?
+autoload :ISO8601, "iso8601" if ChefUtils.windows_ruby?
+require_relative "../util/path_helper"
+require "win32/taskscheduler" if ChefUtils.windows_ruby?
class Chef
class Resource
class WindowsTask < Chef::Resource
+ unified_mode true
+
provides(:windows_task) { true }
description "Use the **windows_task** resource to create, delete or run a Windows scheduled task."
@@ -69,7 +75,7 @@ class Chef
command 'chef-client'
run_level :highest
frequency :once
- start_time "16:10"
+ start_time '16:10'
end
```
@@ -109,6 +115,7 @@ class Chef
```
**Create a scheduled task to run when computer is idle with idle duration 20 min**:
+
```ruby
windows_task 'chef-client' do
command 'chef-client'
@@ -144,8 +151,8 @@ class Chef
default_action :create
property :task_name, String, regex: [%r{\A[^/\:\*\?\<\>\|]+\z}],
- description: "An optional property to set the task name if it differs from the resource block's name. Example: `Task Name` or `/Task Name`",
- name_property: true
+ description: "An optional property to set the task name if it differs from the resource block's name. Example: `Task Name` or `/Task Name`",
+ name_property: true
property :command, String,
description: "The command to be executed by the windows scheduled task."
@@ -155,15 +162,15 @@ class Chef
property :user, String,
description: "The user to run the task as.",
- default: lazy { Chef::ReservedNames::Win32::Security::SID.LocalSystem.account_simple_name if Chef::Platform.windows? },
+ default: lazy { Chef::ReservedNames::Win32::Security::SID.LocalSystem.account_simple_name if ChefUtils.windows_ruby? },
default_description: "The localized SYSTEM user for the node."
property :password, String,
description: "The user's password. The user property must be set if using this property."
property :run_level, Symbol, equal_to: %i{highest limited},
- description: "Run with `:limited` or `:highest` privileges.",
- default: :limited
+ description: "Run with `:limited` or `:highest` privileges.",
+ default: :limited
property :force, [TrueClass, FalseClass],
description: "When used with create, will update the task.",
@@ -176,17 +183,8 @@ class Chef
property :frequency_modifier, [Integer, String],
default: 1
- property :frequency, Symbol, equal_to: %i{minute
- hourly
- daily
- weekly
- monthly
- once
- on_logon
- onstart
- on_idle
- none},
- description: "The frequency with which to run the task."
+ property :frequency, Symbol, equal_to: %i{minute hourly daily weekly monthly once on_logon onstart on_idle none},
+ description: "The frequency with which to run the task."
property :start_day, String,
description: "Specifies the first date on which the task runs in **MM/DD/YYYY** format.",
@@ -383,16 +381,16 @@ class Chef
frequency_modifier = frequency_modifier.to_i
min = 1
max = case frequency
- when :minute
- 1439
- when :hourly
- 23
- when :daily
- 365
- when :weekly
- 52
- else
- min
+ when :minute
+ 1439
+ when :hourly
+ 23
+ when :daily
+ 365
+ when :weekly
+ 52
+ else
+ min
end
unless frequency_modifier.between?(min, max)
raise ArgumentError, "frequency_modifier value #{frequency_modifier} is invalid. Valid values for :#{frequency} frequency are #{min} - #{max}."
@@ -464,6 +462,609 @@ class Chef
def sec_to_min(seconds)
seconds.to_i / 60
end
+
+ action_class do
+ if ChefUtils.windows_ruby?
+ include ::Win32
+
+ MONTHS = {
+ JAN: ::Win32::TaskScheduler::JANUARY,
+ FEB: ::Win32::TaskScheduler::FEBRUARY,
+ MAR: ::Win32::TaskScheduler::MARCH,
+ APR: ::Win32::TaskScheduler::APRIL,
+ MAY: ::Win32::TaskScheduler::MAY,
+ JUN: ::Win32::TaskScheduler::JUNE,
+ JUL: ::Win32::TaskScheduler::JULY,
+ AUG: ::Win32::TaskScheduler::AUGUST,
+ SEP: ::Win32::TaskScheduler::SEPTEMBER,
+ OCT: ::Win32::TaskScheduler::OCTOBER,
+ NOV: ::Win32::TaskScheduler::NOVEMBER,
+ DEC: ::Win32::TaskScheduler::DECEMBER,
+ }.freeze
+
+ DAYS_OF_WEEK = { MON: ::Win32::TaskScheduler::MONDAY,
+ TUE: ::Win32::TaskScheduler::TUESDAY,
+ WED: ::Win32::TaskScheduler::WEDNESDAY,
+ THU: ::Win32::TaskScheduler::THURSDAY,
+ FRI: ::Win32::TaskScheduler::FRIDAY,
+ SAT: ::Win32::TaskScheduler::SATURDAY,
+ SUN: ::Win32::TaskScheduler::SUNDAY }.freeze
+
+ WEEKS_OF_MONTH = {
+ FIRST: ::Win32::TaskScheduler::FIRST_WEEK,
+ SECOND: ::Win32::TaskScheduler::SECOND_WEEK,
+ THIRD: ::Win32::TaskScheduler::THIRD_WEEK,
+ FOURTH: ::Win32::TaskScheduler::FOURTH_WEEK,
+ }.freeze
+
+ DAYS_OF_MONTH = {
+ 1 => ::Win32::TaskScheduler::TASK_FIRST,
+ 2 => ::Win32::TaskScheduler::TASK_SECOND,
+ 3 => ::Win32::TaskScheduler::TASK_THIRD,
+ 4 => ::Win32::TaskScheduler::TASK_FOURTH,
+ 5 => ::Win32::TaskScheduler::TASK_FIFTH,
+ 6 => ::Win32::TaskScheduler::TASK_SIXTH,
+ 7 => ::Win32::TaskScheduler::TASK_SEVENTH,
+ 8 => ::Win32::TaskScheduler::TASK_EIGHTH,
+ # cspell:disable-next-line
+ 9 => ::Win32::TaskScheduler::TASK_NINETH,
+ 10 => ::Win32::TaskScheduler::TASK_TENTH,
+ 11 => ::Win32::TaskScheduler::TASK_ELEVENTH,
+ 12 => ::Win32::TaskScheduler::TASK_TWELFTH,
+ 13 => ::Win32::TaskScheduler::TASK_THIRTEENTH,
+ 14 => ::Win32::TaskScheduler::TASK_FOURTEENTH,
+ 15 => ::Win32::TaskScheduler::TASK_FIFTEENTH,
+ 16 => ::Win32::TaskScheduler::TASK_SIXTEENTH,
+ 17 => ::Win32::TaskScheduler::TASK_SEVENTEENTH,
+ 18 => ::Win32::TaskScheduler::TASK_EIGHTEENTH,
+ 19 => ::Win32::TaskScheduler::TASK_NINETEENTH,
+ 20 => ::Win32::TaskScheduler::TASK_TWENTIETH,
+ 21 => ::Win32::TaskScheduler::TASK_TWENTY_FIRST,
+ 22 => ::Win32::TaskScheduler::TASK_TWENTY_SECOND,
+ 23 => ::Win32::TaskScheduler::TASK_TWENTY_THIRD,
+ 24 => ::Win32::TaskScheduler::TASK_TWENTY_FOURTH,
+ 25 => ::Win32::TaskScheduler::TASK_TWENTY_FIFTH,
+ 26 => ::Win32::TaskScheduler::TASK_TWENTY_SIXTH,
+ 27 => ::Win32::TaskScheduler::TASK_TWENTY_SEVENTH,
+ 28 => ::Win32::TaskScheduler::TASK_TWENTY_EIGHTH,
+ 29 => ::Win32::TaskScheduler::TASK_TWENTY_NINTH,
+ # cspell:disable-next-line
+ 30 => ::Win32::TaskScheduler::TASK_THIRTYETH,
+ 31 => ::Win32::TaskScheduler::TASK_THIRTY_FIRST,
+ }.freeze
+
+ PRIORITY = { "critical" => 0, "highest" => 1, "above_normal_2" => 2 , "above_normal_3" => 3, "normal_4" => 4,
+ "normal_5" => 5, "normal_6" => 6, "below_normal_7" => 7, "below_normal_8" => 8, "lowest" => 9, "idle" => 10 }.freeze
+ end
+
+ def load_current_resource
+ @current_resource = Chef::Resource::WindowsTask.new(new_resource.name)
+ task = ::Win32::TaskScheduler.new(new_resource.task_name, nil, "\\", false)
+ @current_resource.exists = task.exists?(new_resource.task_name)
+ if @current_resource.exists
+ task.get_task(new_resource.task_name)
+ @current_resource.task = task
+ pathed_task_name = new_resource.task_name.start_with?('\\') ? new_resource.task_name : "\\#{new_resource.task_name}"
+ @current_resource.task_name(pathed_task_name)
+ end
+ @current_resource
+ end
+
+ # separated command arguments from :command property
+ def set_command_and_arguments
+ cmd, *args = Chef::Util::PathHelper.split_args(new_resource.command)
+ new_resource.command = cmd
+ new_resource.command_arguments = args.join(" ")
+ end
+
+ def set_start_day_and_time
+ new_resource.start_day = Time.now.strftime("%m/%d/%Y") unless new_resource.start_day
+ new_resource.start_time = Time.now.strftime("%H:%M") unless new_resource.start_time
+ end
+
+ def update_task(task)
+ converge_by("#{new_resource} task updated") do
+ task.set_account_information(new_resource.user, new_resource.password, new_resource.interactive_enabled)
+ task.application_name = new_resource.command if new_resource.command
+ task.parameters = new_resource.command_arguments if new_resource.command_arguments
+ task.working_directory = new_resource.cwd if new_resource.cwd
+ task.trigger = trigger unless new_resource.frequency == :none
+ task.configure_settings(config_settings)
+ task.creator = new_resource.user
+ task.description = new_resource.description unless new_resource.description.nil?
+ task.configure_principals(principal_settings)
+ end
+ end
+
+ def trigger
+ start_month, start_day, start_year = new_resource.start_day.to_s.split("/")
+ start_hour, start_minute = new_resource.start_time.to_s.split(":")
+ # TODO currently end_month, end_year and end_year needs to be set to 0. If not set win32-taskscheduler throwing nil into integer error.
+ trigger_hash = {
+ start_year: start_year.to_i,
+ start_month: start_month.to_i,
+ start_day: start_day.to_i,
+ start_hour: start_hour.to_i,
+ start_minute: start_minute.to_i,
+ end_month: 0,
+ end_day: 0,
+ end_year: 0,
+ trigger_type: trigger_type,
+ type: type,
+ random_minutes_interval: new_resource.random_delay,
+ }
+
+ if new_resource.frequency == :minute
+ trigger_hash[:minutes_interval] = new_resource.frequency_modifier
+ end
+
+ if new_resource.frequency == :hourly
+ minutes = convert_hours_in_minutes(new_resource.frequency_modifier.to_i)
+ trigger_hash[:minutes_interval] = minutes
+ end
+
+ if new_resource.minutes_interval
+ trigger_hash[:minutes_interval] = new_resource.minutes_interval
+ end
+
+ if new_resource.minutes_duration
+ trigger_hash[:minutes_duration] = new_resource.minutes_duration
+ end
+
+ if trigger_type == ::Win32::TaskScheduler::MONTHLYDOW && frequency_modifier_contains_last_week?(new_resource.frequency_modifier)
+ trigger_hash[:run_on_last_week_of_month] = true
+ else
+ trigger_hash[:run_on_last_week_of_month] = false
+ end
+
+ if trigger_type == ::Win32::TaskScheduler::MONTHLYDATE && day_includes_last_or_lastday?(new_resource.day)
+ trigger_hash[:run_on_last_day_of_month] = true
+ else
+ trigger_hash[:run_on_last_day_of_month] = false
+ end
+ trigger_hash
+ end
+
+ def frequency_modifier_contains_last_week?(frequency_modifier)
+ frequency_modifier = frequency_modifier.to_s.split(",")
+ frequency_modifier.map! { |value| value.strip.upcase }
+ frequency_modifier.include?("LAST")
+ end
+
+ def day_includes_last_or_lastday?(day)
+ day = day.to_s.split(",")
+ day.map! { |value| value.strip.upcase }
+ day.include?("LAST") || day.include?("LASTDAY")
+ end
+
+ def convert_hours_in_minutes(hours)
+ hours.to_i * 60 if hours
+ end
+
+ # TODO : Try to optimize this method
+ # known issue : Since start_day and time is not mandatory while updating weekly frequency for which start_day is not mentioned by user idempotency
+ # is not getting maintained as new_resource.start_day is nil and we fetch the day of week from start_day to set and its currently coming as nil and don't match with current_task
+ def task_needs_update?(task)
+ flag = false
+ if new_resource.frequency == :none
+ flag = (task.author != new_resource.user ||
+ task.application_name != new_resource.command ||
+ description_needs_update?(task) ||
+ task.parameters != new_resource.command_arguments.to_s ||
+ task.principals[:run_level] != run_level ||
+ task.settings[:disallow_start_if_on_batteries] != new_resource.disallow_start_if_on_batteries ||
+ task.settings[:stop_if_going_on_batteries] != new_resource.stop_if_going_on_batteries ||
+ task.settings[:start_when_available] != new_resource.start_when_available)
+ else
+ current_task_trigger = task.trigger(0)
+ new_task_trigger = trigger
+ flag = (ISO8601::Duration.new(task.idle_settings[:idle_duration])) != (ISO8601::Duration.new(new_resource.idle_time * 60)) if new_resource.frequency == :on_idle
+ flag = (ISO8601::Duration.new(task.execution_time_limit)) != (ISO8601::Duration.new(new_resource.execution_time_limit * 60)) unless new_resource.execution_time_limit.nil?
+
+ # if trigger not found updating the task to add the trigger
+ if current_task_trigger.nil?
+ flag = true
+ else
+ flag = true if start_day_updated?(current_task_trigger, new_task_trigger) == true ||
+ start_time_updated?(current_task_trigger, new_task_trigger) == true ||
+ current_task_trigger[:trigger_type] != new_task_trigger[:trigger_type] ||
+ current_task_trigger[:type] != new_task_trigger[:type] ||
+ current_task_trigger[:random_minutes_interval].to_i != new_task_trigger[:random_minutes_interval].to_i ||
+ current_task_trigger[:minutes_interval].to_i != new_task_trigger[:minutes_interval].to_i ||
+ task.author.to_s.casecmp(new_resource.user.to_s) != 0 ||
+ task.application_name != new_resource.command ||
+ description_needs_update?(task) ||
+ task.parameters != new_resource.command_arguments.to_s ||
+ task.working_directory != new_resource.cwd.to_s ||
+ task.principals[:logon_type] != logon_type ||
+ task.principals[:run_level] != run_level ||
+ PRIORITY[task.priority] != new_resource.priority ||
+ task.settings[:disallow_start_if_on_batteries] != new_resource.disallow_start_if_on_batteries ||
+ task.settings[:stop_if_going_on_batteries] != new_resource.stop_if_going_on_batteries ||
+ task.settings[:start_when_available] != new_resource.start_when_available
+ if trigger_type == ::Win32::TaskScheduler::MONTHLYDATE
+ flag = true if current_task_trigger[:run_on_last_day_of_month] != new_task_trigger[:run_on_last_day_of_month]
+ end
+
+ if trigger_type == ::Win32::TaskScheduler::MONTHLYDOW
+ flag = true if current_task_trigger[:run_on_last_week_of_month] != new_task_trigger[:run_on_last_week_of_month]
+ end
+ end
+ end
+ flag
+ end
+
+ def start_day_updated?(current_task_trigger, new_task_trigger)
+ ( new_resource.start_day && (current_task_trigger[:start_year].to_i != new_task_trigger[:start_year] ||
+ current_task_trigger[:start_month].to_i != new_task_trigger[:start_month] ||
+ current_task_trigger[:start_day].to_i != new_task_trigger[:start_day]) )
+ end
+
+ def start_time_updated?(current_task_trigger, new_task_trigger)
+ ( new_resource.start_time && ( current_task_trigger[:start_hour].to_i != new_task_trigger[:start_hour] ||
+ current_task_trigger[:start_minute].to_i != new_task_trigger[:start_minute] ) )
+ end
+
+ def trigger_type
+ case new_resource.frequency
+ when :once, :minute, :hourly
+ ::Win32::TaskScheduler::ONCE
+ when :daily
+ ::Win32::TaskScheduler::DAILY
+ when :weekly
+ ::Win32::TaskScheduler::WEEKLY
+ when :monthly
+ # If frequency modifier is set with frequency :monthly we are setting taskscheduler as monthlydow
+ # Ref https://msdn.microsoft.com/en-us/library/windows/desktop/aa382061(v=vs.85).aspx
+ new_resource.frequency_modifier.to_i.between?(1, 12) ? ::Win32::TaskScheduler::MONTHLYDATE : ::Win32::TaskScheduler::MONTHLYDOW
+ when :on_idle
+ ::Win32::TaskScheduler::ON_IDLE
+ when :onstart
+ ::Win32::TaskScheduler::AT_SYSTEMSTART
+ when :on_logon
+ ::Win32::TaskScheduler::AT_LOGON
+ else
+ raise ArgumentError, "Please set frequency"
+ end
+ end
+
+ def type
+ case trigger_type
+ when ::Win32::TaskScheduler::ONCE
+ { once: nil }
+ when ::Win32::TaskScheduler::DAILY
+ { days_interval: new_resource.frequency_modifier.to_i }
+ when ::Win32::TaskScheduler::WEEKLY
+ { weeks_interval: new_resource.frequency_modifier.to_i, days_of_week: days_of_week.to_i }
+ when ::Win32::TaskScheduler::MONTHLYDATE
+ { months: months_of_year.to_i, days: days_of_month.to_i }
+ when ::Win32::TaskScheduler::MONTHLYDOW
+ { months: months_of_year.to_i, days_of_week: days_of_week.to_i, weeks_of_month: weeks_of_month.to_i }
+ when ::Win32::TaskScheduler::ON_IDLE
+ # TODO: handle option for this trigger
+ when ::Win32::TaskScheduler::AT_LOGON
+ # TODO: handle option for this trigger
+ when ::Win32::TaskScheduler::AT_SYSTEMSTART
+ # TODO: handle option for this trigger
+ end
+ end
+
+ # Deleting last from the array of weeks of month since last week is handled in :run_on_last_week_of_month parameter.
+ def weeks_of_month
+ weeks_of_month = []
+ if new_resource.frequency_modifier
+ weeks = new_resource.frequency_modifier.split(",")
+ weeks.map! { |week| week.to_s.strip.upcase }
+ weeks.delete("LAST") if weeks.include?("LAST")
+ weeks_of_month = get_binary_values_from_constants(weeks, WEEKS_OF_MONTH)
+ end
+ weeks_of_month
+ end
+
+ # Deleting the "LAST" and "LASTDAY" from days since last day is handled in :run_on_last_day_of_month parameter.
+ def days_of_month
+ days_of_month = []
+ if new_resource.day
+ days = new_resource.day.to_s.split(",")
+ days.map! { |day| day.to_s.strip.upcase }
+ days.delete("LAST") if days.include?("LAST")
+ days.delete("LASTDAY") if days.include?("LASTDAY")
+ if days - (1..31).to_a
+ days.each do |day|
+ days_of_month << DAYS_OF_MONTH[day.to_i]
+ end
+ days_of_month = days_of_month.size > 1 ? days_of_month.inject(:|) : days_of_month[0]
+ end
+ else
+ days_of_month = DAYS_OF_MONTH[1]
+ end
+ days_of_month
+ end
+
+ def days_of_week
+ if new_resource.day
+ # this line of code is just to support backward compatibility of wild card *
+ new_resource.day = "mon, tue, wed, thu, fri, sat, sun" if new_resource.day == "*" && new_resource.frequency == :weekly
+ days = new_resource.day.to_s.split(",")
+ days.map! { |day| day.to_s.strip.upcase }
+ weeks_days = get_binary_values_from_constants(days, DAYS_OF_WEEK)
+ else
+ # following condition will make the frequency :weekly idempotent if start_day is not provided by user setting day as the current_resource day
+ if (current_resource) && (current_resource.task) && (current_resource.task.trigger(0)[:type][:days_of_week]) && (new_resource.start_day.nil?)
+ weeks_days = current_resource.task.trigger(0)[:type][:days_of_week]
+ else
+ day = get_day(new_resource.start_day).to_sym if new_resource.start_day
+ DAYS_OF_WEEK[day]
+ end
+ end
+ end
+
+ def months_of_year
+ months_of_year = []
+ if new_resource.frequency_modifier.to_i.between?(1, 12) && !(new_resource.months)
+ new_resource.months = set_months(new_resource.frequency_modifier.to_i)
+ end
+
+ if new_resource.months
+ # this line of code is just to support backward compatibility of wild card *
+ new_resource.months = "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec" if new_resource.months == "*" && new_resource.frequency == :monthly
+ months = new_resource.months.split(",")
+ months.map! { |month| month.to_s.strip.upcase }
+ months_of_year = get_binary_values_from_constants(months, MONTHS)
+ else
+ MONTHS.each do |key, value|
+ months_of_year << MONTHS[key]
+ end
+ months_of_year = months_of_year.inject(:|)
+ end
+ months_of_year
+ end
+
+ # This values are set for frequency_modifier set as 1-12
+ # This is to give backward compatibility validated this values with earlier code and running schtask.exe
+ # Used this as reference https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks#d-dayday--
+ def set_months(frequency_modifier)
+ case frequency_modifier
+ when 1
+ "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec"
+ when 2
+ "feb, apr, jun, aug, oct, dec"
+ when 3
+ "mar, jun, sep, dec"
+ when 4
+ "apr, aug, dec"
+ when 5
+ "may, oct"
+ when 6
+ "jun, dec"
+ when 7
+ "jul"
+ when 8
+ "aug"
+ when 9
+ "sep"
+ when 10
+ "oct"
+ when 11
+ "nov"
+ when 12
+ "dec"
+ end
+ end
+
+ def get_binary_values_from_constants(array_values, constant)
+ data = []
+ array_values.each do |value|
+ value = value.to_sym
+ data << constant[value]
+ end
+ data.size > 1 ? data.inject(:|) : data[0]
+ end
+
+ def run_level
+ case new_resource.run_level
+ when :highest
+ ::Win32::TaskScheduler::TASK_RUNLEVEL_HIGHEST
+ when :limited
+ ::Win32::TaskScheduler::TASK_RUNLEVEL_LUA
+ end
+ end
+
+ # TODO: while creating the configuration settings win32-taskscheduler it accepts execution time limit values in ISO8601 format
+ def config_settings
+ settings = {
+ execution_time_limit: new_resource.execution_time_limit,
+ enabled: true,
+ }
+ settings[:idle_duration] = new_resource.idle_time if new_resource.idle_time
+ settings[:run_only_if_idle] = true if new_resource.idle_time
+ settings[:priority] = new_resource.priority
+ settings[:disallow_start_if_on_batteries] = new_resource.disallow_start_if_on_batteries
+ settings[:stop_if_going_on_batteries] = new_resource.stop_if_going_on_batteries
+ settings[:start_when_available] = new_resource.start_when_available
+ settings
+ end
+
+ def principal_settings
+ settings = {}
+ settings[:run_level] = run_level
+ settings[:logon_type] = logon_type
+ settings
+ end
+
+ def description_needs_update?(task)
+ task.description != new_resource.description unless new_resource.description.nil?
+ end
+
+ def logon_type
+ # Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383566(v=vs.85).aspx
+ # if nothing is passed as logon_type the TASK_LOGON_SERVICE_ACCOUNT is getting set as default so using that for comparison.
+ user_id = new_resource.user.to_s
+ password = new_resource.password.to_s
+ if Chef::ReservedNames::Win32::Security::SID.service_account_user?(user_id)
+ ::Win32::TaskScheduler::TASK_LOGON_SERVICE_ACCOUNT
+ elsif Chef::ReservedNames::Win32::Security::SID.group_user?(user_id)
+ ::Win32::TaskScheduler::TASK_LOGON_GROUP
+ elsif !user_id.empty? && !password.empty?
+ if new_resource.interactive_enabled
+ ::Win32::TaskScheduler::TASK_LOGON_INTERACTIVE_TOKEN
+ else
+ ::Win32::TaskScheduler::TASK_LOGON_PASSWORD
+ end
+ else
+ ::Win32::TaskScheduler::TASK_LOGON_INTERACTIVE_TOKEN
+ end
+ end
+
+ # This method checks if task and command properties exist since those two are mandatory properties to create a schedules task.
+ def basic_validation
+ validate = []
+ validate << "Command" if new_resource.command.nil? || new_resource.command.empty?
+ validate << "Task Name" if new_resource.task_name.nil? || new_resource.task_name.empty?
+ return true if validate.empty?
+
+ raise Chef::Exceptions::ValidationFailed.new "Value for '#{validate.join(", ")}' option cannot be empty"
+ end
+
+ # rubocop:disable Style/StringLiteralsInInterpolation
+ def run_schtasks(task_action, options = {})
+ cmd = "schtasks /#{task_action} /TN \"#{new_resource.task_name}\" "
+ options.each_key do |option|
+ unless option == "TR"
+ cmd += "/#{option} "
+ cmd += "\"#{options[option].to_s.gsub('"', "\\\"")}\" " unless options[option] == ""
+ end
+ end
+ # Appending Task Run [TR] option at the end since appending causing sometimes to append other options in option["TR"] value
+ if options["TR"]
+ cmd += "/TR \"#{options["TR"]} \" " unless task_action == "DELETE"
+ end
+ logger.trace("running: ")
+ logger.trace(" #{cmd}")
+ shell_out!(cmd, returns: [0])
+ end
+ # rubocop:enable Style/StringLiteralsInInterpolation
+
+ def get_day(date)
+ Date.strptime(date, "%m/%d/%Y").strftime("%a").upcase
+ end
+ end
+
+ action :create do
+ set_command_and_arguments if new_resource.command
+
+ if current_resource.exists
+ logger.trace "#{new_resource} task exist."
+ unless (task_needs_update?(current_resource.task)) || (new_resource.force)
+ logger.info "#{new_resource} task does not need updating and force is not specified - nothing to do"
+ return
+ end
+
+ # if start_day and start_time is not set by user current date and time will be set while updating any property
+ set_start_day_and_time unless new_resource.frequency == :none
+ update_task(current_resource.task)
+ else
+ basic_validation
+ set_start_day_and_time
+ converge_by("#{new_resource} task created") do
+ task = ::Win32::TaskScheduler.new
+ if new_resource.frequency == :none
+ task.new_work_item(new_resource.task_name, {}, { user: new_resource.user, password: new_resource.password, interactive: new_resource.interactive_enabled })
+ task.activate(new_resource.task_name)
+ else
+ task.new_work_item(new_resource.task_name, trigger, { user: new_resource.user, password: new_resource.password, interactive: new_resource.interactive_enabled })
+ end
+ task.application_name = new_resource.command
+ task.parameters = new_resource.command_arguments if new_resource.command_arguments
+ task.working_directory = new_resource.cwd if new_resource.cwd
+ task.configure_settings(config_settings)
+ task.configure_principals(principal_settings)
+ task.set_account_information(new_resource.user, new_resource.password, new_resource.interactive_enabled)
+ task.creator = new_resource.user
+ task.description = new_resource.description unless new_resource.description.nil?
+ task.activate(new_resource.task_name)
+ end
+ end
+ end
+
+ action :run do
+ if current_resource.exists
+ logger.trace "#{new_resource} task exists"
+ if current_resource.task.status == "running"
+ logger.info "#{new_resource} task is currently running, skipping run"
+ else
+ converge_by("run scheduled task #{new_resource}") do
+ current_resource.task.run
+ end
+ end
+ else
+ logger.warn "#{new_resource} task does not exist - nothing to do"
+ end
+ end
+
+ action :delete do
+ if current_resource.exists
+ logger.trace "#{new_resource} task exists"
+ converge_by("delete scheduled task #{new_resource}") do
+ ts = ::Win32::TaskScheduler.new
+ ts.delete(current_resource.task_name)
+ end
+ else
+ logger.warn "#{new_resource} task does not exist - nothing to do"
+ end
+ end
+
+ action :end do
+ if current_resource.exists
+ logger.trace "#{new_resource} task exists"
+ if current_resource.task.status != "running"
+ logger.trace "#{new_resource} is not running - nothing to do"
+ else
+ converge_by("#{new_resource} task ended") do
+ current_resource.task.stop
+ end
+ end
+ else
+ logger.warn "#{new_resource} task does not exist - nothing to do"
+ end
+ end
+
+ action :enable do
+ if current_resource.exists
+ logger.trace "#{new_resource} task exists"
+ if current_resource.task.status == "not scheduled"
+ converge_by("#{new_resource} task enabled") do
+ # TODO wind32-taskscheduler currently not having any method to handle this so using schtasks.exe here
+ run_schtasks "CHANGE", "ENABLE" => ""
+ end
+ else
+ logger.trace "#{new_resource} already enabled - nothing to do"
+ end
+ else
+ logger.fatal "#{new_resource} task does not exist - nothing to do"
+ raise Errno::ENOENT, "#{new_resource}: task does not exist, cannot enable"
+ end
+ end
+
+ action :disable do
+ if current_resource.exists
+ logger.info "#{new_resource} task exists"
+ if %w{ready running}.include?(current_resource.task.status)
+ converge_by("#{new_resource} task disabled") do
+ # TODO: in win32-taskscheduler there is no method which disables the task so currently calling disable with schtasks.exe
+ run_schtasks "CHANGE", "DISABLE" => ""
+ end
+ else
+ logger.warn "#{new_resource} already disabled - nothing to do"
+ end
+ else
+ logger.warn "#{new_resource} task does not exist - nothing to do"
+ end
+ end
+
+ action_class do
+ alias_method :action_change, :action_create
+ end
end
end
end
diff --git a/lib/chef/resource/windows_user_privilege.rb b/lib/chef/resource/windows_user_privilege.rb
index a39250afc1..971338303d 100644
--- a/lib/chef/resource/windows_user_privilege.rb
+++ b/lib/chef/resource/windows_user_privilege.rb
@@ -23,52 +23,6 @@ class Chef
class WindowsUserPrivilege < Chef::Resource
unified_mode true
- privilege_opts = %w{SeTrustedCredManAccessPrivilege
- SeNetworkLogonRight
- SeTcbPrivilege
- SeMachineAccountPrivilege
- SeIncreaseQuotaPrivilege
- SeInteractiveLogonRight
- SeRemoteInteractiveLogonRight
- SeBackupPrivilege
- SeChangeNotifyPrivilege
- SeSystemtimePrivilege
- SeTimeZonePrivilege
- SeCreatePagefilePrivilege
- SeCreateTokenPrivilege
- SeCreateGlobalPrivilege
- SeCreatePermanentPrivilege
- SeCreateSymbolicLinkPrivilege
- SeDebugPrivilege
- SeDenyNetworkLogonRight
- SeDenyBatchLogonRight
- SeDenyServiceLogonRight
- SeDenyInteractiveLogonRight
- SeDenyRemoteInteractiveLogonRight
- SeEnableDelegationPrivilege
- SeRemoteShutdownPrivilege
- SeAuditPrivilege
- SeImpersonatePrivilege
- SeIncreaseWorkingSetPrivilege
- SeIncreaseBasePriorityPrivilege
- SeLoadDriverPrivilege
- SeLockMemoryPrivilege
- SeBatchLogonRight
- SeServiceLogonRight
- SeSecurityPrivilege
- SeRelabelPrivilege
- SeSystemEnvironmentPrivilege
- SeManageVolumePrivilege
- SeProfileSingleProcessPrivilege
- SeSystemProfilePrivilege
- SeUndockPrivilege
- SeAssignPrimaryTokenPrivilege
- SeRestorePrivilege
- SeShutdownPrivilege
- SeSyncAgentPrivilege
- SeTakeOwnershipPrivilege
- }
-
provides :windows_user_privilege
description "The windows_user_privilege resource allows to add and set principal (User/Group) to the specified privilege.\n Ref: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-rights-assignment"
@@ -125,22 +79,67 @@ class Chef
```
DOC
+ PRIVILEGE_OPTS = %w{ SeAssignPrimaryTokenPrivilege
+ SeAuditPrivilege
+ SeBackupPrivilege
+ SeBatchLogonRight
+ SeChangeNotifyPrivilege
+ SeCreateGlobalPrivilege
+ SeCreatePagefilePrivilege
+ SeCreatePermanentPrivilege
+ SeCreateSymbolicLinkPrivilege
+ SeCreateTokenPrivilege
+ SeDebugPrivilege
+ SeDenyBatchLogonRight
+ SeDenyInteractiveLogonRight
+ SeDenyNetworkLogonRight
+ SeDenyRemoteInteractiveLogonRight
+ SeDenyServiceLogonRight
+ SeEnableDelegationPrivilege
+ SeImpersonatePrivilege
+ SeIncreaseBasePriorityPrivilege
+ SeIncreaseQuotaPrivilege
+ SeIncreaseWorkingSetPrivilege
+ SeInteractiveLogonRight
+ SeLoadDriverPrivilege
+ SeLockMemoryPrivilege
+ SeMachineAccountPrivilege
+ SeManageVolumePrivilege
+ SeNetworkLogonRight
+ SeProfileSingleProcessPrivilege
+ SeRelabelPrivilege
+ SeRemoteInteractiveLogonRight
+ SeRemoteShutdownPrivilege
+ SeRestorePrivilege
+ SeSecurityPrivilege
+ SeServiceLogonRight
+ SeShutdownPrivilege
+ SeSyncAgentPrivilege
+ SeSystemEnvironmentPrivilege
+ SeSystemProfilePrivilege
+ SeSystemtimePrivilege
+ SeTakeOwnershipPrivilege
+ SeTcbPrivilege
+ SeTimeZonePrivilege
+ SeTrustedCredManAccessPrivilege
+ SeUndockPrivilege
+ }.freeze
+
property :principal, String,
description: "An optional property to add the user to the given privilege. Use only with add and remove action.",
name_property: true
- property :users, Array,
- description: "An optional property to set the privilege for given users. Use only with set action."
+ property :users, [Array, String],
+ description: "An optional property to set the privilege for given users. Use only with set action.",
+ coerce: proc { |v| Array(v) }
property :privilege, [Array, String],
- description: "Privilege to set for users.",
+ description: "One or more privileges to set for users.",
required: true,
- coerce: proc { |v| v.is_a?(String) ? Array[v] : v },
+ coerce: proc { |v| Array(v) },
callbacks: {
- "Option privilege must include any of the: #{privilege_opts}" => lambda { |v|
- (privilege_opts & v).size == v.size
- },
- }
+ "Privilege property restricted to the following values: #{PRIVILEGE_OPTS}" => lambda { |n| (n - PRIVILEGE_OPTS).empty? },
+ }
load_current_value do |new_resource|
if new_resource.principal && (new_resource.action.include?(:add) || new_resource.action.include?(:remove))
diff --git a/lib/chef/resource/windows_workgroup.rb b/lib/chef/resource/windows_workgroup.rb
index ce6129c4f7..3c49f7cb3e 100644
--- a/lib/chef/resource/windows_workgroup.rb
+++ b/lib/chef/resource/windows_workgroup.rb
@@ -16,11 +16,13 @@
#
require_relative "../resource"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
class WindowsWorkgroup < Chef::Resource
+ unified_mode true
+
provides :windows_workgroup
description "Use the **windows_workgroup** resource to join or change the workgroup of a Windows host."
@@ -59,8 +61,8 @@ class Chef
property :reboot, Symbol,
equal_to: %i{never request_reboot reboot_now},
- validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)",
- description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.",
+ validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{ChefUtils::Dist::Infra::PRODUCT} run completes), and :never (Don't reboot)",
+ description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the #{ChefUtils::Dist::Infra::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.",
coerce: proc { |x| clarify_reboot(x) },
default: :immediate, desired_state: false
@@ -90,8 +92,8 @@ class Chef
unless workgroup_member?
converge_by("join workstation workgroup #{new_resource.workgroup_name}") do
- ps_run = powershell_out(join_command)
- raise "Failed to join the workgroup #{new_resource.workgroup_name}: #{ps_run.stderr}}" if ps_run.error?
+ ps_run = powershell_exec(join_command)
+ raise "Failed to join the workgroup #{new_resource.workgroup_name}: #{ps_run.errors}}" if ps_run.error?
unless new_resource.reboot == :never
reboot "Reboot to join workgroup #{new_resource.workgroup_name}" do
@@ -117,10 +119,10 @@ class Chef
# @return [Boolean] is the node a member of the workgroup specified in the resource
def workgroup_member?
- node_workgroup = powershell_out!("(Get-WmiObject -Class Win32_ComputerSystem).Workgroup")
+ node_workgroup = powershell_exec!("(Get-WmiObject -Class Win32_ComputerSystem).Workgroup")
raise "Failed to determine if system already a member of workgroup #{new_resource.workgroup_name}" if node_workgroup.error?
- node_workgroup.stdout.downcase.strip == new_resource.workgroup_name.downcase
+ String(node_workgroup.result).downcase.strip == new_resource.workgroup_name.downcase
end
end
end
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index 7db8bcc948..f7c4517c6d 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -17,7 +17,7 @@
#
require_relative "package"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -135,7 +135,7 @@ class Chef
coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
property :flush_cache, Hash,
- description: "Flush the in-memory cache before or after a Yum operation that installs, upgrades, or removes a package. Accepts a Hash in the form: { :before => true/false, :after => true/false } or an Array in the form [ :before, :after ].\nYum automatically synchronizes remote metadata to a local cache. The #{Chef::Dist::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{Chef::Dist::CLIENT} run. The in-memory cache allows packages to be installed during the #{Chef::Dist::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{Chef::Dist::CLIENT} run is in-progress.",
+ description: "Flush the in-memory cache before or after a Yum operation that installs, upgrades, or removes a package. Accepts a Hash in the form: { :before => true/false, :after => true/false } or an Array in the form [ :before, :after ].\nYum automatically synchronizes remote metadata to a local cache. The #{ChefUtils::Dist::Infra::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{ChefUtils::Dist::Infra::CLIENT} run. The in-memory cache allows packages to be installed during the #{ChefUtils::Dist::Infra::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{ChefUtils::Dist::Infra::CLIENT} run is in-progress.",
default: { before: false, after: false },
coerce: proc { |v|
if v.is_a?(Hash)
diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb
index 3070075959..94d1a284fc 100644
--- a/lib/chef/resource/yum_repository.rb
+++ b/lib/chef/resource/yum_repository.rb
@@ -37,7 +37,7 @@ class Chef
gpgkey 'http://artifacts.ourco.org/pub/yum/RPM-GPG-KEY-OURCO-8'
action :create
end
- ```ruby
+ ```
**Delete a repository**:
diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb
index 5221f5c4a2..26521010bd 100644
--- a/lib/chef/resource_collection/resource_set.rb
+++ b/lib/chef/resource_collection/resource_set.rb
@@ -123,11 +123,7 @@ class Chef
# * Chef::Exceptions::InvalidResourceSpecification for all invalid input.
def validate_lookup_spec!(query_object)
case query_object
- when Chef::Resource
- true
- when SINGLE_RESOURCE_MATCH, MULTIPLE_RESOURCE_MATCH, NAMELESS_RESOURCE_MATCH
- true
- when Hash
+ when Chef::Resource, SINGLE_RESOURCE_MATCH, MULTIPLE_RESOURCE_MATCH, NAMELESS_RESOURCE_MATCH, Hash
true
when String
raise Chef::Exceptions::InvalidResourceSpecification,
@@ -135,7 +131,7 @@ class Chef
else
raise Chef::Exceptions::InvalidResourceSpecification,
"The object `#{query_object.inspect}' is not valid for resource collection lookup. " +
- "Use a String like `resource_type[resource_name]' or a Chef::Resource object"
+ "Use a String like `resource_type[resource_name]' or a Chef::Resource object"
end
end
diff --git a/lib/chef/resource_inspector.rb b/lib/chef/resource_inspector.rb
index 53c0fbd913..6d320f4202 100644
--- a/lib/chef/resource_inspector.rb
+++ b/lib/chef/resource_inspector.rb
@@ -23,94 +23,96 @@ require_relative "node"
require_relative "resources"
require_relative "json_compat"
-module ResourceInspector
- def self.get_default(default)
- if default.is_a?(Chef::DelayedEvaluator)
- # ideally we'd get the block we pass to `lazy`, but the best we can do
- # is to get the source location, which then results in reparsing the source
- # code for the resource ourselves and just no
- "lazy default"
- else
- default.is_a?(Symbol) ? default.inspect : default # inspect properly returns symbols
+class Chef
+ module ResourceInspector
+ def self.get_default(default)
+ if default.is_a?(Chef::DelayedEvaluator)
+ # ideally we'd get the block we pass to `lazy`, but the best we can do
+ # is to get the source location, which then results in reparsing the source
+ # code for the resource ourselves and just no
+ "lazy default"
+ else
+ default.is_a?(Symbol) ? default.inspect : default # inspect properly returns symbols
+ end
end
- end
- def self.extract_resource(resource, complete = false)
- data = {}
- data[:description] = resource.description
- # data[:deprecated] = resource.deprecated || false
- data[:default_action] = resource.default_action
- data[:actions] = resource.allowed_actions
- data[:examples] = resource.examples
- data[:introduced] = resource.introduced
- data[:preview] = resource.preview_resource
+ def self.extract_resource(resource, complete = false)
+ data = {}
+ data[:description] = resource.description
+ # data[:deprecated] = resource.deprecated || false
+ data[:default_action] = resource.default_action
+ data[:actions] = resource.allowed_actions
+ data[:examples] = resource.examples
+ data[:introduced] = resource.introduced
+ data[:preview] = resource.preview_resource
- properties = unless complete
- resource.properties.reject { |_, k| k.options[:declared_in] == Chef::Resource || k.options[:skip_docs] }
- else
- resource.properties.reject { |_, k| k.options[:skip_docs] }
- end
+ properties = unless complete
+ resource.properties.reject { |_, k| k.options[:declared_in] == Chef::Resource || k.options[:skip_docs] }
+ else
+ resource.properties.reject { |_, k| k.options[:skip_docs] }
+ end
- data[:properties] = properties.each_with_object([]) do |(n, k), acc|
- opts = k.options
- acc << { name: n, description: opts[:description],
- introduced: opts[:introduced], is: opts[:is],
- deprecated: opts[:deprecated] || false,
- required: opts[:required] || false,
- default: opts[:default_description] || get_default(opts[:default]),
- name_property: opts[:name_property] || false,
- equal_to: sort_equal_to(opts[:equal_to]) }
+ data[:properties] = properties.each_with_object([]) do |(n, k), acc|
+ opts = k.options
+ acc << { name: n, description: opts[:description],
+ introduced: opts[:introduced], is: opts[:is],
+ deprecated: opts[:deprecated] || false,
+ required: opts[:required] || false,
+ default: opts[:default_description] || get_default(opts[:default]),
+ name_property: opts[:name_property] || false,
+ equal_to: sort_equal_to(opts[:equal_to]) }
+ end
+ data
end
- data
- end
- def self.sort_equal_to(equal_to)
- Array(equal_to).sort.map(&:inspect)
- rescue ArgumentError
- Array(equal_to).map(&:inspect)
- end
+ def self.sort_equal_to(equal_to)
+ Array(equal_to).sort.map(&:inspect)
+ rescue ArgumentError
+ Array(equal_to).map(&:inspect)
+ end
- def self.extract_cookbook(path, complete)
- path = File.expand_path(path)
- dir, name = File.split(path)
- Chef::Cookbook::FileVendor.fetch_from_disk(path)
- loader = Chef::CookbookLoader.new(dir)
- cookbook = loader.load_cookbook(name)
- resources = cookbook.files_for(:resources)
+ def self.extract_cookbook(path, complete)
+ path = File.expand_path(path)
+ dir, name = File.split(path)
+ Chef::Cookbook::FileVendor.fetch_from_disk(path)
+ loader = Chef::CookbookLoader.new(dir)
+ cookbook = loader.load_cookbook(name)
+ resources = cookbook.files_for(:resources)
- resources.each_with_object({}) do |r, res|
- pth = r["full_path"]
- cur = Chef::Resource::LWRPBase.build_from_file(name, pth, Chef::RunContext.new(Chef::Node.new, nil, nil))
- res[cur.resource_name] = extract_resource(cur, complete)
+ resources.each_with_object({}) do |r, res|
+ pth = r["full_path"]
+ cur = Chef::Resource::LWRPBase.build_from_file(name, pth, Chef::RunContext.new(Chef::Node.new, nil, nil))
+ res[cur.resource_name] = extract_resource(cur, complete)
+ end
end
- end
- # If we're given no resources, dump all of Chef's built ins
- # otherwise, if we have a path then extract all the resources from the cookbook
- # or else do a list of built in resources
- #
- # @param arguments [Array, String] One of more paths to a cookbook or a resource file to inspect
- # @param complete [TrueClass, FalseClass] Whether to show properties defined in the base Resource class
- # @return [String] JSON formatting of all resources
- def self.inspect(arguments = [], complete: false)
- output = if arguments.empty?
- ObjectSpace.each_object(Class).select { |k| k < Chef::Resource }.each_with_object({}) { |klass, acc| acc[klass.resource_name] = extract_resource(klass) }
- else
- Array(arguments).each_with_object({}) do |arg, acc|
- if File.directory?(arg)
- extract_cookbook(arg, complete).each { |k, v| acc[k] = v }
- else
- r = Chef::ResourceResolver.resolve(arg.to_sym)
- acc[r.resource_name] = extract_resource(r, complete)
+ # If we're given no resources, dump all of Chef's built ins
+ # otherwise, if we have a path then extract all the resources from the cookbook
+ # or else do a list of built in resources
+ #
+ # @param arguments [Array, String] One of more paths to a cookbook or a resource file to inspect
+ # @param complete [TrueClass, FalseClass] Whether to show properties defined in the base Resource class
+ # @return [String] JSON formatting of all resources
+ def self.inspect(arguments = [], complete: false)
+ output = if arguments.empty?
+ ObjectSpace.each_object(Class).select { |k| k < Chef::Resource }.each_with_object({}) { |klass, acc| acc[klass.resource_name] = extract_resource(klass) }
+ else
+ Array(arguments).each_with_object({}) do |arg, acc|
+ if File.directory?(arg)
+ extract_cookbook(arg, complete).each { |k, v| acc[k] = v }
+ else
+ r = Chef::ResourceResolver.resolve(arg.to_sym)
+ acc[r.resource_name] = extract_resource(r, complete)
+ end
end
end
- end
- Chef::JSONCompat.to_json_pretty(output)
- end
+ Chef::JSONCompat.to_json_pretty(output)
+ end
- def self.start
- puts inspect(ARGV, complete: true)
- end
+ def self.start
+ puts inspect(ARGV, complete: true)
+ end
+ end
end
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb
index 379201768f..4051ac2f49 100644
--- a/lib/chef/resource_reporter.rb
+++ b/lib/chef/resource_reporter.rb
@@ -19,8 +19,6 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "securerandom" unless defined?(SecureRandom)
require_relative "event_dispatch/base"
class Chef
diff --git a/lib/chef/resources.rb b/lib/chef/resources.rb
index d9354358ce..843d5610b8 100644
--- a/lib/chef/resources.rb
+++ b/lib/chef/resources.rb
@@ -27,6 +27,7 @@ require_relative "resource/batch"
require_relative "resource/breakpoint"
require_relative "resource/build_essential"
require_relative "resource/cookbook_file"
+require_relative "resource/chef_client_config"
require_relative "resource/chef_client_cron"
require_relative "resource/chef_client_launchd"
require_relative "resource/chef_client_scheduled_task"
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index 7ba7d9f33e..75c18f2fcf 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -28,7 +28,7 @@ require_relative "event_dispatch/events_output_stream"
require_relative "train_transport"
require_relative "exceptions"
require "forwardable" unless defined?(Forwardable)
-require "set" unless defined?(Set)
+autoload :Set, "set"
class Chef
@@ -627,7 +627,7 @@ class Chef
# @return [Train::Plugins::Transport] The child class for our train transport.
#
def transport
- @transport ||= Chef::TrainTransport.build_transport(logger)
+ @transport ||= Chef::TrainTransport.new(logger).build_transport
end
# Remote connection object from Train
diff --git a/lib/chef/run_context/cookbook_compiler.rb b/lib/chef/run_context/cookbook_compiler.rb
index 51b841d798..27461fea9a 100644
--- a/lib/chef/run_context/cookbook_compiler.rb
+++ b/lib/chef/run_context/cookbook_compiler.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "set" unless defined?(Set)
+autoload :Set, "set"
require_relative "../log"
require_relative "../recipe"
require_relative "../resource/lwrp_base"
diff --git a/lib/chef/run_lock.rb b/lib/chef/run_lock.rb
index a7c66837d5..1f83b7ea5a 100644
--- a/lib/chef/run_lock.rb
+++ b/lib/chef/run_lock.rb
@@ -23,7 +23,7 @@ end
require_relative "config"
require_relative "exceptions"
require "timeout" unless defined?(Timeout)
-require_relative "dist"
+require "chef-utils" unless defined?(ChefUtils::CANARY)
class Chef
@@ -96,7 +96,7 @@ class Chef
# Waits until acquiring the system-wide lock.
#
def wait
- Chef::Log.warn("#{Chef::Dist::PRODUCT} #{runpid} is running, will wait for it to finish and then run.")
+ Chef::Log.warn("#{ChefUtils::Dist::Infra::PRODUCT} #{runpid} is running, will wait for it to finish and then run.")
if ChefUtils.windows?
mutex.wait
else
@@ -173,7 +173,7 @@ class Chef
# Mutex name is case-sensitive contrary to other things in
# windows. "\" is the only invalid character.
def acquire_win32_mutex
- @mutex = Chef::ReservedNames::Win32::Mutex.new("Global\\#{runlock_file.gsub(/[\\]/, "/").downcase}")
+ @mutex = Chef::ReservedNames::Win32::Mutex.new("Global\\#{runlock_file.tr('\\', "/").downcase}")
mutex.test
end
diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb
index cd4275e8db..c278ea9a68 100644
--- a/lib/chef/search/query.rb
+++ b/lib/chef/search/query.rb
@@ -20,8 +20,10 @@ require_relative "../config"
require_relative "../exceptions"
require_relative "../server_api"
-require "uri" unless defined?(URI)
-require "addressable/uri" unless defined?(Addressable::URI)
+autoload :URI, "uri"
+module Addressable
+ autoload :URI, "addressable/uri"
+end
class Chef
class Search
@@ -132,10 +134,9 @@ class Chef
args_h
end
- QUERY_PARAM_VALUE = Addressable::URI::CharacterClasses::QUERY + "\\&\\;"
-
def escape_value(s)
- s && Addressable::URI.encode_component(s.to_s, QUERY_PARAM_VALUE)
+ query_param_value = Addressable::URI::CharacterClasses::QUERY + "\\&\\;"
+ s && Addressable::URI.encode_component(s.to_s, query_param_value)
end
def create_query_string(type, query, rows, start)
diff --git a/lib/chef/server_api.rb b/lib/chef/server_api.rb
index 471c72a132..7f59c33b93 100644
--- a/lib/chef/server_api.rb
+++ b/lib/chef/server_api.rb
@@ -71,10 +71,6 @@ class Chef
return_value
rescue Exception => exception
log_failed_request(response, return_value) unless response.nil?
-
- if exception.respond_to?(:chef_rest_request=)
- exception.chef_rest_request = rest_request
- end
raise
end
end
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index 8429110eec..a425129fa8 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -15,17 +15,22 @@
# limitations under the License.
#
+module Mixlib
+ module Authentication
+ autoload :Log, "mixlib/authentication"
+ end
+end
require "singleton" unless defined?(Singleton)
require "pp" unless defined?(PP)
require "etc" unless defined?(Etc)
require "mixlib/cli" unless defined?(Mixlib::CLI)
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require_relative "../chef"
require_relative "version"
require_relative "client"
require_relative "config"
require_relative "config_fetcher"
-require_relative "dist"
require_relative "shell/shell_session"
require_relative "workstation_config_loader"
@@ -126,11 +131,11 @@ module Shell
irb_conf[:IRB_RC] = lambda do |conf|
m = conf.main
- conf.prompt_c = "#{Chef::Dist::EXEC}#{leader(m)} > "
+ conf.prompt_c = "#{ChefUtils::Dist::Infra::EXEC}#{leader(m)} > "
conf.return_format = " => %s \n"
- conf.prompt_i = "#{Chef::Dist::EXEC}#{leader(m)} (#{Chef::VERSION})> "
- conf.prompt_n = "#{Chef::Dist::EXEC}#{leader(m)} ?> "
- conf.prompt_s = "#{Chef::Dist::EXEC}#{leader(m)}%l> "
+ conf.prompt_i = "#{ChefUtils::Dist::Infra::EXEC}#{leader(m)} (#{Chef::VERSION})> "
+ conf.prompt_n = "#{ChefUtils::Dist::Infra::EXEC}#{leader(m)} ?> "
+ conf.prompt_s = "#{ChefUtils::Dist::Infra::EXEC}#{leader(m)}%l> "
conf.use_tracer = false
conf.instance_variable_set(:@use_multiline, false)
conf.instance_variable_set(:@use_singleline, false)
@@ -212,17 +217,17 @@ module Shell
@footer
end
- banner("#{Chef::Dist::SHELL} #{Chef::VERSION}\n\nUsage: #{Chef::Dist::SHELL} [NAMED_CONF] (OPTIONS)")
+ banner("#{ChefUtils::Dist::Infra::SHELL} #{Chef::VERSION}\n\nUsage: #{ChefUtils::Dist::Infra::SHELL} [NAMED_CONF] (OPTIONS)")
footer(<<~FOOTER)
- When no CONFIG is specified, #{Chef::Dist::SHELL} attempts to load a default configuration file:
- * If a NAMED_CONF is given, #{Chef::Dist::SHELL} will load ~/#{Chef::Dist::USER_CONF_DIR}/NAMED_CONF/#{Chef::Dist::SHELL_CONF}
- * If no NAMED_CONF is given #{Chef::Dist::SHELL} will load ~/#{Chef::Dist::USER_CONF_DIR}/#{Chef::Dist::SHELL_CONF} if it exists
- * If no #{Chef::Dist::SHELL_CONF} can be found, #{Chef::Dist::SHELL} falls back to load:
- #{Chef::Dist::CONF_DIR}/client.rb if -z option is given.
- #{Chef::Dist::CONF_DIR}/solo.rb if --solo-legacy-mode option is given.
- #{Chef::Dist::USER_CONF_DIR}/config.rb if -s option is given.
- #{Chef::Dist::USER_CONF_DIR}/knife.rb if -s option is given.
+ When no CONFIG is specified, #{ChefUtils::Dist::Infra::SHELL} attempts to load a default configuration file:
+ * If a NAMED_CONF is given, #{ChefUtils::Dist::Infra::SHELL} will load ~/#{ChefUtils::Dist::Infra::USER_CONF_DIR}/NAMED_CONF/#{ChefUtils::Dist::Infra::SHELL_CONF}
+ * If no NAMED_CONF is given #{ChefUtils::Dist::Infra::SHELL} will load ~/#{ChefUtils::Dist::Infra::USER_CONF_DIR}/#{ChefUtils::Dist::Infra::SHELL_CONF} if it exists
+ * If no #{ChefUtils::Dist::Infra::SHELL_CONF} can be found, #{ChefUtils::Dist::Infra::SHELL} falls back to load:
+ #{ChefConfig::Config.etc_chef_dir}/client.rb if -z option is given.
+ #{ChefConfig::Config.etc_chef_dir}/solo.rb if --solo-legacy-mode option is given.
+ #{ChefUtils::Dist::Infra::USER_CONF_DIR}/config.rb if -s option is given.
+ #{ChefUtils::Dist::Infra::USER_CONF_DIR}/knife.rb if -s option is given.
FOOTER
option :use_multiline,
@@ -269,19 +274,19 @@ module Shell
option :solo_shell,
short: "-s",
long: "--solo",
- description: "#{Chef::Dist::SOLO} session",
+ description: "#{ChefUtils::Dist::Solo::PRODUCT} session",
boolean: true,
proc: proc { Chef::Config[:solo] = true }
option :client,
short: "-z",
long: "--client",
- description: "#{Chef::Dist::PRODUCT} session",
+ description: "#{ChefUtils::Dist::Infra::PRODUCT} session",
boolean: true
option :solo_legacy_shell,
long: "--solo-legacy-mode",
- description: "#{Chef::Dist::SOLO} legacy session",
+ description: "#{ChefUtils::Dist::Solo::PRODUCT} legacy session",
boolean: true,
proc: proc { Chef::Config[:solo_legacy_mode] = true }
@@ -294,15 +299,15 @@ module Shell
option :chef_server_url,
short: "-S CHEFSERVERURL",
long: "--server CHEFSERVERURL",
- description: "The #{Chef::Dist::SERVER_PRODUCT} URL",
+ description: "The #{ChefUtils::Dist::Server::PRODUCT} URL",
proc: nil
option :version,
short: "-v",
long: "--version",
- description: "Show #{Chef::Dist::PRODUCT} version",
+ description: "Show #{ChefUtils::Dist::Infra::PRODUCT} version",
boolean: true,
- proc: lambda { |v| puts "#{Chef::Dist::PRODUCT}: #{::Chef::VERSION}" },
+ proc: lambda { |v| puts "#{ChefUtils::Dist::Infra::PRODUCT}: #{::Chef::VERSION}" },
exit: 0
option :override_runlist,
@@ -351,18 +356,18 @@ module Shell
config[:config_file]
elsif environment
Shell.env = environment
- config_file_to_try = ::File.join(dot_chef_dir, environment, Chef::Dist::SHELL_CONF)
+ config_file_to_try = ::File.join(dot_chef_dir, environment, ChefUtils::Dist::Infra::SHELL_CONF)
unless ::File.exist?(config_file_to_try)
- puts "could not find #{Chef::Dist::SHELL} config for environment #{environment} at #{config_file_to_try}"
+ puts "could not find #{ChefUtils::Dist::Infra::SHELL} config for environment #{environment} at #{config_file_to_try}"
exit 1
end
config_file_to_try
- elsif dot_chef_dir && ::File.exist?(File.join(dot_chef_dir, Chef::Dist::SHELL_CONF))
- File.join(dot_chef_dir, Chef::Dist::SHELL_CONF)
+ elsif dot_chef_dir && ::File.exist?(File.join(dot_chef_dir, ChefUtils::Dist::Infra::SHELL_CONF))
+ File.join(dot_chef_dir, ChefUtils::Dist::Infra::SHELL_CONF)
elsif config[:solo_legacy_shell]
- Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/solo.rb")
+ Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/solo.rb")
elsif config[:client]
- Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/client.rb")
+ Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/client.rb")
elsif config[:solo_shell]
Chef::WorkstationConfigLoader.new(nil, Chef::Log).config_location
else
diff --git a/lib/chef/shell/ext.rb b/lib/chef/shell/ext.rb
index f8b8d2e0e3..b884658e98 100644
--- a/lib/chef/shell/ext.rb
+++ b/lib/chef/shell/ext.rb
@@ -25,7 +25,7 @@ require_relative "shell_session"
require_relative "model_wrapper"
require_relative "../server_api"
require_relative "../json_compat"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
module Shell
module Extensions
@@ -62,14 +62,14 @@ module Shell
if subsession = jobs.select_shell_session(context_obj)
jobs.switch(subsession)
else
- irb(context_obj)
+ irb(context_obj) # rubocop: disable Lint/Debugger
end
end
def help_banner
banner = []
banner << ""
- banner << "#{Chef::Dist::SHELL} Help"
+ banner << "#{ChefUtils::Dist::Infra::SHELL} Help"
banner << "".ljust(80, "=")
banner << "| " + "Command".ljust(25) + "| " + "Description"
banner << "".ljust(80, "=")
@@ -194,7 +194,7 @@ module Shell
explain(<<~E)
## SUMMARY ##
When called with no argument, +help+ prints a table of all
- #{Chef::Dist::SHELL} commands. When called with an argument COMMAND, +help+
+ #{ChefUtils::Dist::Infra::SHELL} commands. When called with an argument COMMAND, +help+
prints a detailed explanation of the command if available, or the
description if no explanation is available.
E
@@ -208,9 +208,9 @@ module Shell
end
alias :halp :help
- desc "prints information about #{Chef::Dist::PRODUCT}"
+ desc "prints information about #{ChefUtils::Dist::Infra::PRODUCT}"
def version
- puts "Welcome to the #{Chef::Dist::SHELL} #{::Chef::VERSION}\n" +
+ puts "Welcome to the #{ChefUtils::Dist::Infra::SHELL} #{::Chef::VERSION}\n" +
"For usage see https://docs.chef.io/chef_shell/"
:ucanhaz_automation
end
@@ -228,7 +228,7 @@ module Shell
:attributes
end
- desc "run #{Chef::Dist::PRODUCT} using the current recipe"
+ desc "run #{ChefUtils::Dist::Infra::PRODUCT} using the current recipe"
def run_chef
Chef::Log.level = :debug
session = Shell.session
@@ -237,8 +237,8 @@ module Shell
runrun
end
- desc "returns an object to control a paused #{Chef::Dist::PRODUCT} run"
- subcommands resume: "resume the #{Chef::Dist::PRODUCT} run",
+ desc "returns an object to control a paused #{ChefUtils::Dist::Infra::PRODUCT} run"
+ subcommands resume: "resume the #{ChefUtils::Dist::Infra::PRODUCT} run",
step: "run only the next resource",
skip_back: "move back in the run list",
skip_forward: "move forward in the run list"
@@ -309,9 +309,9 @@ module Shell
new_node = edit(existing_node)
## EDITOR SELECTION ##
- #{Chef::Dist::SHELL} looks for an editor using the following logic
+ #{ChefUtils::Dist::Infra::SHELL} looks for an editor using the following logic
1. Looks for an EDITOR set by Shell.editor = "EDITOR"
- 2. Looks for an EDITOR configured in your #{Chef::Dist::SHELL} config file
+ 2. Looks for an EDITOR configured in your #{ChefUtils::Dist::Infra::SHELL} config file
3. Uses the value of the EDITOR environment variable
E
def edit(object)
@@ -320,7 +320,7 @@ module Shell
return :failburger
end
- filename = "#{Chef::Dist::SHELL}-edit-#{object.class.name}-"
+ filename = "#{ChefUtils::Dist::Infra::SHELL}-edit-#{object.class.name}-"
if object.respond_to?(:name)
filename += object.name
elsif object.respond_to?(:id)
diff --git a/lib/chef/shell/shell_session.rb b/lib/chef/shell/shell_session.rb
index a1957c6667..a17d8bbc84 100644
--- a/lib/chef/shell/shell_session.rb
+++ b/lib/chef/shell/shell_session.rb
@@ -28,7 +28,7 @@ require_relative "../run_list/run_list_expansion"
require_relative "../formatters/base"
require_relative "../formatters/doc"
require_relative "../formatters/minimal"
-require_relative "../dist"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
module Shell
class ShellSession
@@ -90,7 +90,7 @@ module Shell
end
def save_node
- raise "Not Supported! #{self.class.name} doesn't support #save_node, maybe you need to run #{Chef::Dist::SHELL} in client mode?"
+ raise "Not Supported! #{self.class.name} doesn't support #save_node, maybe you need to run #{ChefUtils::Dist::Infra::SHELL} in client mode?"
end
def rebuild_context
diff --git a/lib/chef/train_transport.rb b/lib/chef/train_transport.rb
index 81d1ae09f2..4fe1fcadec 100644
--- a/lib/chef/train_transport.rb
+++ b/lib/chef/train_transport.rb
@@ -15,114 +15,15 @@
# limitations under the License.
#
-require "chef-config/mixin/credentials"
-require "train"
-require_relative "dist"
+require "chef-config/mixin/train_transport" unless defined?(ChefConfig::Mixin::TrainTransport)
class Chef
class TrainTransport
- extend ChefConfig::Mixin::Credentials
+ include ChefConfig::Mixin::TrainTransport
- #
- # Returns a RFC099 credentials profile as a hash
- #
- def self.load_credentials(profile)
- # Tomlrb.load_file returns a hash with keys as strings
- credentials = parse_credentials_file
- if contains_split_fqdn?(credentials, profile)
- Chef::Log.warn("Credentials file #{credentials_file_path} contains target '#{profile}' as a Hash, expected a string.")
- Chef::Log.warn("Hostnames must be surrounded by single quotes, e.g. ['host.example.org']")
- end
-
- # host names must be specified in credentials file as ['foo.example.org'] with quotes
- if !credentials.nil? && !credentials[profile].nil?
- credentials[profile].map { |k, v| [k.to_sym, v] }.to_h # return symbolized keys to match Train.options()
- else
- nil
- end
- end
-
- # Toml creates hashes when a key is separated by periods, e.g.
- # [host.example.org] => { host: { example: { org: {} } } }
- #
- # Returns true if the above example is true
- #
- # A hostname has to be specified as ['host.example.org']
- # This will be a common mistake so we should catch it
- #
- def self.contains_split_fqdn?(hash, fqdn)
- fqdn.split(".").reduce(hash) do |h, k|
- v = h[k]
- if Hash === v
- v
- else
- break false
- end
- end
- end
-
- # ChefConfig::Mixin::Credentials.credentials_file_path is designed around knife,
- # overriding it here.
- #
- # Credentials file preference:
- #
- # 1) target_mode.credentials_file
- # 2) /etc/chef/TARGET_MODE_HOST/credentials
- # 3) #credentials_file_path from parent ($HOME/.chef/credentials)
- #
- def self.credentials_file_path
- tm_config = Chef::Config.target_mode
- profile = tm_config.host
-
- credentials_file =
- if tm_config.credentials_file && File.exist?(tm_config.credentials_file)
- tm_config.credentials_file
- elsif File.exist?(Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/#{profile}/credentials"))
- Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/#{profile}/credentials")
- else
- super
- end
-
- raise ArgumentError, "No credentials file found for target '#{profile}'" unless credentials_file
- raise ArgumentError, "Credentials file specified for target mode does not exist: '#{credentials_file}'" unless File.exist?(credentials_file)
-
- Chef::Log.debug("Loading credentials file '#{credentials_file}' for target '#{profile}'")
-
- credentials_file
- end
-
- def self.build_transport(logger = Chef::Log.with_child(subsystem: "transport"))
- return nil unless Chef::Config.target_mode?
-
- # TODO: Consider supporting parsing the protocol from a URI passed to `--target`
- #
- train_config = {}
-
- # Load the target_mode config context from Chef::Config, and place any valid settings into the train configuration
- tm_config = Chef::Config.target_mode
- protocol = tm_config.protocol
- train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
- Chef::Log.trace("Using target mode options from #{Chef::Dist::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
-
- # Load the credentials file, and place any valid settings into the train configuration
- credentials = load_credentials(tm_config.host)
- if credentials
- valid_settings = credentials.select { |k| Train.options(protocol).key?(k) }
- valid_settings[:enable_password] = credentials[:enable_password] if credentials.key?(:enable_password)
- train_config.merge!(valid_settings)
- Chef::Log.trace("Using target mode options from credentials file: #{valid_settings.keys.join(", ")}") if valid_settings
- end
-
- train_config[:logger] = logger
-
- # Train handles connection retries for us
- Train.create(protocol, train_config)
- rescue SocketError => e # likely a dns failure, not caught by train
- e.message.replace "Error connecting to #{train_config[:target]} - #{e.message}"
- raise e
- rescue Train::PluginLoadError
- logger.error("Invalid target mode protocol: #{protocol}")
- exit(false)
+ def config
+ require "chef/config" unless defined?(Chef::Config)
+ Chef::Config
end
end
end
diff --git a/lib/chef/util/backup.rb b/lib/chef/util/backup.rb
index 5728dcaedd..e739488fb9 100644
--- a/lib/chef/util/backup.rb
+++ b/lib/chef/util/backup.rb
@@ -36,7 +36,7 @@ class Chef
slice_number = @new_resource.backup
backup_files = sorted_backup_files
if backup_files.length >= @new_resource.backup
- remainder = backup_files.slice(slice_number..-1)
+ remainder = backup_files.slice(slice_number..)
remainder.each do |backup_to_delete|
delete_backup(backup_to_delete)
end
diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb
index 3f8a925c4d..0774dea813 100644
--- a/lib/chef/util/diff.rb
+++ b/lib/chef/util/diff.rb
@@ -40,9 +40,6 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN THE
# SOFTWARE.
-require "diff/lcs"
-require "diff/lcs/hunk"
-
class Chef
class Util
class Diff
@@ -86,6 +83,9 @@ class Chef
# produces a unified-output-format diff with 3 lines of context
# ChefFS uses udiff() directly
def udiff(old_file, new_file)
+ require "diff/lcs"
+ require "diff/lcs/hunk"
+
diff_str = ""
file_length_difference = 0
diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb
index 479e96dfa2..7e78e1ecab 100644
--- a/lib/chef/util/dsc/configuration_generator.rb
+++ b/lib/chef/util/dsc/configuration_generator.rb
@@ -16,36 +16,34 @@
# limitations under the License.
#
-require_relative "../powershell/cmdlet"
+require_relative "../../mixin/powershell_exec"
class Chef::Util::DSC
class ConfigurationGenerator
+ include Chef::Mixin::PowershellExec
+
def initialize(node, config_directory)
@node = node
@config_directory = config_directory
end
- def configuration_document_from_script_code(code, configuration_flags, imports, shellout_flags)
+ def configuration_document_from_script_code(code, configuration_flags, imports)
Chef::Log.trace("DSC: DSC code:\n '#{code}'")
generated_script_path = write_document_generation_script(code, "chef_dsc", imports)
begin
- configuration_document_from_script_path(generated_script_path, "chef_dsc", configuration_flags, shellout_flags)
+ configuration_document_from_script_path(generated_script_path, "chef_dsc", configuration_flags)
ensure
::FileUtils.rm(generated_script_path)
end
end
- def configuration_document_from_script_path(script_path, configuration_name, configuration_flags, shellout_flags)
+ def configuration_document_from_script_path(script_path, configuration_name, configuration_flags)
validate_configuration_name!(configuration_name)
- document_generation_cmdlet = Chef::Util::Powershell::Cmdlet.new(
- @node,
- configuration_document_generation_code(script_path, configuration_name)
- )
-
- merged_configuration_flags = get_merged_configuration_flags!(configuration_flags, configuration_name)
+ config_generation_code = configuration_document_generation_code(script_path, configuration_name)
+ switches_string = command_switches_string(get_merged_configuration_flags!(configuration_flags, configuration_name))
- document_generation_cmdlet.run!(merged_configuration_flags, shellout_flags)
+ powershell_exec!("#{config_generation_code} #{switches_string}")
configuration_document_location = find_configuration_document(configuration_name)
unless configuration_document_location
@@ -59,6 +57,49 @@ class Chef::Util::DSC
protected
+ def validate_switch_name!(switch_parameter_name)
+ unless switch_parameter_name.match?(/\A[A-Za-z]+[_a-zA-Z0-9]*\Z/)
+ raise ArgumentError, "`#{switch_parameter_name}` is not a valid PowerShell cmdlet switch parameter name"
+ end
+ end
+
+ def escape_parameter_value(parameter_value)
+ parameter_value.gsub(/(`|'|"|#)/, '`\1')
+ end
+
+ def escape_string_parameter_value(parameter_value)
+ "'#{escape_parameter_value(parameter_value)}'"
+ end
+
+ def command_switches_string(switches)
+ command_switches = switches.map do |switch_name, switch_value|
+ if switch_name.class != Symbol
+ raise ArgumentError, "Invalid type `#{switch_name} `for PowerShell switch '#{switch_name}'. The switch must be specified as a Symbol'"
+ end
+
+ validate_switch_name!(switch_name)
+
+ switch_argument = ""
+ switch_present = true
+
+ case switch_value
+ when Numeric, Float
+ switch_argument = switch_value.to_s
+ when FalseClass
+ switch_present = false
+ when TrueClass
+ when String
+ switch_argument = escape_string_parameter_value(switch_value)
+ else
+ raise ArgumentError, "Invalid argument type `#{switch_value.class}` specified for PowerShell switch `:#{switch_name}`. Arguments to PowerShell must be of type `String`, `Numeric`, `Float`, `FalseClass`, or `TrueClass`"
+ end
+
+ switch_present ? ["-#{switch_name.to_s.downcase}", switch_argument].join(" ").strip : ""
+ end
+
+ command_switches.join(" ")
+ end
+
# From PowerShell error help for the Configuration language element:
# Standard names may only contain letters (a-z, A-Z), numbers (0-9), and underscore (_).
# The name may not be null or empty, and should start with a letter.
diff --git a/lib/chef/util/dsc/lcm_output_parser.rb b/lib/chef/util/dsc/lcm_output_parser.rb
index 38c202a4bb..d05ea3ba68 100644
--- a/lib/chef/util/dsc/lcm_output_parser.rb
+++ b/lib/chef/util/dsc/lcm_output_parser.rb
@@ -75,23 +75,21 @@ class Chef
#
def self.parse(lcm_output, test_dsc_configuration)
+ lcm_output = String(lcm_output).split("\n")
test_dsc_configuration ? test_dsc_parser(lcm_output) : what_if_parser(lcm_output)
end
def self.test_dsc_parser(lcm_output)
- lcm_output ||= ""
current_resource = {}
resources = []
- lcm_output.lines.each do |line|
+ lcm_output.each do |line|
op_action , op_value = line.strip.split(":")
op_action&.strip!
case op_action
when "InDesiredState"
current_resource[:skipped] = op_value.strip == "True" ? true : false
- when "ResourcesInDesiredState"
- current_resource[:name] = op_value.strip if op_value
- when "ResourcesNotInDesiredState"
+ when "ResourcesInDesiredState", "ResourcesNotInDesiredState"
current_resource[:name] = op_value.strip if op_value
when "ReturnValue"
current_resource[:context] = nil
@@ -109,11 +107,10 @@ class Chef
end
def self.what_if_parser(lcm_output)
- lcm_output ||= ""
current_resource = {}
resources = []
- lcm_output.lines.each do |line|
+ lcm_output.each do |line|
op_action, op_type, info = parse_line(line)
case op_action
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb
index 138011e89e..091d4aa426 100644
--- a/lib/chef/util/dsc/local_configuration_manager.rb
+++ b/lib/chef/util/dsc/local_configuration_manager.rb
@@ -16,25 +16,27 @@
# limitations under the License.
#
-require_relative "../powershell/cmdlet"
+require_relative "../../mixin/powershell_exec"
require_relative "lcm_output_parser"
class Chef::Util::DSC
class LocalConfigurationManager
+ include Chef::Mixin::PowershellExec
+
def initialize(node, configuration_path)
@node = node
@configuration_path = configuration_path
clear_execution_time
end
- def test_configuration(configuration_document, shellout_flags)
- status = run_configuration_cmdlet(configuration_document, false, shellout_flags)
- log_dsc_exception(status.stderr) unless status.succeeded?
- configuration_update_required?(status.return_value)
+ def test_configuration(configuration_document)
+ status = run_configuration_cmdlet(configuration_document, false)
+ log_dsc_exception(status.errors.join("\n")) if status.error?
+ configuration_update_required?(status.result)
end
- def set_configuration(configuration_document, shellout_flags)
- run_configuration_cmdlet(configuration_document, true, shellout_flags)
+ def set_configuration(configuration_document)
+ run_configuration_cmdlet(configuration_document, true)
end
def last_operation_execution_time_seconds
@@ -45,7 +47,7 @@ class Chef::Util::DSC
private
- def run_configuration_cmdlet(configuration_document, apply_configuration, shellout_flags)
+ def run_configuration_cmdlet(configuration_document, apply_configuration)
Chef::Log.trace("DSC: Calling DSC Local Config Manager to #{apply_configuration ? "set" : "test"} configuration document.")
start_operation_timing
@@ -53,11 +55,12 @@ class Chef::Util::DSC
begin
save_configuration_document(configuration_document)
- cmdlet = ::Chef::Util::Powershell::Cmdlet.new(@node, lcm_command(apply_configuration))
+ cmd = lcm_command(apply_configuration)
+ Chef::Log.trace("DSC: Calling DSC Local Config Manager with:\n#{cmd}")
+
+ status = powershell_exec(cmd)
if apply_configuration
- status = cmdlet.run!({}, shellout_flags)
- else
- status = cmdlet.run({}, shellout_flags)
+ status.error!
end
ensure
end_operation_timing
@@ -77,7 +80,7 @@ class Chef::Util::DSC
ps4_base_command
else
if ps_version_gte_5?
- "#{common_command_prefix} Test-DscConfiguration -path #{@configuration_path} | format-list"
+ "#{common_command_prefix} Test-DscConfiguration -path #{@configuration_path} | format-list | Out-String"
else
ps4_base_command + " -whatif; if (! $?) { exit 1 }"
end
@@ -100,12 +103,12 @@ class Chef::Util::DSC
end
def whatif_not_supported?(dsc_exception_output)
- !! (dsc_exception_output.gsub(/[\r\n]+/, "").gsub(/\s+/, " ") =~ /A parameter cannot be found that matches parameter name 'Whatif'/i)
+ !! (dsc_exception_output.gsub(/[\n]+/, "").gsub(/\s+/, " ") =~ /A parameter cannot be found that matches parameter name 'Whatif'/i)
end
def dsc_module_import_failure?(command_output)
!! (command_output =~ /\sCimException/ &&
- command_output =~ /ProviderOperationExecutionFailure/ &&
+ command_output.include?("ProviderOperationExecutionFailure") &&
command_output =~ /\smodule\s+is\s+installed/)
end
diff --git a/lib/chef/util/dsc/resource_store.rb b/lib/chef/util/dsc/resource_store.rb
index 772bc82468..49ca46832a 100644
--- a/lib/chef/util/dsc/resource_store.rb
+++ b/lib/chef/util/dsc/resource_store.rb
@@ -16,14 +16,14 @@
# limitations under the License.
#
-require_relative "../powershell/cmdlet"
-require_relative "../powershell/cmdlet_result"
+require_relative "../../mixin/powershell_exec"
require_relative "../../exceptions"
class Chef
class Util
class DSC
class ResourceStore
+ include Chef::Mixin::PowershellExec
def self.instance
@@instance ||= ResourceStore.new.tap do |store|
@@ -83,19 +83,13 @@ class Chef
# Returns a list of dsc resources
def query_resources
- cmdlet = Chef::Util::Powershell::Cmdlet.new(nil, "get-dscresource",
- :object)
- result = cmdlet.run
- result.return_value
+ powershell_exec("get-dscresource").result
end
# Returns a list of dsc resources matching the provided name
def query_resource(resource_name)
- cmdlet = Chef::Util::Powershell::Cmdlet.new(nil, "get-dscresource #{resource_name}",
- :object)
- result = cmdlet.run
- ret_val = result.return_value
- if ret_val.nil?
+ ret_val = powershell_exec("get-dscresource #{resource_name}").result
+ if ret_val.empty?
[]
elsif ret_val.is_a? Array
ret_val
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
deleted file mode 100644
index 344e20f466..0000000000
--- a/lib/chef/util/powershell/cmdlet.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-#
-# Author:: Adam Edwards (<adamed@chef.io>)
-#
-# Copyright:: Copyright (c) Chef Software Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "mixlib/shellout" unless defined?(Mixlib::ShellOut::DEFAULT_READ_TIMEOUT)
-require_relative "../../mixin/windows_architecture_helper"
-require_relative "cmdlet_result"
-
-class Chef
- class Util
- class Powershell
- class Cmdlet
- def initialize(node, cmdlet, output_format = nil, output_format_options = {})
- @output_format = output_format
- @node = node
-
- case output_format
- when nil
- @json_format = false
- when :json
- @json_format = true
- when :text
- @json_format = false
- when :object
- @json_format = true
- else
- raise ArgumentError, "Invalid output format #{output_format} specified"
- end
-
- @cmdlet = cmdlet
- @output_format_options = output_format_options
- end
-
- attr_reader :output_format
-
- def run(switches = {}, execution_options = {}, *arguments)
- streams = { json: CmdletStream.new("json"),
- verbose: CmdletStream.new("verbose"),
- }
-
- arguments_string = arguments.join(" ")
-
- switches_string = command_switches_string(switches)
-
- json_depth = 5
-
- if @json_format && @output_format_options.key?(:depth)
- json_depth = @output_format_options[:depth]
- end
-
- json_command = if @json_format
- " | convertto-json -compress -depth #{json_depth} > #{streams[:json].path}"
- else
- ""
- end
- redirections = "4> '#{streams[:verbose].path}'"
- command_string = "powershell.exe -executionpolicy bypass -noprofile -noninteractive "\
- "-command \"trap [Exception] {write-error -exception "\
- "($_.Exception.Message);exit 1};#{@cmdlet} #{switches_string} "\
- "#{arguments_string} #{redirections}"\
- "#{json_command}\";if ( ! $? ) { exit 1 }"
-
- augmented_options = { returns: [0], live_stream: false }.merge(execution_options)
- command = Mixlib::ShellOut.new(command_string, augmented_options)
-
- status = nil
-
- with_os_architecture(@node) do
- status = command.run_command
- end
-
- CmdletResult.new(status, streams, @output_format)
- end
-
- def run!(switches = {}, execution_options = {}, *arguments)
- result = run(switches, execution_options, arguments)
-
- unless result.succeeded?
- raise Chef::Exceptions::PowershellCmdletException, "PowerShell Cmdlet failed: #{result.stderr}"
- end
-
- result
- end
-
- protected
-
- include Chef::Mixin::WindowsArchitectureHelper
-
- def validate_switch_name!(switch_parameter_name)
- if !!(switch_parameter_name =~ /\A[A-Za-z]+[_a-zA-Z0-9]*\Z/) == false
- raise ArgumentError, "`#{switch_parameter_name}` is not a valid PowerShell cmdlet switch parameter name"
- end
- end
-
- def escape_parameter_value(parameter_value)
- parameter_value.gsub(/(`|'|"|#)/, '`\1')
- end
-
- def escape_string_parameter_value(parameter_value)
- "'#{escape_parameter_value(parameter_value)}'"
- end
-
- def command_switches_string(switches)
- command_switches = switches.map do |switch_name, switch_value|
- if switch_name.class != Symbol
- raise ArgumentError, "Invalid type `#{switch_name} `for PowerShell switch '#{switch_name}'. The switch must be specified as a Symbol'"
- end
-
- validate_switch_name!(switch_name)
-
- switch_argument = ""
- switch_present = true
-
- case switch_value
- when Numeric
- switch_argument = switch_value.to_s
- when Float
- switch_argument = switch_value.to_s
- when FalseClass
- switch_present = false
- when TrueClass
- when String
- switch_argument = escape_string_parameter_value(switch_value)
- else
- raise ArgumentError, "Invalid argument type `#{switch_value.class}` specified for PowerShell switch `:#{switch_name}`. Arguments to PowerShell must be of type `String`, `Numeric`, `Float`, `FalseClass`, or `TrueClass`"
- end
-
- switch_present ? ["-#{switch_name.to_s.downcase}", switch_argument].join(" ").strip : ""
- end
-
- command_switches.join(" ")
- end
-
- class CmdletStream
- def initialize(name)
- @filename = Dir::Tmpname.create(name) {}
- ObjectSpace.define_finalizer(self, self.class.destroy(@filename))
- end
-
- def path
- @filename
- end
-
- def read
- if File.exist? @filename
- File.open(@filename, "rb:bom|UTF-16LE") do |f|
- f.read.encode("UTF-8")
- end
- end
- end
-
- def self.destroy(name)
- proc { File.delete(name) if File.exist? name }
- end
- end
- end
- end
- end
-end
diff --git a/lib/chef/util/powershell/cmdlet_result.rb b/lib/chef/util/powershell/cmdlet_result.rb
deleted file mode 100644
index 7aee2e8c4b..0000000000
--- a/lib/chef/util/powershell/cmdlet_result.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Author:: Adam Edwards (<adamed@chef.io>)
-#
-# Copyright:: Copyright (c) Chef Software Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require_relative "../../json_compat"
-
-class Chef
- class Util
- class Powershell
- class CmdletResult
- attr_reader :output_format
-
- def initialize(status, streams, output_format)
- @status = status
- @output_format = output_format
- @streams = streams
- end
-
- def stdout
- @status.stdout
- end
-
- def stderr
- @status.stderr
- end
-
- def stream(name)
- @streams[name].read
- end
-
- def return_value
- if output_format == :object
- Chef::JSONCompat.parse(stream(:json))
- elsif output_format == :json
- stream(:json)
- else
- @status.stdout
- end
- end
-
- def succeeded?
- @succeeded = @status.status.exitstatus == 0
- end
- end
- end
- end
-end
diff --git a/lib/chef/util/powershell/ps_credential.rb b/lib/chef/util/powershell/ps_credential.rb
index cc11cc6c36..0404f5a1ac 100644
--- a/lib/chef/util/powershell/ps_credential.rb
+++ b/lib/chef/util/powershell/ps_credential.rb
@@ -18,24 +18,28 @@
require_relative "../../win32/crypto" if ChefUtils.windows?
-class Chef::Util::Powershell
- class PSCredential
- def initialize(username, password)
- @username = username
- @password = password
- end
+class Chef
+ class Util
+ class Powershell
+ class PSCredential
+ def initialize(username, password)
+ @username = username
+ @password = password
+ end
- def to_psobject
- "New-Object System.Management.Automation.PSCredential('#{@username}',('#{encrypt(@password)}' | ConvertTo-SecureString))"
- end
+ def to_psobject
+ "New-Object System.Management.Automation.PSCredential('#{@username}',('#{encrypt(@password)}' | ConvertTo-SecureString))"
+ end
- alias to_s to_psobject
- alias to_text to_psobject
+ alias to_s to_psobject
+ alias to_text to_psobject
- private
+ private
- def encrypt(str)
- Chef::ReservedNames::Win32::Crypto.encrypt(str)
+ def encrypt(str)
+ Chef::ReservedNames::Win32::Crypto.encrypt(str)
+ end
+ end
end
end
end
diff --git a/lib/chef/util/threaded_job_queue.rb b/lib/chef/util/threaded_job_queue.rb
index efbb67216f..bce25e9225 100644
--- a/lib/chef/util/threaded_job_queue.rb
+++ b/lib/chef/util/threaded_job_queue.rb
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "thread"
-
class Chef
class Util
# A simple threaded job queue
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index 83ef80db59..1e519ca7c1 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require_relative "version_string"
class Chef
CHEF_ROOT = File.expand_path("..", __dir__)
- VERSION = Chef::VersionString.new("16.5.26")
+ VERSION = Chef::VersionString.new("17.0.0")
end
#
diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb
index eb83e2487d..c18bc08e8b 100644
--- a/lib/chef/win32/api/file.rb
+++ b/lib/chef/win32/api/file.rb
@@ -316,6 +316,7 @@ typedef struct _REPARSE_DATA_BUFFER {
string_pointer.read_wstring(self[:PrintNameLength] / 2)
end
end
+
class REPARSE_DATA_BUFFER_MOUNT_POINT < FFI::Struct
layout :SubstituteNameOffset, :ushort,
:SubstituteNameLength, :ushort,
@@ -333,14 +334,17 @@ typedef struct _REPARSE_DATA_BUFFER {
string_pointer.read_wstring(self[:PrintNameLength] / 2)
end
end
+
class REPARSE_DATA_BUFFER_GENERIC < FFI::Struct
layout :DataBuffer, :uchar
end
+
class REPARSE_DATA_BUFFER_UNION < FFI::Union
layout :SymbolicLinkReparseBuffer, REPARSE_DATA_BUFFER_SYMBOLIC_LINK,
:MountPointReparseBuffer, REPARSE_DATA_BUFFER_MOUNT_POINT,
:GenericReparseBuffer, REPARSE_DATA_BUFFER_GENERIC
end
+
class REPARSE_DATA_BUFFER < FFI::Struct
layout :ReparseTag, :uint32,
:ReparseDataLength, :ushort,
diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb
index e898144414..55fc2461e8 100644
--- a/lib/chef/win32/file.rb
+++ b/lib/chef/win32/file.rb
@@ -124,7 +124,7 @@ class Chef
# Return the link destination (strip off \??\ at the beginning, which is a local filesystem thing)
link_dest = reparse_buffer.reparse_buffer.substitute_name
if /^\\\?\?\\/.match?(link_dest)
- link_dest = link_dest[4..-1]
+ link_dest = link_dest[4..]
end
link_dest
end
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index 6a9f229b27..4b5f8ede41 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -21,9 +21,8 @@ require_relative "api"
require_relative "../mixin/wide_string"
if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
- require_relative "../monkey_patches/win32/registry"
+ Win32.autoload :Registry, File.expand_path("../monkey_patches/win32/registry", __dir__)
require_relative "api/registry"
- require "win32/registry" unless defined?(Win32::Registry)
require "win32/api"
end
diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb
index ed6c7bd65d..aaf3532fc4 100644
--- a/lib/chef/win32/security/sid.rb
+++ b/lib/chef/win32/security/sid.rb
@@ -321,7 +321,7 @@ class Chef
while status == ERROR_MORE_DATA
status = NetUserEnum(servername, level, filter, bufptr, prefmaxlen, entriesread, totalentries, resume_handle)
- if status == NERR_Success || status == ERROR_MORE_DATA
+ if [NERR_Success, ERROR_MORE_DATA].include?(status)
Array.new(entriesread.read_long) do |i|
user_info = USER_INFO_3.new(bufptr.read_pointer + i * USER_INFO_3.size)
# Check if the account is the Administrator account
diff --git a/lib/chef/win32/unicode.rb b/lib/chef/win32/unicode.rb
index f6e97737de..731fe2fbd9 100644
--- a/lib/chef/win32/unicode.rb
+++ b/lib/chef/win32/unicode.rb
@@ -40,7 +40,7 @@ module FFI
last_char = nil
while last_char != "\000\000"
length += 1
- last_char = get_bytes(0, length * 2)[-2..-1]
+ last_char = get_bytes(0, length * 2)[-2..]
end
num_wchars = length
diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock
index 782ea8a287..412dcba213 100644
--- a/omnibus/Gemfile.lock
+++ b/omnibus/Gemfile.lock
@@ -1,28 +1,28 @@
GIT
remote: https://github.com/chef/omnibus
- revision: 0f93174d58ae94f42c75b285a20e1f83381b864c
+ revision: d13ae1686e8b54e065ce2a3f27585a2890f1abec
branch: master
specs:
- omnibus (7.0.23)
+ omnibus (8.0.9)
aws-sdk-s3 (~> 1)
chef-cleanroom (~> 1.0)
- chef-sugar (>= 3.3)
+ chef-utils (>= 15.4)
ffi-yajl (~> 2.2)
license_scout (~> 1.0)
mixlib-shellout (>= 2.0, < 4.0)
mixlib-versioning
- ohai (>= 13, < 17)
+ ohai (>= 15)
pedump
ruby-progressbar (~> 1.7)
thor (>= 0.18, < 2.0)
GIT
remote: https://github.com/chef/omnibus-software
- revision: 379f9c7fe65e867af2b69b28b2ced739526f9842
+ revision: 457df26b59259183d2918e802ffb79de9a134e27
branch: master
specs:
omnibus-software (4.0.0)
- omnibus (>= 5.6.1)
+ omnibus (>= 8.0.0)
GEM
remote: https://rubygems.org/
@@ -32,18 +32,18 @@ GEM
artifactory (3.0.15)
awesome_print (1.8.0)
aws-eventstream (1.1.0)
- aws-partitions (1.360.0)
- aws-sdk-core (3.105.0)
+ aws-partitions (1.410.0)
+ aws-sdk-core (3.110.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
- aws-sdk-kms (1.37.0)
- aws-sdk-core (~> 3, >= 3.99.0)
+ aws-sdk-kms (1.40.0)
+ aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
- aws-sdk-s3 (1.79.1)
- aws-sdk-core (~> 3, >= 3.104.3)
- aws-sdk-kms (~> 1)
+ aws-sdk-s3 (1.86.2)
+ aws-sdk-core (~> 3, >= 3.109.0)
+ aws-sdk-kms (~> 1.26)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
@@ -64,12 +64,12 @@ GEM
solve (~> 4.0)
thor (>= 0.20)
builder (3.2.4)
- chef (16.4.41)
+ chef (16.7.61)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
bundler (>= 1.10)
- chef-config (= 16.4.41)
- chef-utils (= 16.4.41)
+ chef-config (= 16.7.61)
+ chef-utils (= 16.7.61)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -80,7 +80,7 @@ GEM
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 3)
iniparse (~> 1.4)
- license-acceptance (~> 1.0, >= 1.0.5)
+ license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
@@ -98,13 +98,14 @@ GEM
train-winrm (>= 0.2.5)
tty-prompt (~> 0.21)
tty-screen (~> 0.6)
+ tty-table (~> 0.11)
uuidtools (~> 2.1.5)
- chef (16.4.41-universal-mingw32)
+ chef (16.7.61-universal-mingw32)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
bundler (>= 1.10)
- chef-config (= 16.4.41)
- chef-utils (= 16.4.41)
+ chef-config (= 16.7.61)
+ chef-utils (= 16.7.61)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -116,7 +117,7 @@ GEM
highline (>= 1.6.9, < 3)
iniparse (~> 1.4)
iso8601 (>= 0.12.1, < 0.14)
- license-acceptance (~> 1.0, >= 1.0.5)
+ license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
@@ -134,6 +135,7 @@ GEM
train-winrm (>= 0.2.5)
tty-prompt (~> 0.21)
tty-screen (~> 0.6)
+ tty-table (~> 0.11)
uuidtools (~> 2.1.5)
win32-api (~> 1.5.3)
win32-certstore (~> 0.3)
@@ -141,22 +143,21 @@ GEM
win32-eventlog (= 0.6.3)
win32-mmap (~> 0.4.1)
win32-mutex (~> 0.4.2)
- win32-process (~> 0.8.2)
+ win32-process (~> 0.9)
win32-service (>= 2.1.5, < 3.0)
win32-taskscheduler (~> 2.0)
wmi-lite (~> 1.0)
chef-cleanroom (1.0.2)
- chef-config (16.4.41)
+ chef-config (16.7.61)
addressable
- chef-utils (= 16.4.41)
+ chef-utils (= 16.7.61)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
tomlrb (~> 1.2)
- chef-sugar (5.1.11)
- chef-utils (16.4.41)
- chef-vault (4.0.11)
- chef-zero (15.0.2)
+ chef-utils (16.7.61)
+ chef-vault (4.1.0)
+ chef-zero (15.0.3)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
@@ -167,21 +168,22 @@ GEM
concurrent-ruby (1.1.7)
diff-lcs (1.3)
ed25519 (1.2.4)
- erubi (1.9.0)
+ erubi (1.10.0)
erubis (2.7.0)
- faraday (1.0.1)
+ faraday (1.1.0)
multipart-post (>= 1.2, < 3)
+ ruby2_keywords
ffi (1.13.1)
ffi (1.13.1-x64-mingw32)
ffi (1.13.1-x86-mingw32)
ffi-libarchive (1.0.4)
ffi (~> 1.0)
- ffi-win32-extensions (1.0.3)
+ ffi-win32-extensions (1.0.4)
ffi
ffi-yajl (2.3.4)
libyajl2 (~> 1.2)
fuzzyurl (0.9.0)
- gssapi (1.3.0)
+ gssapi (1.3.1)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
@@ -193,16 +195,16 @@ GEM
ipaddress (0.8.3)
iso8601 (0.13.0)
jmespath (1.4.0)
- json (2.3.1)
- kitchen-vagrant (1.7.0)
+ json (2.4.1)
+ kitchen-vagrant (1.7.2)
test-kitchen (>= 1.4, < 3)
libyajl2 (1.2.0)
- license-acceptance (1.0.19)
+ license-acceptance (2.1.13)
pastel (~> 0.7)
- tomlrb (~> 1.2)
- tty-box (~> 0.3)
- tty-prompt (~> 0.18)
- license_scout (1.1.9)
+ tomlrb (>= 1.2, < 3.0)
+ tty-box (~> 0.6)
+ tty-prompt (~> 0.20)
+ license_scout (1.2.7)
ffi-yajl (~> 2.2)
mixlib-shellout (>= 2.2, < 4.0)
toml-rb (>= 1, < 3)
@@ -219,19 +221,20 @@ GEM
mixlib-cli (2.1.8)
mixlib-config (3.0.9)
tomlrb
- mixlib-install (3.12.3)
+ mixlib-install (3.12.5)
mixlib-shellout
mixlib-versioning
thor
mixlib-log (3.0.9)
- mixlib-shellout (3.1.4)
+ mixlib-shellout (3.2.2)
chef-utils
- mixlib-shellout (3.1.4-universal-mingw32)
+ mixlib-shellout (3.2.2-universal-mingw32)
chef-utils
- win32-process (~> 0.8.2)
+ ffi-win32-extensions (~> 1.0.3)
+ win32-process (~> 0.9)
wmi-lite (~> 1.0)
mixlib-versioning (1.2.12)
- molinillo (0.6.6)
+ molinillo (0.7.0)
multi_json (1.15.0)
multipart-post (2.1.1)
net-scp (3.0.0)
@@ -245,10 +248,10 @@ GEM
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
nori (2.6.0)
- octokit (4.18.0)
+ octokit (4.19.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
- ohai (16.4.12)
+ ohai (16.8.1)
chef-config (>= 12.8, < 17)
chef-utils (>= 16.0, < 17)
ffi (~> 1.9)
@@ -259,6 +262,7 @@ GEM
mixlib-log (>= 2.0.1, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
plist (~> 3.1)
+ train-core
wmi-lite (~> 1.0)
pastel (0.8.0)
tty-color (~> 0.5)
@@ -270,11 +274,12 @@ GEM
zhexdump (>= 0.0.2)
plist (3.5.0)
proxifier (1.0.3)
- public_suffix (4.0.5)
+ public_suffix (4.0.6)
rack (2.2.3)
rainbow (3.0.0)
retryable (3.0.5)
ruby-progressbar (1.10.1)
+ ruby2_keywords (0.0.2)
rubyntlm (0.6.2)
rubyzip (2.3.0)
sawyer (0.8.2)
@@ -291,7 +296,7 @@ GEM
strings-ansi (0.2.0)
structured_warnings (0.4.0)
syslog-logger (1.6.8)
- test-kitchen (2.6.0)
+ test-kitchen (2.8.0)
bcrypt_pbkdf (~> 1.0)
ed25519 (~> 1.2)
license-acceptance (>= 1.0.11, < 3.0)
@@ -308,30 +313,35 @@ GEM
toml-rb (2.0.1)
citrus (~> 3.0, > 3.0)
tomlrb (1.3.0)
- train-core (3.3.16)
+ train-core (3.4.4)
addressable (~> 2.5)
ffi (!= 1.13.0)
json (>= 1.8, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
net-scp (>= 1.2, < 4.0)
net-ssh (>= 2.9, < 7.0)
- train-winrm (0.2.6)
+ train-winrm (0.2.11)
winrm (~> 2.0)
+ winrm-elevated (~> 1.2.2)
winrm-fs (~> 1.0)
tty-box (0.6.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-cursor (~> 0.7)
- tty-color (0.5.2)
+ tty-color (0.6.0)
tty-cursor (0.7.1)
- tty-prompt (0.22.0)
+ tty-prompt (0.23.0)
pastel (~> 0.8)
tty-reader (~> 0.8)
- tty-reader (0.8.0)
+ tty-reader (0.9.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
+ tty-table (0.12.0)
+ pastel (~> 0.8)
+ strings (~> 0.2.0)
+ tty-screen (~> 0.8)
unicode-display_width (1.7.0)
unicode_utils (1.4.0)
uuidtools (2.1.5)
@@ -349,15 +359,15 @@ GEM
ffi
win32-mutex (0.4.3)
win32-ipc (>= 0.6.0)
- win32-process (0.8.3)
+ win32-process (0.9.0)
ffi (>= 1.0.0)
- win32-service (2.1.6)
+ win32-service (2.2.0)
ffi
ffi-win32-extensions
win32-taskscheduler (2.0.4)
ffi
structured_warnings
- winrm (2.3.4)
+ winrm (2.3.5)
builder (>= 2.1.2)
erubi (~> 1.8)
gssapi (~> 1.2)
@@ -366,11 +376,11 @@ GEM
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
- winrm-elevated (1.2.1)
+ winrm-elevated (1.2.3)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
- winrm-fs (1.3.4)
+ winrm-fs (1.3.5)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 2.0)
diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb
index 4dae4168d7..5a8c8e8da0 100644
--- a/omnibus/config/projects/chef.rb
+++ b/omnibus/config/projects/chef.rb
@@ -103,6 +103,7 @@ package :msi do
ProjectLocationDir: project_location_dir
end
+# We don't support appx builds, and they eat a lot of time.
package :appx do
- signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
+ skip_packager true
end
diff --git a/omnibus/config/software/more-ruby-cleanup.rb b/omnibus/config/software/more-ruby-cleanup.rb
index e2d24df540..d7c3b6000f 100644
--- a/omnibus/config/software/more-ruby-cleanup.rb
+++ b/omnibus/config/software/more-ruby-cleanup.rb
@@ -54,12 +54,16 @@ build do
examples
ext
Gemfile.lock
+ install.rb
java
patches
perf
rakelib
+ README-json-jruby.md
+ references
sample
samples
+ script
site
vendor
VERSION
@@ -113,6 +117,8 @@ build do
xmllint
xslt-config
xsltproc
+ coderay
+ ffi-yajl-bench
}.each do |f|
file_path = "#{install_dir}/embedded/bin/#{f}"
diff --git a/omnibus/files/openssl-customization/windows/ssl_env_hack.rb b/omnibus/files/openssl-customization/windows/ssl_env_hack.rb
index b86c17db82..27ba267e36 100644
--- a/omnibus/files/openssl-customization/windows/ssl_env_hack.rb
+++ b/omnibus/files/openssl-customization/windows/ssl_env_hack.rb
@@ -22,7 +22,7 @@
# This is required to make Chef tools use https URLs out of the box.
unless ENV.key?("SSL_CERT_FILE")
- base_dirs = File.dirname(__FILE__).split(File::SEPARATOR)
+ base_dirs = __dir__.split(File::SEPARATOR)
(base_dirs.length - 1).downto(0) do |i|
candidate_ca_bundle = File.join(base_dirs[0..i] + [ "ssl/certs/cacert.pem" ])
diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1
index 4384563296..aa23a6442a 100644
--- a/omnibus/omnibus-test.ps1
+++ b/omnibus/omnibus-test.ps1
@@ -2,7 +2,14 @@
$ErrorActionPreference = "Stop"
# install chocolatey
-Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
+Set-ExecutionPolicy Bypass -Scope Process -Force
+[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
+iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
+
+# install powershell core
+Invoke-WebRequest "https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.msi" -UseBasicParsing -OutFile powershell.msi
+Start-Process msiexec.exe -Wait -ArgumentList "/package PowerShell.msi /quiet"
+$env:path += ";C:\Program Files\PowerShell\7"
$channel = "$Env:CHANNEL"
If ([string]::IsNullOrEmpty($channel)) { $channel = "unstable" }
@@ -107,13 +114,13 @@ $env:Path = $p
# desktop heap exhaustion seems likely (https://docs.microsoft.com/en-us/archive/blogs/ntdebugging/desktop-heap-overview)
$exit = 0
-bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f progress --profile -- ./spec/unit
+bundle exec rspec -f progress --profile -- ./spec/unit
If ($lastexitcode -ne 0) { $exit = 1 }
-bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f progress --profile -- ./spec/functional
+bundle exec rspec -f progress --profile -- ./spec/functional
If ($lastexitcode -ne 0) { $exit = 1 }
-bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f progress --profile -- ./spec/integration
+bundle exec rspec -f progress --profile -- ./spec/integration
If ($lastexitcode -ne 0) { $exit = 1 }
Exit $exit
diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh
index c0ec0e1575..2c1313681c 100644
--- a/omnibus/omnibus-test.sh
+++ b/omnibus/omnibus-test.sh
@@ -151,4 +151,4 @@ export CHEF_LICENSE=accept-no-persist
cd "$chef_gem"
sudo -E bundle install --jobs=3 --retry=3
-sudo -E bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml --profile -f progress
+sudo -E bundle exec rspec --profile -f progress
diff --git a/omnibus/omnibus.rb b/omnibus/omnibus.rb
index c04c3a87a0..99817f7caf 100644
--- a/omnibus/omnibus.rb
+++ b/omnibus/omnibus.rb
@@ -31,12 +31,7 @@ env_omnibus_windows_arch = :x86 unless %w{x86 x64}.include?(env_omnibus_windows_
windows_arch env_omnibus_windows_arch
-# Disable git caching
-# caching is currently disabled as it causes issues when we're running
-# builds of different product versions on the same host. When forked to prep
-# for the next major release this has caused problems. To enable again:
-# ------------------------------
-use_git_caching false
+use_git_caching true
# Enable S3 asset caching
# ------------------------------
diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb
index d173ee3b33..b7d515341a 100644
--- a/omnibus_overrides.rb
+++ b/omnibus_overrides.rb
@@ -3,11 +3,11 @@
#
# NOTE: You MUST update omnibus-software when adding new versions of
# software here: bundle exec rake dependencies:update_omnibus_gemfile_lock
-override :rubygems, version: "3.1.2" # pin to what ships in the ruby version
+override :rubygems, version: "3.1.4" # pin to what ships in the ruby version
override :bundler, version: "2.1.4" # pin to what ships in the ruby version
-override "libarchive", version: "3.4.3"
+override "libarchive", version: "3.5.0"
override "libffi", version: "3.3"
-override "libiconv", version: "1.15"
+override "libiconv", version: "1.16"
override "liblzma", version: "5.2.5"
override "libtool", version: "2.4.2"
override "libxml2", version: "2.9.10"
@@ -16,9 +16,9 @@ override "libyaml", version: "0.1.7"
override "makedepend", version: "1.0.5"
override "ncurses", version: "5.9"
override "nokogiri", version: "1.10.10"
-override "openssl", version: "1.0.2v"
+override "openssl", version: "1.0.2x"
override "pkg-config-lite", version: "0.28-1"
-override "ruby", version: "2.7.1"
+override "ruby", version: "2.7.2"
override "ruby-windows-devkit-bash", version: "3.1.23-4-msys-1.0.18"
override "util-macros", version: "1.19.0"
override "xproto", version: "7.0.28"
@@ -29,5 +29,5 @@ override "zlib", version: "1.2.11"
# is in master, which won't match what's in the Gemfile.lock and used by the chef
# definition. This pin will ensure that ohai and chef-client commands use the
# same (released) version of ohai.
-gemfile_lock = File.join(File.expand_path(File.dirname(__FILE__)), "Gemfile.lock")
+gemfile_lock = File.join(File.expand_path(__dir__), "Gemfile.lock")
override "ohai", version: "#{::File.readlines(gemfile_lock).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; "v" + $1}" # rubocop: disable Layout/SpaceInsideStringInterpolation
diff --git a/spec/data/shef-config.rb b/spec/data/shef-config.rb
index 0e2521c5b4..1ace5efd21 100644
--- a/spec/data/shef-config.rb
+++ b/spec/data/shef-config.rb
@@ -7,5 +7,5 @@ ohai[:disabled_plugins] << "solaris2::cpu" << "solaris2::dmi" << "solaris2::file
ohai[:disabled_plugins] << "solaris2::virtualization" << "solaris2::zpools"
ohai[:disabled_plugins] << "c" << "php" << "mono" << "groovy" << "lua" << "erlang"
ohai[:disabled_plugins] << "kernel" << "linux::filesystem" << "ruby"
-chef_repo_path File.dirname(__FILE__)
+chef_repo_path __dir__
cookbook_path "#{chef_repo_path}/cookbooks"
diff --git a/spec/data/ssl/binary/chef-rspec-der.cert b/spec/data/ssl/binary/chef-rspec-der.cert
new file mode 100644
index 0000000000..e49df6252a
--- /dev/null
+++ b/spec/data/ssl/binary/chef-rspec-der.cert
Binary files differ
diff --git a/spec/data/ssl/binary/chef-rspec-der.key b/spec/data/ssl/binary/chef-rspec-der.key
new file mode 100644
index 0000000000..d8adadc5c9
--- /dev/null
+++ b/spec/data/ssl/binary/chef-rspec-der.key
Binary files differ
diff --git a/spec/data/trusted_certs_empty/.gitkeep b/spec/data/trusted_certs_empty/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
--- a/spec/data/trusted_certs_empty/.gitkeep
+++ /dev/null
diff --git a/spec/data/trusted_certs_empty/README.md b/spec/data/trusted_certs_empty/README.md
deleted file mode 100644
index e7e52627f1..0000000000
--- a/spec/data/trusted_certs_empty/README.md
+++ /dev/null
@@ -1 +0,0 @@
-A directory with no certs. Used for testing directories with no certs during bootstrap.
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb
index 2ebf45fb84..b9f10fd4dc 100644
--- a/spec/functional/event_loggers/windows_eventlog_spec.rb
+++ b/spec/functional/event_loggers/windows_eventlog_spec.rb
@@ -19,6 +19,7 @@
require "spec_helper"
require "securerandom"
require "chef/event_loggers/windows_eventlog"
+require "chef-utils"
if ChefUtils.windows?
require "win32/eventlog"
include Win32
@@ -49,7 +50,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_start(version, run_status)
expect(event_log.read(flags, offset).any? do |e|
- e.source == Chef::Dist::SHORT && e.event_id == 10000 &&
+ e.source == ChefUtils::Dist::Infra::SHORT && e.event_id == 10000 &&
e.string_inserts[0].include?(version)
end ).to be_truthy
end
@@ -58,7 +59,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_started(run_status)
expect(event_log.read(flags, offset).any? do |e|
- e.source == Chef::Dist::SHORT && e.event_id == 10001 &&
+ e.source == ChefUtils::Dist::Infra::SHORT && e.event_id == 10001 &&
e.string_inserts[0].include?(run_id)
end ).to be_truthy
end
@@ -68,7 +69,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_completed(node)
expect(event_log.read(flags, offset).any? do |e|
- e.source == Chef::Dist::SHORT && e.event_id == 10002 &&
+ e.source == ChefUtils::Dist::Infra::SHORT && e.event_id == 10002 &&
e.string_inserts[0].include?(run_id) &&
e.string_inserts[1].include?(elapsed_time.to_s)
end).to be_truthy
@@ -79,7 +80,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_failed(mock_exception)
expect(event_log.read(flags, offset).any? do |e|
- e.source == Chef::Dist::SHORT && e.event_id == 10003 &&
+ e.source == ChefUtils::Dist::Infra::SHORT && e.event_id == 10003 &&
e.string_inserts[0].include?(run_id) &&
e.string_inserts[1].include?(elapsed_time.to_s) &&
e.string_inserts[2].include?(mock_exception.class.name) &&
@@ -93,7 +94,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_failed(mock_exception)
expect(event_log.read(flags, offset).any? do |e|
- e.source == Chef::Dist::SHORT && e.event_id == 10003 &&
+ e.source == ChefUtils::Dist::Infra::SHORT && e.event_id == 10003 &&
e.string_inserts[0].include?("UNKNOWN") &&
e.string_inserts[1].include?("UNKNOWN") &&
e.string_inserts[2].include?(mock_exception.class.name) &&
diff --git a/spec/functional/mixin/powershell_out_spec.rb b/spec/functional/mixin/powershell_out_spec.rb
index 1ef9776efc..801910cd87 100644
--- a/spec/functional/mixin/powershell_out_spec.rb
+++ b/spec/functional/mixin/powershell_out_spec.rb
@@ -18,12 +18,20 @@
require "spec_helper"
require "chef/mixin/powershell_out"
-describe Chef::Mixin::PowershellOut, windows_only: true do
+describe Chef::Mixin::PowershellOut, :windows_only do
include Chef::Mixin::PowershellOut
describe "#powershell_out" do
it "runs a powershell command and collects stdout" do
- expect(powershell_out("get-process").run_command.stdout).to match /Handles/
+ expect(powershell_out("get-process").run_command.stdout).to match(/Handles/)
+ end
+
+ it "uses :powershell by default" do
+ expect(powershell_out("$PSVersionTable").run_command.stdout).to match(/CLRVersion/)
+ end
+
+ it ":pwsh interpreter uses core edition", :pwsh_installed do
+ expect(powershell_out("$PSVersionTable", :pwsh).run_command.stdout).to match(/Core/)
end
it "does not raise exceptions when the command is invalid" do
@@ -33,7 +41,7 @@ describe Chef::Mixin::PowershellOut, windows_only: true do
describe "#powershell_out!" do
it "runs a powershell command and collects stdout" do
- expect(powershell_out!("get-process").run_command.stdout).to match /Handles/
+ expect(powershell_out!("get-process").run_command.stdout).to match(/Handles/)
end
it "raises exceptions when the command is invalid" do
diff --git a/spec/functional/resource/aix_service_spec.rb b/spec/functional/resource/aix_service_spec.rb
index ae29d54f2a..16d830b88a 100755
--- a/spec/functional/resource/aix_service_spec.rb
+++ b/spec/functional/resource/aix_service_spec.rb
@@ -89,7 +89,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
describe "When service is a subsystem" do
before(:all) do
- script_dir = File.join(File.dirname(__FILE__), "/../assets/")
+ script_dir = File.join(__dir__, "/../assets/")
shell_out!("mkssys -s ctestsys -p #{script_dir}/testchefsubsys -u #{get_user_id} -S -n 15 -f 9 -R -Q")
end
@@ -117,7 +117,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
# Cannot run this test on a WPAR
describe "When service is a group", :not_wpar do
before(:all) do
- script_dir = File.join(File.dirname(__FILE__), "/../assets/")
+ script_dir = File.join(__dir__, "/../assets/")
shell_out!("mkssys -s ctestsys -p #{script_dir}/testchefsubsys -u #{get_user_id} -S -n 15 -f 9 -R -Q -G ctestgrp")
end
diff --git a/spec/functional/resource/aixinit_service_spec.rb b/spec/functional/resource/aixinit_service_spec.rb
index ecbe0c23fa..c568d40a8d 100755
--- a/spec/functional/resource/aixinit_service_spec.rb
+++ b/spec/functional/resource/aixinit_service_spec.rb
@@ -69,7 +69,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
before(:all) do
File.delete("/etc/rc.d/init.d/chefinittest") if File.exist?("/etc/rc.d/init.d/chefinittest")
- FileUtils.cp((File.join(File.dirname(__FILE__), "/../assets/chefinittest")).to_s, "/etc/rc.d/init.d/chefinittest")
+ FileUtils.cp((File.join(__dir__, "/../assets/chefinittest")).to_s, "/etc/rc.d/init.d/chefinittest")
end
after(:all) do
diff --git a/spec/functional/resource/apt_package_spec.rb b/spec/functional/resource/apt_package_spec.rb
index 228882a2e7..9f10e27731 100644
--- a/spec/functional/resource/apt_package_spec.rb
+++ b/spec/functional/resource/apt_package_spec.rb
@@ -39,9 +39,7 @@ module AptServer
def tcp_test_port(hostname, port)
tcp_socket = TCPSocket.new(hostname, port)
true
- rescue Errno::ETIMEDOUT
- false
- rescue Errno::ECONNREFUSED
+ rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED
false
ensure
tcp_socket && tcp_socket.close
@@ -326,7 +324,7 @@ describe Chef::Resource::AptPackage, metadata do
pkg_check = shell_out!("dpkg -l chef-integration-test", returns: [0, 1])
if pkg_check.exitstatus == 0
- expect(pkg_check.stdout).to match(/un[\s]+chef-integration-test/)
+ expect(pkg_check.stdout).to match(/un\s+chef-integration-test/)
end
end
@@ -359,7 +357,7 @@ describe Chef::Resource::AptPackage, metadata do
it "upgrades the package for action :upgrade" do
package_resource.run_action(:upgrade)
dpkg_l = shell_out!("dpkg -l chef-integration-test", returns: [0])
- expect(dpkg_l.stdout).to match(/chef\-integration\-test[\s]+1\.1\-1/)
+ expect(dpkg_l.stdout).to match(/chef\-integration\-test\s+1\.1\-1/)
expect(package_resource).to be_updated_by_last_action
end
@@ -373,7 +371,7 @@ describe Chef::Resource::AptPackage, metadata do
it "upgrades the package for action :install" do
package_resource.run_action(:install)
dpkg_l = shell_out!("dpkg -l chef-integration-test", returns: [0])
- expect(dpkg_l.stdout).to match(/chef\-integration\-test[\s]+1\.1\-1/)
+ expect(dpkg_l.stdout).to match(/chef\-integration\-test\s+1\.1\-1/)
expect(package_resource).to be_updated_by_last_action
end
end
diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb
index 24975d2e01..e55c1a453c 100644
--- a/spec/functional/resource/chocolatey_package_spec.rb
+++ b/spec/functional/resource/chocolatey_package_spec.rb
@@ -16,13 +16,13 @@
# limitations under the License.
#
require "spec_helper"
-require "chef/mixin/powershell_out"
+require "chef/mixin/shell_out"
describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
- include Chef::Mixin::PowershellOut
+ include Chef::Mixin::ShellOut
let(:package_name) { "test-A" }
- let(:package_list) { proc { powershell_out!("choco list -lo -r #{Array(package_name).join(" ")}").stdout.chomp } }
+ let(:package_list) { proc { shell_out!("choco list -lo -r #{Array(package_name).join(" ")}").stdout.chomp } }
let(:package_source) { File.join(CHEF_SPEC_ASSETS, "chocolatey_feed") }
let(:run_context) do
diff --git a/spec/functional/resource/cron_spec.rb b/spec/functional/resource/cron_spec.rb
index 009234f527..fa53eb08a1 100644
--- a/spec/functional/resource/cron_spec.rb
+++ b/spec/functional/resource/cron_spec.rb
@@ -26,7 +26,7 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
# Platform specific validation routines.
def cron_should_exists(cron_name, command)
case ohai[:platform]
- when "aix", "opensolaris", "solaris2", "omnios"
+ when "aix", "solaris2", "omnios"
expect(shell_out("crontab -l #{new_resource.user} | grep \"#{cron_name}\"").exitstatus).to eq(0)
expect(shell_out("crontab -l #{new_resource.user} | grep \"#{cron_name}\"").stdout.lines.to_a.size).to eq(1)
expect(shell_out("crontab -l #{new_resource.user} | grep \"#{command}\"").exitstatus).to eq(0)
@@ -41,7 +41,7 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
def cron_should_not_exists(cron_name)
case ohai[:platform]
- when "aix", "opensolaris", "solaris2", "omnios"
+ when "aix", "solaris2", "omnios"
expect(shell_out("crontab -l #{new_resource.user} | grep \"#{cron_name}\"").exitstatus).to eq(1)
expect(shell_out("crontab -l #{new_resource.user} | grep \"#{new_resource.command}\"").stdout.lines.to_a.size).to eq(0)
else
@@ -113,7 +113,7 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
end
end
- exclude_solaris = %w{solaris opensolaris solaris2 omnios}.include?(ohai[:platform])
+ exclude_solaris = %w{solaris solaris2 omnios}.include?(ohai[:platform])
describe "create action with various attributes", external: exclude_solaris do
def create_and_validate_with_property(resource, attribute, value)
if ohai[:platform] == "aix"
diff --git a/spec/functional/resource/dsc_script_spec.rb b/spec/functional/resource/dsc_script_spec.rb
index 83544cee04..b22599266b 100644
--- a/spec/functional/resource/dsc_script_spec.rb
+++ b/spec/functional/resource/dsc_script_spec.rb
@@ -17,13 +17,13 @@
#
require "spec_helper"
-require "chef/mixin/powershell_out"
+require "chef/mixin/powershell_exec"
require "chef/mixin/windows_architecture_helper"
require "support/shared/integration/integration_helper"
-describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
+describe Chef::Resource::DscScript, :windows_powershell_dsc_only, :ruby64_only do
include Chef::Mixin::WindowsArchitectureHelper
- include Chef::Mixin::PowershellOut
+ include Chef::Mixin::PowershellExec
before(:all) do
@temp_dir = ::Dir.mktmpdir("dsc-functional-test")
# enable the HTTP listener if it is not already enabled needed by underlying DSC engine
@@ -33,7 +33,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
winrm create winrm/config/Listener?Address=*+Transport=HTTP
}
CODE
- powershell_out!(winrm_code)
+ powershell_exec!(winrm_code)
end
after(:all) do
@@ -261,12 +261,9 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
it "should raise an exception if the cwd is etc" do
dsc_test_resource.cwd(dsc_environment_fail_etc_directory)
- expect { dsc_test_resource.run_action(:run) }.to raise_error(Chef::Exceptions::PowershellCmdletException)
- begin
+ expect {
dsc_test_resource.run_action(:run)
- rescue Chef::Exceptions::PowershellCmdletException => e
- expect(e.message).to match(exception_message_signature)
- end
+ }.to raise_error(Chef::PowerShell::CommandFailed, /#{exception_message_signature}/)
end
end
end
diff --git a/spec/functional/resource/insserv_spec.rb b/spec/functional/resource/insserv_spec.rb
index 92275fffba..e5c74c68ac 100644
--- a/spec/functional/resource/insserv_spec.rb
+++ b/spec/functional/resource/insserv_spec.rb
@@ -74,7 +74,7 @@ describe Chef::Resource::Service, :requires_root, :opensuse do
before(:all) do
File.delete("/etc/init.d/inittest") if File.exist?("/etc/init.d/inittest")
- FileUtils.cp((File.join(File.dirname(__FILE__), "/../assets/inittest")).to_s, "/etc/init.d/inittest")
+ FileUtils.cp((File.join(__dir__, "/../assets/inittest")).to_s, "/etc/init.d/inittest")
FileUtils.chmod(0755, "/etc/init.d/inittest")
end
diff --git a/spec/functional/resource/mount_spec.rb b/spec/functional/resource/mount_spec.rb
index 55738a4326..f11f97d6c7 100644
--- a/spec/functional/resource/mount_spec.rb
+++ b/spec/functional/resource/mount_spec.rb
@@ -129,8 +129,9 @@ describe Chef::Resource::Mount, :requires_root, external: include_flag do
end
# Actual tests begin here.
- before(:all) do
+ before do |test|
@device, @fstype = setup_device_for_mount
+ @device = "/" if test.metadata[:skip_before]
@mount_point = Dir.mktmpdir("testmount")
@@ -145,13 +146,20 @@ describe Chef::Resource::Mount, :requires_root, external: include_flag do
end
after(:all) do
- Dir.rmdir(@mount_point)
+ Dir.rmdir(@mount_point) if @mount_point
end
after(:each) do
cleanup_mount(new_resource.mount_point)
end
+ describe "when device is '/'" do
+ it "should mount the filesystem if device is '/'", :skip_before do
+ new_resource.run_action(:mount)
+ mount_should_exist(new_resource.mount_point, new_resource.device)
+ end
+ end
+
describe "when the target state is a mounted filesystem" do
it "should mount the filesystem if it isn't mounted" do
expect(current_resource.enabled).to be_falsey
diff --git a/spec/functional/resource/powershell_package_source_spec.rb b/spec/functional/resource/powershell_package_source_spec.rb
new file mode 100644
index 0000000000..abc9dcabd1
--- /dev/null
+++ b/spec/functional/resource/powershell_package_source_spec.rb
@@ -0,0 +1,107 @@
+#
+# Author:: Matt Wrock (<matt@mattwrock.com>)
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+require "spec_helper"
+require "chef/mixin/powershell_exec"
+
+describe Chef::Resource::PowershellPackageSource, :windows_gte_10 do
+ include Chef::Mixin::PowershellExec
+
+ let(:source_name) { "fake" }
+ let(:url) { "https://www.nuget.org/api/v2" }
+ let(:trusted) { true }
+
+ let(:run_context) do
+ Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
+ end
+
+ subject do
+ new_resource = Chef::Resource::PowershellPackageSource.new("test powershell package source", run_context)
+ new_resource.source_name source_name
+ new_resource.url url
+ new_resource.trusted trusted
+ new_resource.provider_name provider_name
+ new_resource
+ end
+
+ let(:provider) do
+ provider = subject.provider_for_action(subject.action)
+ provider
+ end
+
+ shared_examples "package_source" do
+ context "register a package source" do
+ after { remove_package_source }
+
+ it "registers the package source" do
+ subject.run_action(:register)
+ expect(get_installed_package_source_name).to eq(source_name)
+ end
+
+ it "does not register the package source if already installed" do
+ subject.run_action(:register)
+ subject.run_action(:register)
+ expect(subject).not_to be_updated_by_last_action
+ end
+
+ it "updates an existing package source if changed" do
+ subject.run_action(:register)
+ subject.trusted !trusted
+ subject.run_action(:register)
+ expect(subject).to be_updated_by_last_action
+ end
+ end
+
+ context "unregister a package source" do
+ it "unregisters the package source" do
+ subject.run_action(:register)
+ subject.run_action(:unregister)
+ expect(get_installed_package_source_name).to be_empty
+ end
+
+ it "does not unregister the package source if not already installed" do
+ subject.run_action(:unregister)
+ expect(subject).not_to be_updated_by_last_action
+ end
+ end
+ end
+
+ context "with NuGet provider" do
+ let(:provider_name) { "NuGet" }
+
+ before(:all) do
+ powershell_exec!("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;Install-PackageProvider -Name NuGet -Force")
+ end
+
+ it_behaves_like "package_source"
+ end
+
+ context "with PowerShellGet provider" do
+ let(:provider_name) { "PowerShellGet" }
+
+ it_behaves_like "package_source"
+ end
+
+ def get_installed_package_source_name
+ powershell_exec!("(Get-PackageSource -Name #{source_name} -ErrorAction SilentlyContinue).Name").result
+ end
+
+ def remove_package_source
+ pkg_to_remove = Chef::Resource::PowershellPackageSource.new(source_name, run_context)
+ pkg_to_remove.run_action(:unregister)
+ end
+end \ No newline at end of file
diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb
index 70442eb2b1..68fa94afe9 100644
--- a/spec/functional/resource/powershell_script_spec.rb
+++ b/spec/functional/resource/powershell_script_spec.rb
@@ -47,7 +47,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
r
end
- describe "when the run action is invoked on Windows" do
+ shared_examples_for "a running powershell script" do
it "successfully executes a non-cmdlet Windows binary as the last command of the script" do
resource.code(successful_executable_script_content + " | out-file -encoding ASCII #{script_output_path}")
resource.returns(0)
@@ -231,22 +231,54 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
resource.only_if { true }
expect { resource.should_skip?(:run) }.to raise_error(ArgumentError, /guard_interpreter does not support blocks/)
end
+ end
+
+ context "when using the powershell interpreter" do
+ before do
+ resource.interpreter "powershell"
+ end
+
+ it_behaves_like "a running powershell script"
+
+ it "runs Windows Powershell" do
+ resource.code("$PSVersionTable.PSVersion.Major | out-file -encoding ASCII #{script_output_path}")
+ resource.returns(0)
+ resource.run_action(:run)
+
+ expect(get_script_output.to_i).to be < 6
+ end
+ end
+
+ context "when using the pwsh interpreter", :pwsh_installed do
+ before do
+ resource.interpreter "pwsh"
+ end
+
+ it_behaves_like "a running powershell script"
- context "when dsc is supported", :windows_powershell_dsc_only do
- it "can execute LCM configuration code" do
- resource.code <<~EOF
- configuration LCM
+ it "runs a version of powershell greater than 6" do
+ resource.code("$PSVersionTable.PSVersion.Major | out-file -encoding ASCII #{script_output_path}")
+ resource.returns(0)
+ resource.run_action(:run)
+
+ expect(get_script_output.to_i).to be > 6
+ end
+ end
+
+ context "when dsc is supported", :windows_powershell_dsc_only do
+ it "can execute LCM configuration code" do
+ resource.code <<~EOF
+ configuration LCM
+ {
+ param ($thumbprint)
+ localconfigurationmanager
{
- param ($thumbprint)
- localconfigurationmanager
- {
- RebootNodeIfNeeded = $false
- ConfigurationMode = 'ApplyOnly'
- }
+ RebootNodeIfNeeded = $false
+ ConfigurationMode = 'ApplyOnly'
}
- EOF
- expect { resource.run_action(:run) }.not_to raise_error
- end
+ }
+ EOF
+ expect { resource.run_action(:run) }.not_to raise_error
end
end
@@ -347,6 +379,17 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
context "with powershell_script as the guard_interpreter" do
+ context "when pwsh is the interpreter", :pwsh_installed do
+ before do
+ resource.interpreter "pwsh"
+ end
+
+ it "uses powershell core to evaluate the guard" do
+ resource.not_if "$PSVersionTable.PSEdition -eq 'Core'"
+ expect(resource.should_skip?(:run)).to be_truthy
+ end
+ end
+
it "has a guard_interpreter attribute set to :powershell_script" do
expect(resource.guard_interpreter).to eq(:powershell_script)
end
diff --git a/spec/functional/resource/windows_certificate_spec.rb b/spec/functional/resource/windows_certificate_spec.rb
index 9c996fe1f8..20d444dd59 100644
--- a/spec/functional/resource/windows_certificate_spec.rb
+++ b/spec/functional/resource/windows_certificate_spec.rb
@@ -16,18 +16,18 @@
#
require "spec_helper"
-require "chef/mixin/powershell_out"
+require "chef/mixin/powershell_exec"
require "chef/resource/windows_certificate"
module WindowsCertificateHelper
- include Chef::Mixin::PowershellOut
+ include Chef::Mixin::PowershellExec
def create_store(store)
path = "Cert:\\LocalMachine\\" + store
command = <<~EOC
New-Item -Path #{path}
EOC
- powershell_out(command)
+ powershell_exec(command)
end
def cleanup(store)
@@ -35,15 +35,19 @@ module WindowsCertificateHelper
command = <<~EOC
Remove-Item -Path #{path} -Recurse
EOC
- powershell_out(command)
+ powershell_exec(command)
end
def no_of_certificates
path = "Cert:\\LocalMachine\\" + store
+ # Seems weird that we have to call dir twice right?
+ # The powershell pki module cache the last dir in module session state
+ # Issuing dir with a different arg (-Force) seems to refresh that state.
command = <<~EOC
- Write-Host (dir #{path} | measure).Count;
+ dir #{path} -Force | Out-Null
+ (dir #{path} | measure).Count
EOC
- powershell_out(command).stdout.to_i
+ powershell_exec(command).result.to_i
end
end
diff --git a/spec/functional/resource/windows_firewall_rule_spec.rb b/spec/functional/resource/windows_firewall_rule_spec.rb
new file mode 100644
index 0000000000..86220c1b71
--- /dev/null
+++ b/spec/functional/resource/windows_firewall_rule_spec.rb
@@ -0,0 +1,93 @@
+#
+# Author:: Matt Wrock (<matt@mattwrock.com>)
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+require "spec_helper"
+require "chef/mixin/powershell_exec"
+
+describe Chef::Resource::WindowsFirewallRule, :windows_only do
+ include Chef::Mixin::PowershellExec
+
+ let(:rule_name) { "fake_rule" }
+ let(:remote_port) { "5555" }
+ let(:enabled) { false }
+
+ let(:run_context) do
+ Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
+ end
+
+ subject do
+ new_resource = Chef::Resource::WindowsFirewallRule.new("test firewall rule", run_context)
+ new_resource.rule_name rule_name
+ new_resource.remote_port remote_port
+ new_resource.enabled enabled
+ new_resource
+ end
+
+ let(:provider) do
+ provider = subject.provider_for_action(subject.action)
+ provider
+ end
+
+ context "create a new rule" do
+ after { delete_rule }
+
+ it "creates the rule" do
+ subject.run_action(:create)
+ expect(get_installed_rule_name).to eq(rule_name)
+ expect(get_installed_rule_remote_port).to eq(remote_port)
+ end
+
+ it "does not create rule if it already exists" do
+ subject.run_action(:create)
+ subject.run_action(:create)
+ expect(subject).not_to be_updated_by_last_action
+ end
+
+ it "updates the rule if it changed" do
+ subject.run_action(:create)
+ subject.remote_port = "7777"
+ subject.run_action(:create)
+ expect(get_installed_rule_remote_port).to eq("7777")
+ end
+ end
+
+ context "delete a rule" do
+ it "deletes an existing rule" do
+ subject.run_action(:create)
+ subject.run_action(:delete)
+ expect(get_installed_rule_name).to be_empty
+ end
+
+ it "does not delete rule if it does not exist" do
+ subject.run_action(:delete)
+ expect(subject).not_to be_updated_by_last_action
+ end
+ end
+
+ def get_installed_rule_name
+ powershell_exec!("(Get-NetFirewallRule -Name #{rule_name} -ErrorAction SilentlyContinue).Name").result
+ end
+
+ def get_installed_rule_remote_port
+ powershell_exec!("((Get-NetFirewallRule -Name #{rule_name} -ErrorAction SilentlyContinue) | Get-NetFirewallPortFilter).RemotePort").result
+ end
+
+ def delete_rule
+ rule_to_remove = Chef::Resource::WindowsFirewallRule.new(rule_name, run_context)
+ rule_to_remove.run_action(:delete)
+ end
+end
diff --git a/spec/functional/resource/windows_package_spec.rb b/spec/functional/resource/windows_package_spec.rb
index 3294e1c509..5fed41e9ae 100644
--- a/spec/functional/resource/windows_package_spec.rb
+++ b/spec/functional/resource/windows_package_spec.rb
@@ -25,6 +25,10 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
let(:pkg_version) { nil }
let(:pkg_type) { nil }
let(:pkg_options) { nil }
+ let(:remote_file_attributes) { nil }
+ let(:run_context) do
+ Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
+ end
subject do
new_resource = Chef::Resource::WindowsPackage.new(pkg_name, run_context)
@@ -33,13 +37,14 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
new_resource.installer_type pkg_type
new_resource.options pkg_options
new_resource.checksum pkg_checksum
+ new_resource.remote_file_attributes
new_resource
end
describe "install package" do
let(:pkg_name) { "Microsoft Visual C++ 2005 Redistributable" }
- let(:pkg_checksum) { "d6832398e3bc9156a660745f427dc1c2392ce4e9a872e04f41f62d0c6bae07a8" }
- let(:pkg_path) { "https://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe" }
+ let(:pkg_checksum) { "4ee4da0fe62d5fa1b5e80c6e6d88a4a2f8b3b140c35da51053d0d7b72a381d29" }
+ let(:pkg_path) { "https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE" }
let(:pkg_checksum) { nil }
let(:pkg_type) { :custom }
let(:pkg_options) { "/Q" }
@@ -55,9 +60,9 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
end
context "installing additional version" do
- let(:pkg_path) { "https://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe" }
- let(:pkg_checksum) { "eb00f891919d4f894ab725b158459db8834470c382dc60cd3c3ee2c6de6da92c" }
- let(:pkg_version) { "8.0.56336" }
+ let(:pkg_path) { "https://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe" }
+ let(:pkg_checksum) { "d6832398e3bc9156a660745f427dc1c2392ce4e9a872e04f41f62d0c6bae07a8" }
+ let(:pkg_version) { "8.0.59193" }
it "installs older version" do
subject.run_action(:install)
@@ -69,14 +74,14 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
subject { Chef::Resource::WindowsPackage.new(pkg_name, run_context) }
context "multiple versions and a version given to remove" do
- before { subject.version("8.0.56336") }
+ before { subject.version("8.0.59193") }
it "removes specified version" do
subject.run_action(:remove)
expect(subject).to be_updated_by_last_action
prov = subject.provider_for_action(:remove)
prov.load_current_resource
- expect(prov.current_version_array).to eq([["8.0.59193"]])
+ expect(prov.current_version_array).to eq([["8.0.61001"]])
end
end
@@ -101,8 +106,8 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
install1.run_action(:install)
install2 = Chef::Resource::WindowsPackage.new(pkg_name, run_context)
- install2.source "https://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe"
- install2.version "8.0.56336"
+ install2.source "https://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe"
+ install2.version "8.0.59193"
install2.installer_type pkg_type
install2.options pkg_options
install2.run_action(:install)
@@ -135,7 +140,7 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
context "inno" do
let(:pkg_name) { "Mercurial 3.6.1 (64-bit)" }
- let(:pkg_path) { "http://mercurial.selenic.com/release/windows/Mercurial-3.6.1-x64.exe" }
+ let(:pkg_path) { "https://www.mercurial-scm.org/release/windows/Mercurial-3.6.1-x64.exe" }
let(:pkg_checksum) { "febd29578cb6736163d232708b834a2ddd119aa40abc536b2c313fc5e1b5831d" }
it "finds the correct installer type" do
@@ -164,4 +169,25 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do
expect(subject).to be_updated_by_last_action
end
end
+
+ describe "install package with remote_file_attributes" do
+ let(:pkg_name) { "7zip" }
+ let(:pkg_path) { "http://www.7-zip.org/a/7z938-x64.msi" }
+ let(:remote_file_attributes) {
+ {
+ path: ::File.join(Chef::Config[:file_cache_path], "7zip.msi"),
+ checksum: "7c8e873991c82ad9cfcdbdf45254ea6101e9a645e12977dcd518979e50fdedf3",
+ }
+ }
+
+ it "installs the package" do
+ subject.run_action(:install)
+ expect(subject).to be_updated_by_last_action
+ end
+
+ it "uninstalls the package" do
+ subject.run_action(:remove)
+ expect(subject).to be_updated_by_last_action
+ end
+ end
end
diff --git a/spec/functional/resource/windows_share_spec.rb b/spec/functional/resource/windows_share_spec.rb
new file mode 100644
index 0000000000..6fae7d45d3
--- /dev/null
+++ b/spec/functional/resource/windows_share_spec.rb
@@ -0,0 +1,103 @@
+#
+# Author:: Matt Wrock (<matt@mattwrock.com>)
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+require "spec_helper"
+require "chef/mixin/powershell_exec"
+
+describe Chef::Resource::WindowsShare, :windows_only do
+ include Chef::Mixin::PowershellExec
+
+ let(:share_name) { "fake_share" }
+ let(:path) { ENV["temp"] }
+ let(:concurrent_user_limit) { 7 }
+ let(:full_users) { ["#{ENV["USERNAME"]}"] }
+
+ let(:run_context) do
+ node = Chef::Node.new
+ node.default["hostname"] = ENV["COMPUTERNAME"]
+ Chef::RunContext.new(node, {}, Chef::EventDispatch::Dispatcher.new)
+ end
+
+ subject do
+ new_resource = Chef::Resource::WindowsShare.new("test windows share", run_context)
+ new_resource.share_name share_name
+ new_resource.path path
+ new_resource.concurrent_user_limit concurrent_user_limit
+ new_resource.full_users full_users
+ new_resource
+ end
+
+ let(:provider) do
+ provider = subject.provider_for_action(subject.action)
+ provider
+ end
+
+ context "create a new share" do
+ after { delete_share }
+
+ it "creates the share" do
+ subject.run_action(:create)
+ share = get_installed_share
+ expect(share["Name"]).to eq(share_name)
+ expect(share["Path"]).to eq(path)
+ expect(get_installed_share_access["AccountName"]).to eq("#{ENV["COMPUTERNAME"]}\\#{full_users[0]}")
+ end
+
+ it "does not create share if it already exists" do
+ subject.run_action(:create)
+ subject.run_action(:create)
+ expect(subject).not_to be_updated_by_last_action
+ end
+
+ it "updates the share if it changed" do
+ subject.run_action(:create)
+ subject.concurrent_user_limit 8
+ subject.full_users ["BUILTIN\\Administrators"]
+ subject.run_action(:create)
+ share = get_installed_share
+ expect(share["ConcurrentUserLimit"]).to eq(8)
+ expect(get_installed_share_access["AccountName"]).to eq("BUILTIN\\Administrators")
+ end
+
+ end
+
+ context "delete a share" do
+ it "deletes an existing share" do
+ subject.run_action(:create)
+ subject.run_action(:delete)
+ expect(get_installed_share).to be_empty
+ end
+
+ it "does not delete share if it does not exist" do
+ subject.run_action(:delete)
+ expect(subject).not_to be_updated_by_last_action
+ end
+ end
+
+ def get_installed_share
+ powershell_exec!("Get-SmbShare -Name #{share_name} -ErrorAction SilentlyContinue").result
+ end
+
+ def get_installed_share_access
+ powershell_exec!("Get-SmbShareAccess -Name #{share_name} -ErrorAction SilentlyContinue").result
+ end
+
+ def delete_share
+ rule_to_remove = Chef::Resource::WindowsShare.new(share_name, run_context)
+ rule_to_remove.run_action(:delete)
+ end
+end
diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb
index 196e627272..3affa625fd 100644
--- a/spec/functional/resource/windows_task_spec.rb
+++ b/spec/functional/resource/windows_task_spec.rb
@@ -17,15 +17,14 @@
#
require "spec_helper"
-require "chef/provider/windows_task"
-require "chef/dist"
+require "chef-utils/dist"
describe Chef::Resource::WindowsTask, :windows_only do
# resource.task.application_name will default to task_name unless resource.command is set
let(:task_name) { "chef-client-functional-test" }
- let(:new_resource) { Chef::Resource::WindowsTask.new(task_name) }
+ let(:new_resource) { Chef::Resource::WindowsTask.new(task_name, run_context) }
let(:windows_task_provider) do
- Chef::Provider::WindowsTask.new(new_resource, run_context)
+ new_resource.provider_for_action(:create)
end
let(:run_context) do
@@ -47,37 +46,37 @@ describe Chef::Resource::WindowsTask, :windows_only do
context "With Arguments" do
it "creates scheduled task and sets command arguments" do
- subject.command "#{Chef::Dist::CLIENT} -W"
+ subject.command "#{ChefUtils::Dist::Infra::CLIENT} -W"
call_for_create_action
# loading current resource again to check new task is creted and it matches task parameters
current_resource = call_for_load_current_resource
expect(current_resource.exists).to eq(true)
- expect(current_resource.task.application_name).to eq(Chef::Dist::CLIENT)
+ expect(current_resource.task.application_name).to eq(ChefUtils::Dist::Infra::CLIENT)
expect(current_resource.task.parameters).to eq("-W")
end
it "does not converge the resource if it is already converged" do
- subject.command "#{Chef::Dist::CLIENT} -W"
+ subject.command "#{ChefUtils::Dist::Infra::CLIENT} -W"
subject.run_action(:create)
- subject.command "#{Chef::Dist::CLIENT} -W"
+ subject.command "#{ChefUtils::Dist::Infra::CLIENT} -W"
subject.run_action(:create)
expect(subject).not_to be_updated_by_last_action
end
it "creates scheduled task and sets command arguments when arguments inclusive single quotes" do
- subject.command "#{Chef::Dist::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'"
+ subject.command "#{ChefUtils::Dist::Infra::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'"
call_for_create_action
# loading current resource again to check new task is creted and it matches task parameters
current_resource = call_for_load_current_resource
expect(current_resource.exists).to eq(true)
- expect(current_resource.task.application_name).to eq(Chef::Dist::CLIENT)
+ expect(current_resource.task.application_name).to eq(ChefUtils::Dist::Infra::CLIENT)
expect(current_resource.task.parameters).to eq("-W -L 'C:\\chef\\chef-ad-join.log'")
end
it "does not converge the resource if it is already converged" do
- subject.command "#{Chef::Dist::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'"
+ subject.command "#{ChefUtils::Dist::Infra::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'"
subject.run_action(:create)
- subject.command "#{Chef::Dist::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'"
+ subject.command "#{ChefUtils::Dist::Infra::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'"
subject.run_action(:create)
expect(subject).not_to be_updated_by_last_action
end
@@ -137,19 +136,19 @@ describe Chef::Resource::WindowsTask, :windows_only do
context "Without Arguments" do
it "creates scheduled task and sets command arguments" do
- subject.command Chef::Dist::CLIENT
+ subject.command ChefUtils::Dist::Infra::CLIENT
call_for_create_action
# loading current resource again to check new task is creted and it matches task parameters
current_resource = call_for_load_current_resource
expect(current_resource.exists).to eq(true)
- expect(current_resource.task.application_name).to eq(Chef::Dist::CLIENT)
+ expect(current_resource.task.application_name).to eq(ChefUtils::Dist::Infra::CLIENT)
expect(current_resource.task.parameters).to be_empty
end
it "does not converge the resource if it is already converged" do
- subject.command Chef::Dist::CLIENT
+ subject.command ChefUtils::Dist::Infra::CLIENT
subject.run_action(:create)
- subject.command Chef::Dist::CLIENT
+ subject.command ChefUtils::Dist::Infra::CLIENT
subject.run_action(:create)
expect(subject).not_to be_updated_by_last_action
end
diff --git a/spec/functional/resource/zypper_package_spec.rb b/spec/functional/resource/zypper_package_spec.rb
index e56684b6f8..ce6a3bf33c 100644
--- a/spec/functional/resource/zypper_package_spec.rb
+++ b/spec/functional/resource/zypper_package_spec.rb
@@ -96,6 +96,17 @@ describe Chef::Resource::ZypperPackage, :requires_root, :suse_only do
expect(zypper_package.updated_by_last_action?).to be false
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
end
+
+ it "multipackage installs which result in nils from the superclass" do
+ # this looks weird, it tests an internal condition of the allow_nils behavior where the arrays passed to install_package will have
+ # nil values, and ensures that doesn't wind up creating weirdness in the resulting shell_out that causes it to fail
+ preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
+ zypper_package.package_name(%w{chef_rpm chef_rpm})
+ zypper_package.version(["1.2", "1.10"])
+ zypper_package.run_action(:install)
+ expect(zypper_package.updated_by_last_action?).to be true
+ expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
+ end
end
context "with versions" do
diff --git a/spec/functional/util/powershell/cmdlet_spec.rb b/spec/functional/util/powershell/cmdlet_spec.rb
deleted file mode 100644
index 565456f687..0000000000
--- a/spec/functional/util/powershell/cmdlet_spec.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-#
-# Author:: Adam Edwards (<adamed@chef.io>)
-#
-# Copyright:: Copyright (c) Chef Software Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "chef/json_compat"
-require "spec_helper"
-
-describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
- before(:all) do
- @node = Chef::Node.new
- @node.consume_external_attrs(OHAI_SYSTEM.data, {})
- end
- let(:cmd_output_format) { :text }
- let(:simple_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "get-childitem", cmd_output_format, { depth: 2 }) }
- let(:invalid_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "get-idontexist", cmd_output_format) }
- let(:cmdlet_get_item_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, "get-item", cmd_output_format, { depth: 2 }) }
- let(:cmdlet_alias_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, "alias", cmd_output_format, { depth: 2 }) }
- let(:etc_directory) { "#{ENV["systemroot"]}\\system32\\drivers\\etc" }
- let(:architecture_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "$env:PROCESSOR_ARCHITECTURE") }
-
- it "executes a simple process" do
- result = simple_cmdlet.run
- expect(result.succeeded?).to eq(true)
- end
-
- it "#run does not raise a PowershellCmdletException exception if the command cannot be executed" do
- expect { invalid_cmdlet.run }.not_to raise_error
- end
-
- it "#run! raises a PowershellCmdletException exception if the command cannot be executed" do
- expect { invalid_cmdlet.run! }.to raise_error(Chef::Exceptions::PowershellCmdletException)
- end
-
- it "executes a 64-bit command on a 64-bit OS, 32-bit otherwise" do
- os_arch = ENV["PROCESSOR_ARCHITEW6432"]
- if os_arch.nil?
- os_arch = ENV["PROCESSOR_ARCHITECTURE"]
- end
-
- result = architecture_cmdlet.run
- execution_arch = result.return_value
- execution_arch.strip!
- expect(execution_arch).to eq(os_arch)
- end
-
- it "passes command line switches to the command" do
- result = cmdlet_alias_requires_switch_or_argument.run({ name: "ls" })
- expect(result.succeeded?).to eq(true)
- end
-
- it "passes command line arguments to the command" do
- result = cmdlet_alias_requires_switch_or_argument.run({}, {}, "ls")
- expect(result.succeeded?).to eq(true)
- end
-
- it "passes command line arguments and switches to the command" do
- result = cmdlet_get_item_requires_switch_or_argument.run({ path: etc_directory }, {}, " | select-object -property fullname | format-table -hidetableheaders")
- expect(result.succeeded?).to eq(true)
- returned_directory = result.return_value
- returned_directory.strip!
- expect(returned_directory).to eq(etc_directory)
- end
-
- it "passes execution options to the command" do
- result = cmdlet_get_item_requires_switch_or_argument.run({}, { cwd: etc_directory }, ". | select-object -property fullname | format-table -hidetableheaders")
- expect(result.succeeded?).to eq(true)
- returned_directory = result.return_value
- returned_directory.strip!
- expect(returned_directory).to eq(etc_directory)
- end
-
- context "when returning json" do
- let(:cmd_output_format) { :json }
- it "returns json format data" do
- result = cmdlet_alias_requires_switch_or_argument.run({}, {}, "ls")
- expect(result.succeeded?).to eq(true)
- expect { Chef::JSONCompat.parse(result.return_value) }.not_to raise_error
- end
- end
-
- context "when returning Ruby objects" do
- let(:cmd_output_format) { :object }
- it "returns object format data" do
- result = simple_cmdlet.run({}, { cwd: etc_directory }, "hosts")
- expect(result.succeeded?).to eq(true)
- data = result.return_value
- expect(data["Name"]).to eq("hosts")
- end
- end
-
- context "when constructor is given invalid arguments" do
- let(:cmd_output_format) { :invalid }
- it "throws an exception if an invalid format is passed to the constructor" do
- expect { simple_cmdlet }.to raise_error(ArgumentError)
- end
- end
-end
diff --git a/spec/functional/version_spec.rb b/spec/functional/version_spec.rb
index 935dabb205..5d0f0fce43 100644
--- a/spec/functional/version_spec.rb
+++ b/spec/functional/version_spec.rb
@@ -19,13 +19,13 @@ require "spec_helper"
require "chef/mixin/shell_out"
require "chef/version"
require "ohai/version"
-require "chef/dist"
+require "chef-utils/dist"
describe "Chef Versions", :executables do
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..") }
+ let(:chef_dir) { File.join(__dir__, "..", "..") }
- binaries = [ Chef::Dist::CLIENT, "chef-shell", "chef-apply", "knife", Chef::Dist::SOLOEXEC ]
+ binaries = [ ChefUtils::Dist::Infra::CLIENT, "chef-shell", "chef-apply", "knife", ChefUtils::Dist::Solo::EXEC ]
binaries.each do |binary|
it "#{binary} version should be sane" do
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 0b206623b1..ebde310eaf 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -3,7 +3,7 @@ require "support/shared/integration/integration_helper"
require "chef/mixin/shell_out"
require "tiny_server"
require "tmpdir"
-require "chef/dist"
+require "chef-utils/dist"
describe "chef-client" do
@@ -34,7 +34,7 @@ describe "chef-client" do
include IntegrationSupport
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
# Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
# following constraints are satisfied:
@@ -45,8 +45,8 @@ describe "chef-client" do
# machine that has omnibus chef installed. In that case we need to ensure
# we're running `chef-client` from the source tree and not the external one.
# cf. CHEF-4914
- let(:chef_client) { "bundle exec #{Chef::Dist::CLIENT} --minimal-ohai" }
- let(:chef_solo) { "bundle exec #{Chef::Dist::SOLOEXEC} --legacy-mode --minimal-ohai" }
+ let(:chef_client) { "bundle exec #{ChefUtils::Dist::Infra::CLIENT} --minimal-ohai" }
+ let(:chef_solo) { "bundle exec #{ChefUtils::Dist::Solo::EXEC} --legacy-mode --minimal-ohai" }
when_the_repository "has a cookbook with a no-op recipe" do
before { file "cookbooks/x/recipes/default.rb", "" }
@@ -97,7 +97,8 @@ describe "chef-client" do
before { file ".chef/knife.rb", "xxx.xxx" }
it "should load .chef/knife.rb when -z is specified" do
- result = shell_out("#{chef_client} -z -o 'x::default'", cwd: path_to(""))
+ # On Solaris shell_out will invoke /bin/sh which doesn't understand how to correctly update ENV['PWD']
+ result = shell_out("#{chef_client} -z -o 'x::default'", cwd: path_to(""), env: { "PWD" => nil })
# FATAL: Configuration error NoMethodError: undefined method `xxx' for nil:NilClass
expect(result.stdout).to include("xxx")
end
diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb
index a2f7e87b7e..53a8f1f895 100644
--- a/spec/integration/client/exit_code_spec.rb
+++ b/spec/integration/client/exit_code_spec.rb
@@ -5,13 +5,14 @@ require "chef/mixin/shell_out"
require "tiny_server"
require "tmpdir"
require "chef/platform"
+require "chef-utils/dist"
describe "chef-client" do
include IntegrationSupport
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
# Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
# following constraints are satisfied:
@@ -22,7 +23,7 @@ describe "chef-client" do
# machine that has omnibus chef installed. In that case we need to ensure
# we're running `chef-client` from the source tree and not the external one.
# cf. CHEF-4914
- let(:chef_client) { "bundle exec #{Chef::Dist::CLIENT} --no-fork --minimal-ohai" }
+ let(:chef_client) { "bundle exec #{ChefUtils::Dist::Infra::CLIENT} --no-fork --minimal-ohai" }
let(:critical_env_vars) { %w{PATH RUBYOPT BUNDLE_GEMFILE GEM_PATH}.map { |o| "#{o}=#{ENV[o]}" } .join(" ") }
diff --git a/spec/integration/client/ipv6_spec.rb b/spec/integration/client/ipv6_spec.rb
index 30fd991c70..816e1c40e6 100644
--- a/spec/integration/client/ipv6_spec.rb
+++ b/spec/integration/client/ipv6_spec.rb
@@ -74,7 +74,7 @@ describe "chef-client" do
basic_config_file
end
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
let(:chef_client_cmd) { %Q{bundle exec chef-client --minimal-ohai -c "#{path_to("config/client.rb")}" -lwarn} }
diff --git a/spec/integration/compliance/compliance_spec.rb b/spec/integration/compliance/compliance_spec.rb
new file mode 100644
index 0000000000..98776308de
--- /dev/null
+++ b/spec/integration/compliance/compliance_spec.rb
@@ -0,0 +1,81 @@
+require "spec_helper"
+
+require "support/shared/integration/integration_helper"
+require "chef/mixin/shell_out"
+require "chef-utils/dist"
+
+describe "chef-client with audit mode" do
+
+ include IntegrationSupport
+ include Chef::Mixin::ShellOut
+
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
+
+ # Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
+ # following constraints are satisfied:
+ # * Windows: windows can only run batch scripts as bare executables. Rubygems
+ # creates batch wrappers for installed gems, but we don't have batch wrappers
+ # in the source tree.
+ # * Other `chef-client` in PATH: A common case is running the tests on a
+ # machine that has omnibus chef installed. In that case we need to ensure
+ # we're running `chef-client` from the source tree and not the external one.
+ # cf. CHEF-4914
+ let(:chef_client) { "bundle exec #{ChefUtils::Dist::Infra::CLIENT} --minimal-ohai" }
+
+ when_the_repository "has a custom profile" do
+ let(:report_file) { path_to("report_file.json") }
+
+ before do
+ directory "profiles/my-profile" do
+ file "inspec.yml", <<~FILE
+ ---
+ name: my-profile
+ FILE
+
+ directory "controls" do
+ file "my_control.rb", <<~FILE
+ control "my control" do
+ describe Dir.home do
+ it { should be_kind_of String }
+ end
+ end
+ FILE
+ end
+ end
+
+ file "attributes.json", <<~FILE
+ {
+ "audit": {
+ "json_file": {
+ "location": "#{report_file}"
+ },
+ "profiles": {
+ "my-profile": {
+ "path": "#{path_to("profiles/my-profile")}"
+ }
+ }
+ }
+ }
+ FILE
+ end
+
+ it "should complete with success" do
+ result = shell_out!("#{chef_client} --local-mode --json-attributes #{path_to("attributes.json")}", cwd: chef_dir)
+ result.error!
+
+ inspec_report = JSON.parse(File.read(report_file))
+ expect(inspec_report["profiles"].length).to eq(1)
+
+ profile = inspec_report["profiles"].first
+ expect(profile["name"]).to eq("my-profile")
+ expect(profile["controls"].length).to eq(1)
+
+ control = profile["controls"].first
+ expect(control["id"]).to eq("my control")
+ expect(control["results"].length).to eq(1)
+
+ result = control["results"].first
+ expect(result["status"]).to eq("passed")
+ end
+ end
+end
diff --git a/spec/integration/knife/client_key_create_spec.rb b/spec/integration/knife/client_key_create_spec.rb
index 179b0f5911..b9838d6718 100644
--- a/spec/integration/knife/client_key_create_spec.rb
+++ b/spec/integration/knife/client_key_create_spec.rb
@@ -39,7 +39,7 @@ describe "knife client key create", :workstation do
it "creates a new client key with an expiration date" do
date = "2017-12-31T23:59:59Z"
knife("client key create -k new -e #{date} bah").should_succeed stderr: /^#{out}/, stdout: /.*BEGIN RSA PRIVATE KEY/
- knife("client key show bah new").should_succeed /expiration_date:.*#{date}/
+ knife("client key show bah new").should_succeed(/expiration_date:.*#{date}/)
end
it "refuses to add an already existing key" do
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index 38aedb59db..b65cdc697b 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -62,7 +62,7 @@ describe "Knife cookbook API integration with IPv6", :workstation, :not_supporte
Dir.mktmpdir
end
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
let(:knife) { "ruby '#{chef_dir}/knife'" }
let(:knife_config_flag) { "-c '#{path_to("config/knife.rb")}'" }
diff --git a/spec/integration/knife/node_create_spec.rb b/spec/integration/knife/node_create_spec.rb
index 76aa8bbfae..e8f6d71694 100644
--- a/spec/integration/knife/node_create_spec.rb
+++ b/spec/integration/knife/node_create_spec.rb
@@ -34,7 +34,7 @@ describe "knife node create", :workstation do
it "creates a new validator node" do
knife("node create bah").should_succeed out
- knife("node show bah").should_succeed /Node Name: bah/
+ knife("node show bah").should_succeed(/Node Name: bah/)
end
it "refuses to add an existing node" do
diff --git a/spec/integration/knife/node_environment_set_spec.rb b/spec/integration/knife/node_environment_set_spec.rb
index 3a407d1b20..16a86dbc30 100644
--- a/spec/integration/knife/node_environment_set_spec.rb
+++ b/spec/integration/knife/node_environment_set_spec.rb
@@ -31,7 +31,7 @@ describe "knife node environment set", :workstation do
end
it "sets an environment on a node" do
- knife("node environment set cons lisp").should_succeed /chef_environment:.*lisp/
+ knife("node environment set cons lisp").should_succeed(/chef_environment:.*lisp/)
knife("node show cons -a chef_environment").should_succeed <<~EOM
cons:
chef_environment: lisp
diff --git a/spec/integration/knife/node_run_list_add_spec.rb b/spec/integration/knife/node_run_list_add_spec.rb
index 8b17b36a67..f13e584526 100644
--- a/spec/integration/knife/node_run_list_add_spec.rb
+++ b/spec/integration/knife/node_run_list_add_spec.rb
@@ -30,7 +30,7 @@ describe "knife node run list add", :workstation do
end
it "sets the run list" do
- knife("node run list add cons recipe[foo]").should_succeed /run_list:\s*recipe\[foo\]\n/
+ knife("node run list add cons recipe[foo]").should_succeed(/run_list:\s*recipe\[foo\]\n/)
end
end
@@ -40,15 +40,15 @@ describe "knife node run list add", :workstation do
end
it "appends to the run list" do
- knife("node run list add cons recipe[foo]").should_succeed /run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m
+ knife("node run list add cons recipe[foo]").should_succeed(/run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m)
end
it "adds to the run list before the specified item" do
- knife("node run list add cons -b recipe[bar] recipe[foo]").should_succeed /run_list:\n\s*recipe\[foo\]\n\s*recipe\[bar\]\n/m
+ knife("node run list add cons -b recipe[bar] recipe[foo]").should_succeed(/run_list:\n\s*recipe\[foo\]\n\s*recipe\[bar\]\n/m)
end
it "adds to the run list after the specified item" do
- knife("node run list add cons -a recipe[bar] recipe[foo]").should_succeed /run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m
+ knife("node run list add cons -a recipe[bar] recipe[foo]").should_succeed(/run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m)
end
end
end
diff --git a/spec/integration/knife/node_run_list_remove_spec.rb b/spec/integration/knife/node_run_list_remove_spec.rb
index 96bc3650ea..55f224b5ac 100644
--- a/spec/integration/knife/node_run_list_remove_spec.rb
+++ b/spec/integration/knife/node_run_list_remove_spec.rb
@@ -30,7 +30,7 @@ describe "knife node run list remove", :workstation do
end
it "removes the item from the run list" do
- knife("node run list remove cons recipe[bar]").should_succeed /run_list:\s*recipe\[foo\]\n/m
+ knife("node run list remove cons recipe[bar]").should_succeed(/run_list:\s*recipe\[foo\]\n/m)
end
end
end
diff --git a/spec/integration/knife/node_run_list_set_spec.rb b/spec/integration/knife/node_run_list_set_spec.rb
index a63145f3b8..e642afc1ce 100644
--- a/spec/integration/knife/node_run_list_set_spec.rb
+++ b/spec/integration/knife/node_run_list_set_spec.rb
@@ -30,7 +30,7 @@ describe "knife node run list set", :workstation do
end
it "sets the run list" do
- knife("node run list set cons recipe[bar]").should_succeed /run_list:\s*recipe\[bar\]\n/m
+ knife("node run list set cons recipe[bar]").should_succeed(/run_list:\s*recipe\[bar\]\n/m)
end
it "with no role or recipe" do
diff --git a/spec/integration/knife/node_show_spec.rb b/spec/integration/knife/node_show_spec.rb
index 300c0b8540..cf3f166699 100644
--- a/spec/integration/knife/node_show_spec.rb
+++ b/spec/integration/knife/node_show_spec.rb
@@ -30,7 +30,7 @@ describe "knife node show", :workstation do
end
it "shows the node" do
- knife("node show cons").should_succeed /Run List:\s*recipe\[bar\], recipe\[foo\]\n/m
+ knife("node show cons").should_succeed(/Run List:\s*recipe\[bar\], recipe\[foo\]\n/m)
end
end
end
diff --git a/spec/integration/ohai/ohai_spec.rb b/spec/integration/ohai/ohai_spec.rb
new file mode 100644
index 0000000000..af4dd5fe38
--- /dev/null
+++ b/spec/integration/ohai/ohai_spec.rb
@@ -0,0 +1,61 @@
+require "spec_helper"
+require "chef/mixin/shell_out"
+require "benchmark" unless defined?(Benchmark)
+
+describe "ohai" do
+ include Chef::Mixin::ShellOut
+
+ let(:ohai) { "bundle exec ohai" }
+
+ describe "testing ohai performance" do
+ # The purpose of this test is to generally find misconfigured DNS on
+ # CI testers. If this fails, it is probably because the forward+reverse
+ # DNS lookup that node[:hostname] needs is timing out and failing.
+ #
+ # If it is failing spuriously, it may mean DNS is failing spuriously, the
+ # best solution will be to make sure that `hostname -f`-like behavior hits
+ # /etc/hosts and not DNS.
+ #
+ # If it still fails supriously, it is possible that the server has high
+ # CPU load (e.g. due to background processes) which are contending with the
+ # running tests (disable the screensaver on servers, stop playing Fortnite
+ # while you're running tests, etc).
+ #
+ # If this just fails due to I/O being very slow and ruby being very slow to
+ # startup then that still indicates that the tester configuration needs
+ # fixing. The fact that this will fail on a windows box on a virt that doesn't
+ # use an SSD is because we have a higher bar for the tests to run successfully
+ # and that configuration is broken, so this test is red for a reason.
+ #
+ # This will probably fail on raspberry pi's or something like that as well. That
+ # is not a bug. We will never accept a raspberry pi as a CI tester for our
+ # software. Feel free to manually delete and thereby skip this file in your
+ # own testing harness, but that is not our concern, we are testing behavior
+ # that is critical to our infrastructure and must run in our tests.
+ #
+ # XXX: unfortunately this is so slow on our windows testers (~9 seconds on one
+ # tester) that we can't enable it for windows unless we get some better perf there.
+ #
+ it "the hostname plugin must return in under 4 seconds (see comments in code)" do
+ # unfortunately this doesn't look stable enough to enable
+ skip "we need to do more performance work on windows and s390x testers before this can be enabled"
+ delta = Benchmark.realtime do
+ shell_out!("#{ohai} hostname")
+ end
+ expect(delta).to be < 4
+ end
+
+ # The purpose of this is to give some indication of if shell_out is slow or
+ # if the hostname plugin itself is slow. If this test is also failing that we
+ # almost certainly have some kind of issue with DNS timeouts, etc. If this
+ # test succeeds and the other one fails, then it can be some kind of shelling-out
+ # issue or poor performance due to I/O on starting up ruby to run ohai, etc.
+ #
+ it "the hostname plugin must return in under 2 seconds when called from pure ruby" do
+ delta = Benchmark.realtime do
+ Ohai::System.new.all_plugins(["hostname"])
+ end
+ expect(delta).to be < 2
+ end
+ end
+end
diff --git a/spec/integration/recipes/notifies_spec.rb b/spec/integration/recipes/notifies_spec.rb
index a31ba6370b..7dfa70dfe5 100644
--- a/spec/integration/recipes/notifies_spec.rb
+++ b/spec/integration/recipes/notifies_spec.rb
@@ -416,7 +416,7 @@ describe "notifications" do
EOM
result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
- expect(result.stdout).to match /\* log\[a, b\] action write/
+ expect(result.stdout).to match(/\* log\[a, b\] action write/)
result.error!
end
diff --git a/spec/integration/recipes/provider_choice.rb b/spec/integration/recipes/provider_choice.rb
index 66aa58a432..f1d57260b6 100644
--- a/spec/integration/recipes/provider_choice.rb
+++ b/spec/integration/recipes/provider_choice.rb
@@ -30,8 +30,8 @@ describe "Recipe DSL methods" do
recipe = converge do
provider_thingy("blah") {}
end
- expect(recipe.logged_warnings).to match /hello from Chef::Provider::ProviderThingy/
- expect(recipe.logged_warnings).to match /you must use 'provides' to provide DSL/i
+ expect(recipe.logged_warnings).to match(/hello from Chef::Provider::ProviderThingy/)
+ expect(recipe.logged_warnings).to match(/you must use 'provides' to provide DSL/i)
end
end
end
diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb
index 797e9ecb70..e714465a17 100644
--- a/spec/integration/recipes/recipe_dsl_spec.rb
+++ b/spec/integration/recipes/recipe_dsl_spec.rb
@@ -28,6 +28,7 @@ describe "Recipe DSL methods" do
def provider
Provider
end
+
class Provider < Chef::Provider
def load_current_resource; end
diff --git a/spec/integration/recipes/remote_directory.rb b/spec/integration/recipes/remote_directory.rb
index 8332fb1b56..4d0bcd3514 100644
--- a/spec/integration/recipes/remote_directory.rb
+++ b/spec/integration/recipes/remote_directory.rb
@@ -5,7 +5,7 @@ describe Chef::Resource::RemoteDirectory do
include Chef::Mixin::ShellOut
# Until Cheffish::RSpec has cookbook support, we have to run the whole client
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
# Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
# following constraints are satisfied:
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index 3029a1b529..12a49dade6 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -5,20 +5,20 @@ require "chef/run_lock"
require "chef/config"
require "timeout"
require "fileutils"
+require "chef-utils"
require "chef/win32/security" if ChefUtils.windows?
-require "chef/dist"
-describe Chef::Dist::SOLOEXEC do
+describe ChefUtils::Dist::Solo::EXEC do
include IntegrationSupport
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..") }
let(:cookbook_x_100_metadata_rb) { cb_metadata("x", "1.0.0") }
let(:cookbook_ancient_100_metadata_rb) { cb_metadata("ancient", "1.0.0") }
- let(:chef_solo) { "bundle exec #{Chef::Dist::SOLOEXEC} --legacy-mode --minimal-ohai" }
+ let(:chef_solo) { "bundle exec #{ChefUtils::Dist::Solo::EXEC} --legacy-mode --minimal-ohai" }
when_the_repository "creates nodes" do
let(:nodes_dir) { File.join(@repository_dir, "nodes") }
@@ -183,7 +183,7 @@ describe Chef::Dist::SOLOEXEC do
# run_lock gets stuck we can discover it.
expect do
Timeout.timeout(120) do
- chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..")
+ chef_dir = File.join(__dir__, "..", "..", "..")
threads = []
diff --git a/spec/scripts/ssl-serve.rb b/spec/scripts/ssl-serve.rb
deleted file mode 100644
index b03fe4af42..0000000000
--- a/spec/scripts/ssl-serve.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# ssl-serve.rb
-# USAGE: ruby ssl-serve.rb
-#
-# ssl-serve is a script that serves a local directory over SSL.
-# You can use it to test various HTTP behaviors in chef, like chef-client's
-# `-j` and `-c` options and remote_file with https connections.
-#
-require "pp"
-require "openssl"
-require "webrick"
-require "webrick/https"
-
-$ssl = true
-
-CHEF_SPEC_DATA = File.expand_path("../data", __dir__)
-cert_text = File.read(File.expand_path("ssl/chef-rspec.cert", CHEF_SPEC_DATA))
-cert = OpenSSL::X509::Certificate.new(cert_text)
-key_text = File.read(File.expand_path("ssl/chef-rspec.key", CHEF_SPEC_DATA))
-key = OpenSSL::PKey::RSA.new(key_text)
-
-server_opts = {}
-if $ssl
- server_opts.merge!( { SSLEnable: true,
- SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
- SSLCertificate: cert,
- SSLPrivateKey: key })
-end
-
-# 5 == debug, 3 == warning
-LOGGER = WEBrick::Log.new(STDOUT, 5)
-DEFAULT_OPTIONS = {
- server: "webrick",
- Port: 9000,
- Host: "localhost",
- environment: :none,
- Logger: LOGGER,
- DocumentRoot: File.expand_path("#{Dir.tmpdir}/chef-118-sampledata"),
- #:AccessLog => [] # Remove this option to enable the access log when debugging.
-}.freeze
-
-webrick_opts = DEFAULT_OPTIONS.merge(server_opts)
-pp webrick_opts: webrick_opts
-
-server = WEBrick::HTTPServer.new(webrick_opts)
-trap("INT") { server.shutdown }
-
-server.start
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 5766af8954..17ce1ab5b7 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -31,7 +31,7 @@ $LOAD_PATH.unshift File.expand_path("../chef-utils/lib", __dir__)
require "rubygems"
require "rspec/mocks"
-
+require "rexml/document"
require "webmock/rspec"
require "chef"
@@ -68,7 +68,7 @@ end
# If you want to load anything into the testing environment
# without versioning it, add it to spec/support/local_gems.rb
-require "spec/support/local_gems.rb" if File.exist?(File.join(File.dirname(__FILE__), "support", "local_gems.rb"))
+require "spec/support/local_gems" if File.exist?(File.join(File.dirname(__FILE__), "support", "local_gems.rb"))
# Explicitly require spec helpers that need to load first
require "spec/support/platform_helpers"
@@ -200,6 +200,7 @@ RSpec.configure do |config|
# check for particular binaries we need
config.filter_run_excluding choco_installed: true unless choco_installed?
config.filter_run_excluding requires_ifconfig: true unless ifconfig?
+ config.filter_run_excluding pwsh_installed: true unless pwsh_installed?
running_platform_arch = `uname -m`.strip unless windows?
@@ -309,8 +310,6 @@ RSpec.configure do |config|
end
require "webrick/utils"
-require "thread"
-
# Webrick uses a centralized/synchronized timeout manager. It works by
# starting a thread to check for timeouts on an interval. The timeout
# checker thread cannot be stopped or canceled in any easy way, and it
diff --git a/spec/stress/win32/file_spec.rb b/spec/stress/win32/file_spec.rb
index c911698029..274d574919 100644
--- a/spec/stress/win32/file_spec.rb
+++ b/spec/stress/win32/file_spec.rb
@@ -21,7 +21,7 @@ require "chef/win32/file" if windows?
describe "Chef::ReservedNames::Win32::File", :windows_only do
before(:each) do
- @path = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "data", "old_home_dir", "my-dot-emacs"))
+ @path = File.expand_path(File.join(__dir__, "..", "..", "data", "old_home_dir", "my-dot-emacs"))
end
it "should not leak significant memory", :volatile do
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index 810ebe56d7..6a0ca878cd 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -14,8 +14,8 @@
# limitations under the License.
#
-CHEF_SPEC_DATA = File.expand_path(File.dirname(__FILE__) + "/../data/")
-CHEF_SPEC_ASSETS = File.expand_path(File.dirname(__FILE__) + "/../functional/assets/")
+CHEF_SPEC_DATA = File.expand_path(__dir__ + "/../data/")
+CHEF_SPEC_ASSETS = File.expand_path(__dir__ + "/../functional/assets/")
CHEF_SPEC_BACKUP_PATH = File.join(Dir.tmpdir, "test-backup-path")
def sha256_checksum(path)
diff --git a/spec/support/lib/chef/resource/cat.rb b/spec/support/lib/chef/resource/cat.rb
index a66aef8e19..f81504d167 100644
--- a/spec/support/lib/chef/resource/cat.rb
+++ b/spec/support/lib/chef/resource/cat.rb
@@ -29,7 +29,7 @@ class Chef
end
def pretty_kitty(arg = nil)
- if arg == true || arg == false
+ if [true, false].include?(arg)
@pretty_kitty = arg
end
@pretty_kitty
diff --git a/spec/support/lib/chef/resource/one_two_three_four.rb b/spec/support/lib/chef/resource/one_two_three_four.rb
index 4dcbf1e60b..da95d329f5 100644
--- a/spec/support/lib/chef/resource/one_two_three_four.rb
+++ b/spec/support/lib/chef/resource/one_two_three_four.rb
@@ -26,7 +26,7 @@ class Chef
end
def something(arg = nil)
- if arg == true || arg == false
+ if [true, false].include?(arg)
@something = arg
end
@something
diff --git a/spec/support/matchers/leak.rb b/spec/support/matchers/leak.rb
index fd75039b4e..bd59a2755c 100644
--- a/spec/support/matchers/leak.rb
+++ b/spec/support/matchers/leak.rb
@@ -61,10 +61,10 @@ module Matchers
def profiler
@profiler ||= begin
if ChefUtils.windows?
- require File.join(File.dirname(__FILE__), "..", "platforms", "prof", "win32")
+ require File.join(__dir__, "..", "platforms", "prof", "win32")
RSpec::Prof::Win32::Profiler.new
else
- require File.join(File.dirname(__FILE__), "..", "prof", "gc")
+ require File.join(__dir__, "..", "prof", "gc")
RSpec::Prof::GC::Profiler.new
end
end
diff --git a/spec/support/mock/constant.rb b/spec/support/mock/constant.rb
deleted file mode 100644
index 7acd02e9d7..0000000000
--- a/spec/support/mock/constant.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# Allows easy mocking of global and class constants
-
-# Inspired by:
-# http://missingbit.blogspot.com/2011/07/stubbing-constants-in-rspec_20.html
-# http://digitaldumptruck.jotabout.com/?p=551
-
-def mock_constants(constants)
- saved_constants = {}
- constants.each do |constant, val|
- source_object, const_name = parse_constant(constant)
- saved_constants[constant] = source_object.const_get(const_name)
- with_warnings(nil) { source_object.const_set(const_name, val) }
- end
-
- begin
- yield
- ensure
- constants.each_key do |constant|
- source_object, const_name = parse_constant(constant)
- with_warnings(nil) { source_object.const_set(const_name, saved_constants[constant]) }
- end
- end
-end
-
-def parse_constant(constant)
- source, _, constant_name = constant.to_s.rpartition("::")
- [constantize(source), constant_name]
-end
-
-# Taken from ActiveSupport
-
-# File activesupport/lib/active_support/core_ext/kernel/reporting.rb, line 3
-#
-# Sets $VERBOSE for the duration of the block and back to its original value afterwards.
-def with_warnings(flag)
- old_verbose, $VERBOSE = $VERBOSE, flag
- yield
-ensure
- $VERBOSE = old_verbose
-end
-
-# File activesupport/lib/active_support/inflector/methods.rb, line 209
-def constantize(camel_cased_word)
- names = camel_cased_word.split("::")
- names.shift if names.empty? || names.first.empty?
-
- constant = Object
- names.each do |name|
- constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
- end
- constant
-end
diff --git a/spec/support/mock/platform.rb b/spec/support/mock/platform.rb
index 883d953371..e2d2149fad 100644
--- a/spec/support/mock/platform.rb
+++ b/spec/support/mock/platform.rb
@@ -5,21 +5,29 @@
# 'i386-mingw32' (windows) or 'x86_64-darwin11.2.0' (unix). Useful for
# testing code that mixes in platform specific modules like +Chef::Mixin::Securable+
# or +Chef::FileAccessControl+
-def platform_mock(platform = :unix)
- allow(ChefUtils).to receive(:windows?).and_return(platform == :windows ? true : false)
- ENV["SYSTEMDRIVE"] = (platform == :windows ? "C:" : nil)
+RSpec.configure do |c|
+ c.include(Module.new do
+ def platform_mock(platform = :unix)
+ case platform
+ when :windows
+ Chef::Config.set_defaults_for_windows
+ allow(ChefUtils).to receive(:windows?).and_return(true)
+ stub_const("ENV", ENV.to_hash.merge("SYSTEMDRIVE" => "C:"))
+ stub_const("RUBY_PLATFORM", "i386-mingw32")
+ stub_const("File::PATH_SEPARATOR", ";")
+ stub_const("File::ALT_SEPARATOR", "\\")
+ when :unix
+ Chef::Config.set_defaults_for_nix
+ allow(ChefUtils).to receive(:windows?).and_return(false)
+ stub_const("ENV", ENV.to_hash.merge("SYSTEMDRIVE" => nil))
+ stub_const("RUBY_PLATFORM", "x86_64-darwin11.2.0")
+ stub_const("File::PATH_SEPARATOR", ":")
+ stub_const("File::ALT_SEPARATOR", nil)
+ else
+ raise "#{__method__}: unrecognized platform '#{platform}', expected one of ':unix' or ':windows'"
+ end
- if platform == :windows
- Chef::Config.set_defaults_for_windows
- else
- Chef::Config.set_defaults_for_nix
- end
-
- if block_given?
- mock_constants({ "RUBY_PLATFORM" => (platform == :windows ? "i386-mingw32" : "x86_64-darwin11.2.0"),
- "File::PATH_SEPARATOR" => (platform == :windows ? ";" : ":"),
- "File::ALT_SEPARATOR" => (platform == :windows ? "\\" : nil) }) do
- yield
- end
- end
+ yield
+ end
+ end)
end
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index d4bd0701d8..b29c860f30 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -2,11 +2,9 @@ require "fcntl"
require "chef/mixin/shell_out"
require "ohai/mixin/http_helper"
require "ohai/mixin/gce_metadata"
-require "chef/mixin/powershell_out"
class ShellHelpers
extend Chef::Mixin::ShellOut
- extend Chef::Mixin::PowershellOut
end
# magic stolen from bundler/spec/support/less_than_proc.rb
@@ -26,11 +24,11 @@ class DependencyProc < Proc
end
def ruby_64bit?
- !!(RbConfig::CONFIG["host_cpu"] =~ /x86_64/)
+ RbConfig::CONFIG["host_cpu"].include?("x86_64")
end
def ruby_32bit?
- !!(RbConfig::CONFIG["host_cpu"] =~ /i686/)
+ RbConfig::CONFIG["host_cpu"].include?("i686")
end
def windows?
@@ -117,19 +115,19 @@ def unix?
end
def linux?
- RUBY_PLATFORM.match?(/linux/)
+ RUBY_PLATFORM.include?("linux")
end
def macos?
- RUBY_PLATFORM.match?(/darwin/)
+ RUBY_PLATFORM.include?("darwin")
end
def solaris?
- RUBY_PLATFORM.match?(/solaris/)
+ RUBY_PLATFORM.include?("solaris")
end
def freebsd?
- RUBY_PLATFORM.match?(/freebsd/)
+ RUBY_PLATFORM.include?("freebsd")
end
def intel_64bit?
@@ -165,7 +163,7 @@ def debian_family?
end
def aix?
- RUBY_PLATFORM.match?(/aix/)
+ RUBY_PLATFORM.include?("aix")
end
def wpar?
@@ -199,8 +197,7 @@ def selinux_enabled?
end
def suse?
- ::File.exist?("/etc/SuSE-release") ||
- ( ::File.exist?("/etc/os-release") && /sles|suse/.match?(File.read("/etc/os-release")) )
+ !!(ohai[:platform_family] == "suse")
end
def root?
@@ -243,6 +240,15 @@ def ifconfig?
end
def choco_installed?
- result = ShellHelpers.powershell_out("choco --version")
- result.stderr.empty? ? true : false
+ result = ShellHelpers.shell_out("choco --version")
+ result.stderr.empty?
+rescue
+ false
+end
+
+def pwsh_installed?
+ result = ShellHelpers.shell_out("pwsh.exe --version")
+ result.stderr.empty?
+rescue
+ false
end
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb
index 26f2b1cc5a..4d3a1f2fe6 100644
--- a/spec/support/shared/functional/securable_resource.rb
+++ b/spec/support/shared/functional/securable_resource.rb
@@ -242,48 +242,100 @@ shared_examples_for "a securable resource with existing target" do
include_context "use Windows permissions"
describe "when setting owner" do
- before do
- resource.owner(SID.admin_account_name)
- resource.run_action(:create)
- end
+ context "with user name" do
+ before do
+ resource.owner(SID.admin_account_name)
+ resource.run_action(:create)
+ end
- it "should set the owner" do
- expect(descriptor.owner).to eq(SID.Administrator)
+ it "should set the owner" do
+ expect(descriptor.owner).to eq(SID.Administrator)
+ end
+
+ it "is marked as updated only if changes are made" do
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ end
end
- it "is marked as updated only if changes are made" do
- expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ context "with SID" do
+ before do
+ resource.owner(SID.Administrator.to_s)
+ resource.run_action(:create)
+ end
+
+ it "should set the owner" do
+ expect(descriptor.owner).to eq(SID.Administrator)
+ end
+
+ it "is marked as updated only if changes are made" do
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ end
end
end
describe "when setting group" do
- before do
- resource.group("Administrators")
- resource.run_action(:create)
- end
+ context "with group name" do
+ before do
+ resource.group("Administrators")
+ resource.run_action(:create)
+ end
+
+ it "should set the group" do
+ expect(descriptor.group).to eq(SID.Administrators)
+ end
- it "should set the group" do
- expect(descriptor.group).to eq(SID.Administrators)
+ it "is marked as updated only if changes are made" do
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ end
end
- it "is marked as updated only if changes are made" do
- expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ context "with group SID" do
+ before do
+ resource.group(SID.Administrators.to_s)
+ resource.run_action(:create)
+ end
+
+ it "should set the group" do
+ expect(descriptor.group).to eq(SID.Administrators)
+ end
+
+ it "is marked as updated only if changes are made" do
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ end
end
end
describe "when setting rights and deny_rights" do
- before do
- resource.deny_rights(:modify, "Guest")
- resource.rights(:read, "Guest")
- resource.run_action(:create)
- end
+ context "with user name" do
+ before do
+ resource.deny_rights(:modify, "Guest")
+ resource.rights(:read, "Guest")
+ resource.run_action(:create)
+ end
- it "should set the rights and deny_rights" do
- expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_modify_perms) + allowed_acl(SID.Guest, expected_read_perms))
+ it "should set the rights and deny_rights" do
+ expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_modify_perms) + allowed_acl(SID.Guest, expected_read_perms))
+ end
+
+ it "is marked as updated only if changes are made" do
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ end
end
- it "is marked as updated only if changes are made" do
- expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ context "with SID" do
+ before do
+ resource.deny_rights(:modify, SID.Guest.to_s)
+ resource.rights(:read, SID.Guest.to_s)
+ resource.run_action(:create)
+ end
+
+ it "should set the rights and deny_rights" do
+ expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_modify_perms) + allowed_acl(SID.Guest, expected_read_perms))
+ end
+
+ it "is marked as updated only if changes are made" do
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
+ end
end
end
end
@@ -302,12 +354,18 @@ shared_examples_for "a securable resource without existing target" do
expect(descriptor.owner).to eq(SID.default_security_object_owner)
end
- it "sets owner when owner is specified" do
+ it "sets owner when owner is specified by name" do
resource.owner "Guest"
resource.run_action(:create)
expect(descriptor.owner).to eq(SID.Guest)
end
+ it "sets owner when owner is specified by SID" do
+ resource.owner SID.Guest.to_s
+ resource.run_action(:create)
+ expect(descriptor.owner).to eq(SID.Guest)
+ end
+
it "fails to set owner when owner has invalid characters" do
expect { resource.owner 'Lance "The Nose" Glindenberry III' }.to raise_error(Chef::Exceptions::ValidationFailed)
end
@@ -339,12 +397,18 @@ shared_examples_for "a securable resource without existing target" do
expect(descriptor.group).to eq(SID.default_security_object_group)
end
- it "sets group when group is specified" do
+ it "sets group when group is specified by name" do
resource.group "Everyone"
resource.run_action(:create)
expect(descriptor.group).to eq(SID.Everyone)
end
+ it "sets group when group is specified by SID" do
+ resource.group SID.Everyone.to_s
+ resource.run_action(:create)
+ expect(descriptor.group).to eq(SID.Everyone)
+ end
+
it "fails to set group when group has invalid characters" do
expect { resource.group 'Lance "The Nose" Glindenberry III' }.to raise_error(Chef::Exceptions::ValidationFailed)
end
@@ -406,6 +470,17 @@ shared_examples_for "a securable resource without existing target" do
allowed_acl(SID.Guest, expected_modify_perms)
)
end
+
+ it "multiple rights with SID" do
+ resource.rights(:read, SID.Everyone.to_s)
+ resource.rights(:modify, SID.Guest.to_s)
+ resource.run_action(:create)
+
+ expect(explicit_aces).to eq(
+ allowed_acl(SID.Everyone, expected_read_perms) +
+ allowed_acl(SID.Guest, expected_modify_perms)
+ )
+ end
end
end
@@ -443,6 +518,12 @@ shared_examples_for "a securable resource without existing target" do
expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_full_control_perms))
end
+ it "using SID" do
+ resource.deny_rights(:full_control, SID.Guest.to_s)
+ resource.run_action(:create)
+ expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_full_control_perms))
+ end
+
it "deny_rights ahead of rights" do
resource.rights(:read, "Everyone")
resource.deny_rights(:modify, "Guest")
diff --git a/spec/support/shared/functional/win32_service.rb b/spec/support/shared/functional/win32_service.rb
index dfd66f74ad..890c28de2c 100644
--- a/spec/support/shared/functional/win32_service.rb
+++ b/spec/support/shared/functional/win32_service.rb
@@ -42,7 +42,7 @@ shared_context "using Win32::Service" do
service_name: "spec-service",
service_display_name: "Spec Test Service",
service_description: "Service for testing Chef::Application::WindowsServiceManager.",
- service_file_path: File.expand_path(File.join(File.dirname(__FILE__), "../../platforms/win32/spec_service.rb")),
+ service_file_path: File.expand_path(File.join(__dir__, "../../platforms/win32/spec_service.rb")),
delayed_start: true,
}
end
diff --git a/spec/support/shared/unit/application_dot_d.rb b/spec/support/shared/unit/application_dot_d.rb
index a9e6d46ad9..692b0f99e1 100644
--- a/spec/support/shared/unit/application_dot_d.rb
+++ b/spec/support/shared/unit/application_dot_d.rb
@@ -33,12 +33,12 @@ shared_examples_for "an application that loads a dot d" do
# make sure that we are correctly globbing.
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../../data/client.d_00")
+ File.join(__dir__, "../../../data/client.d_00")
)
end
it "loads the configuration in order" do
- etc_chef_client_rb = Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/client.rb")
+ etc_chef_client_rb = Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/client.rb")
expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_return("foo 0")
expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_return("bar 0")
expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/02-strings.rb").cleanpath.to_s).and_return("strings 0")
@@ -53,7 +53,7 @@ shared_examples_for "an application that loads a dot d" do
context "when client_d_dir is set to a directory without configuration" do
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_01")
+ File.join(__dir__, "../../data/client.d_01")
)
end
@@ -71,7 +71,7 @@ shared_examples_for "an application that loads a dot d" do
# foo.rb as a directory should be ignored
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_02")
+ File.join(__dir__, "../../data/client.d_02")
)
end
diff --git a/spec/support/shared/unit/knife_shared.rb b/spec/support/shared/unit/knife_shared.rb
index ebdf7bddc7..3c7459cfcc 100644
--- a/spec/support/shared/unit/knife_shared.rb
+++ b/spec/support/shared/unit/knife_shared.rb
@@ -33,7 +33,7 @@ shared_examples_for "mandatory field missing" do
it "prints a relevant error message" do
expect { knife.run }.to raise_error(SystemExit)
- expect(stderr.string).to match /You must specify a #{fieldname}/
+ expect(stderr.string).to match(/You must specify a #{fieldname}/)
end
end
end
diff --git a/spec/support/shared/unit/script_resource.rb b/spec/support/shared/unit/script_resource.rb
index d1096f3ce9..0256112a68 100644
--- a/spec/support/shared/unit/script_resource.rb
+++ b/spec/support/shared/unit/script_resource.rb
@@ -47,16 +47,16 @@ shared_examples_for "a script resource" do
end
describe "when executing guards" do
- it "inherits exactly the :cwd, :environment, :group, :path, :user, and :umask attributes from a parent resource class" do
+ it "inherits exactly the :cwd, :domain, :environment, :group, :password, :path, :user, and :umask attributes from a parent resource class" do
inherited_difference = Chef::Resource::Script.guard_inherited_attributes -
- %i{cwd environment group path user umask}
+ %i{cwd domain environment group password path user umask}
expect(inherited_difference).to eq([])
end
it "when guard_interpreter is set to the default value, the guard command string should be evaluated by command execution and not through a resource" do
expect_any_instance_of(Chef::Resource::Conditional).not_to receive(:evaluate_block)
- expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).not_to receive(:evaluate_action)
+ expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).not_to receive(:evaluate)
expect_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).to receive(:evaluate).and_return(true)
script_resource.only_if "echo hi"
expect(script_resource.should_skip?(:run)).to eq(nil)
@@ -65,7 +65,7 @@ shared_examples_for "a script resource" do
it "when a valid guard_interpreter resource is specified, a block should be used to evaluate the guard" do
expect_any_instance_of(Chef::Resource::Conditional).not_to receive(:evaluate_block)
expect_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).not_to receive(:evaluate)
- expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(true)
+ expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate).and_return(true)
script_resource.guard_interpreter :script
script_resource.only_if "echo hi"
expect(script_resource.should_skip?(:run)).to eq(nil)
diff --git a/spec/support/shared/unit/windows_script_resource.rb b/spec/support/shared/unit/windows_script_resource.rb
index 4a2f755952..2961b378e3 100644
--- a/spec/support/shared/unit/windows_script_resource.rb
+++ b/spec/support/shared/unit/windows_script_resource.rb
@@ -35,7 +35,7 @@ shared_examples_for "a Windows script resource" do
end
it "should use a resource to evaluate the guard when guard_interpreter is not specified" do
- expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(true)
+ expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate).and_return(true)
expect_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).not_to receive(:evaluate)
windows_script_resource.only_if "echo hi"
expect(windows_script_resource.should_skip?(:run)).to eq(nil)
diff --git a/spec/tiny_server.rb b/spec/tiny_server.rb
index 868933b042..786130d0d5 100644
--- a/spec/tiny_server.rb
+++ b/spec/tiny_server.rb
@@ -19,7 +19,6 @@
require "webrick"
require "webrick/https"
require "rack"
-require "thread"
require "singleton"
require "open-uri"
require "chef/config"
diff --git a/spec/unit/chef_fs/config_spec.rb b/spec/unit/chef_fs/config_spec.rb
index 848e789d3c..fc44374ae7 100644
--- a/spec/unit/chef_fs/config_spec.rb
+++ b/spec/unit/chef_fs/config_spec.rb
@@ -18,7 +18,7 @@
require "spec_helper"
require "chef/exceptions"
-require "lib/chef/chef_fs/config.rb"
+require "lib/chef/chef_fs/config"
describe Chef::ChefFS::Config do
describe "initialize" do
diff --git a/spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb b/spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb
index a0c7d540ec..b85d811003 100644
--- a/spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb
+++ b/spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb"
+require "lib/chef/chef_fs/data_handler/data_bag_item_data_handler"
class TestDataBag < Mash
attr_accessor :name
diff --git a/spec/unit/chef_fs/path_util_spec.rb b/spec/unit/chef_fs/path_util_spec.rb
index 694dabf5d7..4056c240cc 100644
--- a/spec/unit/chef_fs/path_util_spec.rb
+++ b/spec/unit/chef_fs/path_util_spec.rb
@@ -61,7 +61,7 @@ describe Chef::ChefFS::PathUtils do
end
context "invoking realest_path" do
- let(:good_path) { File.dirname(__FILE__) }
+ let(:good_path) { __dir__ }
let(:parent_path) { File.dirname(good_path) }
it "handles paths with no wildcards or globs" do
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 34c0a2c548..b6a321c8e8 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -129,6 +129,7 @@ shared_context "a client run" do
expect(client.events).to receive(:register).with(instance_of(Chef::DataCollector::Reporter))
expect(client.events).to receive(:register).with(instance_of(Chef::ResourceReporter))
expect(client.events).to receive(:register).with(instance_of(Chef::ActionCollection))
+ expect(client.events).to receive(:register).with(instance_of(Chef::Compliance::Runner))
end
def stub_for_node_load
@@ -801,4 +802,20 @@ describe Chef::Client do
allow_any_instance_of(Chef::RunLock).to receive(:save_pid).and_raise(NoMethodError)
end
end
+
+ describe "deprecated enforce_path_sanity" do
+ include_context "a client run"
+ include_context "converge completed"
+
+ it "print a warning, when enforce_path_sanity is passed" do
+ Chef::Config[:enforce_path_sanity] = true
+ expect(logger).to receive(:warn).with("`enforce_path_sanity` is deprecated, please use `enforce_default_paths` instead!")
+ client.run
+ end
+
+ it "should not print a warning, when enforce_path_sanity is not passed" do
+ expect(logger).not_to receive(:warn).with("`enforce_path_sanity` is deprecated, please use `enforce_default_paths` instead!")
+ client.run
+ end
+ end
end
diff --git a/spec/unit/compliance/fetcher/automate_spec.rb b/spec/unit/compliance/fetcher/automate_spec.rb
new file mode 100644
index 0000000000..bc2125aaa7
--- /dev/null
+++ b/spec/unit/compliance/fetcher/automate_spec.rb
@@ -0,0 +1,134 @@
+require "spec_helper"
+require "chef/compliance/fetcher/automate"
+
+describe Chef::Compliance::Fetcher::Automate do
+ describe ".resolve" do
+ before do
+ Chef::Config[:data_collector] = {
+ server_url: "https://automate.test/data_collector",
+ token: token,
+ }
+ end
+
+ let(:token) { "fake_token" }
+
+ context "when target is a string" do
+ it "should resolve a compliance URL" do
+ res = Chef::Compliance::Fetcher::Automate.resolve("compliance://namespace/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://automate.test/compliance/profiles/namespace/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "raises an exception with no data collector token" do
+ Chef::Config[:data_collector].delete(:token)
+
+ expect {
+ Chef::Compliance::Fetcher::Automate.resolve("compliance://namespace/profile_name")
+ }.to raise_error(/No data-collector token set/)
+ end
+
+ it "includes the data collector token" do
+ expect(Chef::Compliance::Fetcher::Automate).to receive(:new).with(
+ "https://automate.test/compliance/profiles/namespace/profile_name/tar",
+ hash_including("token" => token)
+ ).and_call_original
+
+ res = Chef::Compliance::Fetcher::Automate.resolve("compliance://namespace/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://automate.test/compliance/profiles/namespace/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "returns nil with a non-compliance URL" do
+ res = Chef::Compliance::Fetcher::Automate.resolve("http://github.com/chef-cookbooks/audit")
+
+ expect(res).to eq(nil)
+ end
+ end
+
+ context "when target is a hash" do
+ it "should resolve a target with a version" do
+ res = Chef::Compliance::Fetcher::Automate.resolve(
+ compliance: "namespace/profile_name",
+ version: "1.2.3"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://automate.test/compliance/profiles/namespace/profile_name/version/1.2.3/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "should resolve a target without a version" do
+ res = Chef::Compliance::Fetcher::Automate.resolve(
+ compliance: "namespace/profile_name"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://automate.test/compliance/profiles/namespace/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "uses url key when present" do
+ res = Chef::Compliance::Fetcher::Automate.resolve(
+ compliance: "namespace/profile_name",
+ version: "1.2.3",
+ url: "https://profile.server.test/profiles/profile_name/1.2.3"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://profile.server.test/profiles/profile_name/1.2.3"
+ expect(res.target).to eq(expected)
+ end
+
+ it "does not include token in the config when url key is present" do
+ expect(Chef::Compliance::Fetcher::Automate).to receive(:new).with(
+ "https://profile.server.test/profiles/profile_name/1.2.3",
+ hash_including("token" => nil)
+ ).and_call_original
+
+ res = Chef::Compliance::Fetcher::Automate.resolve(
+ compliance: "namespace/profile_name",
+ version: "1.2.3",
+ url: "https://profile.server.test/profiles/profile_name/1.2.3"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://profile.server.test/profiles/profile_name/1.2.3"
+ expect(res.target).to eq(expected)
+ end
+
+ it "raises an exception with no data collector token" do
+ Chef::Config[:data_collector].delete(:token)
+
+ expect {
+ Chef::Compliance::Fetcher::Automate.resolve(compliance: "namespace/profile_name")
+ }.to raise_error(Inspec::FetcherFailure, /No data-collector token set/)
+ end
+
+ it "includes the data collector token" do
+ expect(Chef::Compliance::Fetcher::Automate).to receive(:new).with(
+ "https://automate.test/compliance/profiles/namespace/profile_name/tar",
+ hash_including("token" => token)
+ ).and_call_original
+
+ res = Chef::Compliance::Fetcher::Automate.resolve(compliance: "namespace/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://automate.test/compliance/profiles/namespace/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "returns nil with a non-profile Hash" do
+ res = Chef::Compliance::Fetcher::Automate.resolve(
+ profile: "namespace/profile_name",
+ version: "1.2.3"
+ )
+
+ expect(res).to eq(nil)
+ end
+ end
+ end
+end
diff --git a/spec/unit/compliance/fetcher/chef_server_spec.rb b/spec/unit/compliance/fetcher/chef_server_spec.rb
new file mode 100644
index 0000000000..fc1c229989
--- /dev/null
+++ b/spec/unit/compliance/fetcher/chef_server_spec.rb
@@ -0,0 +1,93 @@
+require "spec_helper"
+require "chef/compliance/fetcher/chef_server"
+
+describe Chef::Compliance::Fetcher::ChefServer do
+ let(:node) do
+ Chef::Node.new.tap do |n|
+ n.default["audit"] = {}
+ end
+ end
+
+ before :each do
+ allow(Chef).to receive(:node).and_return(node)
+
+ Chef::Config[:chef_server_url] = "http://127.0.0.1:8889/organizations/my_org"
+ end
+
+ describe ".resolve" do
+ context "when target is a string" do
+ it "should resolve a compliance URL" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve("compliance://namespace/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::ChefServer)
+ expected = "http://127.0.0.1:8889/organizations/my_org/owners/namespace/compliance/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "should add /compliance URL prefix if needed" do
+ node.default["audit"]["fetcher"] = "chef-server"
+ res = Chef::Compliance::Fetcher::ChefServer.resolve("compliance://namespace/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::ChefServer)
+ expected = "http://127.0.0.1:8889/compliance/organizations/my_org/owners/namespace/compliance/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "includes user in the URL if present" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve("compliance://username@namespace/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::ChefServer)
+ expected = "http://127.0.0.1:8889/organizations/my_org/owners/username@namespace/compliance/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "returns nil with a non-compliance URL" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve("http://github.com/chef-cookbooks/audit")
+
+ expect(res).to eq(nil)
+ end
+ end
+
+ context "when target is a hash" do
+ it "should resolve a target with a version" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve(
+ compliance: "namespace/profile_name",
+ version: "1.2.3"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::ChefServer)
+ expected = "http://127.0.0.1:8889/organizations/my_org/owners/namespace/compliance/profile_name/version/1.2.3/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "should resolve a target without a version" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve(
+ compliance: "namespace/profile_name"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::ChefServer)
+ expected = "http://127.0.0.1:8889/organizations/my_org/owners/namespace/compliance/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "includes user in the URL if present" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve(
+ compliance: "username@namespace/profile_name"
+ )
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::ChefServer)
+ expected = "http://127.0.0.1:8889/organizations/my_org/owners/username@namespace/compliance/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
+ it "returns nil with a non-profile Hash" do
+ res = Chef::Compliance::Fetcher::ChefServer.resolve(
+ profile: "namespace/profile_name",
+ version: "1.2.3"
+ )
+
+ expect(res).to eq(nil)
+ end
+ end
+ end
+end
diff --git a/spec/unit/compliance/reporter/automate_spec.rb b/spec/unit/compliance/reporter/automate_spec.rb
new file mode 100644
index 0000000000..e0a33892b0
--- /dev/null
+++ b/spec/unit/compliance/reporter/automate_spec.rb
@@ -0,0 +1,427 @@
+require "spec_helper"
+require "json" # For .to_json
+
+describe Chef::Compliance::Reporter::Automate do
+ let(:reporter) { Chef::Compliance::Reporter::Automate.new(opts) }
+
+ let(:opts) do
+ {
+ entity_uuid: "aaaaaaaa-709a-475d-bef5-zzzzzzzzzzzz",
+ run_id: "3f0536f7-3361-4bca-ae53-b45118dceb5d",
+ node_info: {
+ node: "chef-client.solo",
+ environment: "My Prod Env",
+ roles: %w{base_linux apache_linux},
+ recipes: ["some_cookbook::some_recipe", "some_cookbook"],
+ policy_name: "test_policy_name",
+ policy_group: "test_policy_group",
+ chef_tags: ["mylinux", "my.tag", "some=tag"],
+ organization_name: "test_org",
+ source_fqdn: "api.chef.io",
+ ipaddress: "192.168.56.33",
+ fqdn: "lb1.prod.example.com",
+ },
+ run_time_limit: 1.1,
+ control_results_limit: 2,
+ timestamp: Time.parse("2016-07-19T19:19:19+01:00"),
+ }
+ end
+
+ let(:inspec_report) do
+ {
+ "version": "1.2.1",
+ "profiles":
+ [{ "name": "tmp_compliance_profile",
+ "title": "/tmp Compliance Profile",
+ "summary": "An Example Compliance Profile",
+ "sha256": "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd",
+ "version": "0.1.1",
+ "maintainer": "Nathen Harvey <nharvey@chef.io>",
+ "license": "Apache 2.0 License",
+ "copyright": "Nathen Harvey <nharvey@chef.io>",
+ "supports": [],
+ "controls":
+ [{ "title": "A /tmp directory must exist",
+ "desc": "A /tmp directory must exist",
+ "impact": 0.3,
+ "refs": [],
+ "tags": {},
+ "code": "control 'tmp-1.0' do\n impact 0.3\n title 'A /tmp directory must exist'\n desc 'A /tmp directory must exist'\n describe file '/tmp' do\n it { should be_directory }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 3 },
+ "id": "tmp-1.0",
+ "results": [
+ { "status": "passed", "code_desc": "File /tmp should be directory", "run_time": 0.002312, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ },
+ { "title": "/tmp directory is owned by the root user",
+ "desc": "The /tmp directory must be owned by the root user",
+ "impact": 0.3,
+ "refs": [{ "url": "https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf", "ref": "Compliance Whitepaper" }],
+ "tags": { "production": nil, "development": nil, "identifier": "value", "remediation": "https://github.com/chef-cookbooks/audit" },
+ "code": "control 'tmp-1.1' do\n impact 0.3\n title '/tmp directory is owned by the root user'\n desc 'The /tmp directory must be owned by the root user'\n tag 'production','development'\n tag identifier: 'value'\n tag remediation: 'https://github.com/chef-cookbooks/audit'\n ref 'Compliance Whitepaper', url: 'https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf'\n describe file '/tmp' do\n it { should be_owned_by 'root' }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 12 },
+ "id": "tmp-1.1",
+ "results": [
+ { "status": "passed", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ { "status": "skipped", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ { "status": "failed", "code_desc": "File /etc/hosts is expected to be directory", "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400", "message": "expected `File /etc/hosts.directory?` to return true, got false" },
+ ],
+ },
+ ],
+ "groups": [{ "title": "/tmp Compliance Profile", "controls": ["tmp-1.0", "tmp-1.1"], "id": "controls/tmp.rb" }],
+ "attributes": [{ "name": "syslog_pkg", "options": { "default": "rsyslog", "description": "syslog package..." } }] }],
+ "other_checks": [],
+ "statistics": { "duration": 0.032332 },
+ }
+ end
+
+ describe "#send_report" do
+ before :each do
+ WebMock.disable_net_connect!
+
+ Chef::Config[:data_collector] = { token: token, server_url: "https://automate.test/data_collector" }
+ end
+
+ let(:token) { "fake_token" }
+
+ it "sends report successfully to ChefAutomate with missing profiles" do
+ metasearch_stub = stub_request(:post, "https://automate.test/compliance/profiles/metasearch")
+ .with(
+ body: '{"sha256": ["7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd"]}',
+ headers: {
+ "Accept-Encoding" => "identity",
+ "X-Chef-Version" => Chef::VERSION,
+ "X-Data-Collector-Auth" => "version=1.0",
+ "X-Data-Collector-Token" => token,
+ }
+ ).to_return(
+ status: 200,
+ body: '{"missing_sha256": ["7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd"]}'
+ )
+
+ report_stub = stub_request(:post, "https://automate.test/data_collector")
+ .with(
+ body: {
+ "version": "1.2.1",
+ "profiles": [
+ {
+ "name": "tmp_compliance_profile",
+ "title": "/tmp Compliance Profile",
+ "summary": "An Example Compliance Profile",
+ "sha256": "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd",
+ "version": "0.1.1",
+ "maintainer": "Nathen Harvey <nharvey@chef.io>",
+ "license": "Apache 2.0 License",
+ "copyright": "Nathen Harvey <nharvey@chef.io>",
+ "supports": [],
+ "controls": [
+ {
+ "title": "A /tmp directory must exist",
+ "desc": "A /tmp directory must exist",
+ "impact": 0.3,
+ "refs": [],
+ "tags": {},
+ "code": "control 'tmp-1.0' do\n impact 0.3\n title 'A /tmp directory must exist'\n desc 'A /tmp directory must exist'\n describe file '/tmp' do\n it { should be_directory }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 3 },
+ "id": "tmp-1.0",
+ "results": [
+ { "status": "passed", "code_desc": "File /tmp should be directory", "run_time": 0.002312, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ },
+ {
+ "title": "/tmp directory is owned by the root user",
+ "desc": "The /tmp directory must be owned by the root user",
+ "impact": 0.3,
+ "refs": [
+ { "url": "https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf", "ref": "Compliance Whitepaper" },
+ ],
+ "tags": { "production": nil, "development": nil, "identifier": "value", "remediation": "https://github.com/chef-cookbooks/audit" },
+ "code": "control 'tmp-1.1' do\n impact 0.3\n title '/tmp directory is owned by the root user'\n desc 'The /tmp directory must be owned by the root user'\n tag 'production','development'\n tag identifier: 'value'\n tag remediation: 'https://github.com/chef-cookbooks/audit'\n ref 'Compliance Whitepaper', url: 'https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf'\n describe file '/tmp' do\n it { should be_owned_by 'root' }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 12 },
+ "id": "tmp-1.1",
+ "results": [
+ { "status": "failed", "code_desc": "File /etc/hosts is expected to be directory", "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400", "message": "expected `File /etc/hosts.directory?` to return true, got false" },
+ { "status": "skipped", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ "removed_results_counts": { "failed": 0, "skipped": 0, "passed": 1 },
+ },
+ ],
+ "groups": [
+ { "title": "/tmp Compliance Profile", "controls": ["tmp-1.0", "tmp-1.1"], "id": "controls/tmp.rb" },
+ ],
+ "attributes": [
+ { "name": "syslog_pkg", "options": { "default": "rsyslog", "description": "syslog package..." } },
+ ],
+ },
+ ],
+ "other_checks": [],
+ "statistics": { "duration": 0.032332 },
+ "type": "inspec_report",
+ "node_name": "chef-client.solo",
+ "end_time": "2016-07-19T18:19:19Z",
+ "node_uuid": "aaaaaaaa-709a-475d-bef5-zzzzzzzzzzzz",
+ "environment": "My Prod Env",
+ "roles": %w{base_linux apache_linux},
+ "recipes": ["some_cookbook::some_recipe", "some_cookbook"],
+ "report_uuid": "3f0536f7-3361-4bca-ae53-b45118dceb5d",
+ "source_fqdn": "api.chef.io",
+ "organization_name": "test_org",
+ "policy_group": "test_policy_group",
+ "policy_name": "test_policy_name",
+ "chef_tags": ["mylinux", "my.tag", "some=tag"],
+ "ipaddress": "192.168.56.33",
+ "fqdn": "lb1.prod.example.com",
+ "run_time_limit": 1.1,
+ },
+ headers: {
+ "Accept-Encoding" => "identity",
+ "X-Chef-Version" => Chef::VERSION,
+ "X-Data-Collector-Auth" => "version=1.0",
+ "X-Data-Collector-Token" => token,
+ }
+ ).to_return(status: 200)
+
+ expect(reporter.send_report(inspec_report)).to eq(true)
+
+ expect(metasearch_stub).to have_been_requested
+ expect(report_stub).to have_been_requested
+ end
+
+ it "sends report successfully to ChefAutomate with seen profiles" do
+ metasearch_stub = stub_request(:post, "https://automate.test/compliance/profiles/metasearch")
+ .with(
+ body: '{"sha256": ["7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd"]}',
+ headers: {
+ "Accept-Encoding" => "identity",
+ "X-Chef-Version" => Chef::VERSION,
+ "X-Data-Collector-Auth" => "version=1.0",
+ "X-Data-Collector-Token" => token,
+ }
+ ).to_return(
+ status: 200,
+ body: '{"missing_sha256": []}'
+ )
+
+ report_stub = stub_request(:post, "https://automate.test/data_collector")
+ .with(
+ body: {
+ "version": "1.2.1",
+ "profiles": [
+ {
+ "title": "/tmp Compliance Profile",
+ "sha256": "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd",
+ "version": "0.1.1",
+ "controls": [
+ {
+ "id": "tmp-1.0",
+ "results": [
+ { "status": "passed", "code_desc": "File /tmp should be directory" },
+ ],
+ },
+ {
+ "id": "tmp-1.1",
+ "results": [
+ { "status": "failed", "code_desc": "File /etc/hosts is expected to be directory", "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400", "message": "expected `File /etc/hosts.directory?` to return true, got false" },
+ { "status": "skipped", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ "removed_results_counts": { "failed": 0, "skipped": 0, "passed": 1 },
+ },
+ ],
+ "attributes": [
+ { "name": "syslog_pkg", "options": { "default": "rsyslog", "description": "syslog package..." } },
+ ],
+ },
+ ],
+ "other_checks": [],
+ "statistics": { "duration": 0.032332 },
+ "type": "inspec_report",
+ "node_name": "chef-client.solo",
+ "end_time": "2016-07-19T18:19:19Z",
+ "node_uuid": "aaaaaaaa-709a-475d-bef5-zzzzzzzzzzzz",
+ "environment": "My Prod Env",
+ "roles": %w{base_linux apache_linux},
+ "recipes": ["some_cookbook::some_recipe", "some_cookbook"],
+ "report_uuid": "3f0536f7-3361-4bca-ae53-b45118dceb5d",
+ "source_fqdn": "api.chef.io",
+ "organization_name": "test_org",
+ "policy_group": "test_policy_group",
+ "policy_name": "test_policy_name",
+ "chef_tags": ["mylinux", "my.tag", "some=tag"],
+ "ipaddress": "192.168.56.33",
+ "fqdn": "lb1.prod.example.com",
+ "run_time_limit": 1.1,
+ },
+ headers: {
+ "Accept-Encoding" => "identity",
+ "X-Chef-Version" => Chef::VERSION,
+ "X-Data-Collector-Auth" => "version=1.0",
+ "X-Data-Collector-Token" => token,
+ }
+ ).to_return(status: 200)
+
+ expect(reporter.send_report(inspec_report)).to eq(true)
+
+ expect(metasearch_stub).to have_been_requested
+ expect(report_stub).to have_been_requested
+ end
+
+ it "does not send report when entity_uuid is missing" do
+ opts.delete(:entity_uuid)
+ reporter = Chef::Compliance::Reporter::Automate.new(opts)
+ expect(reporter.send_report(inspec_report)).to eq(false)
+ end
+ end
+
+ describe "#truncate_controls_results" do
+ let(:report) do
+ {
+ "version": "1.2.1",
+ "profiles":
+ [{ "name": "tmp_compliance_profile",
+ "title": "/tmp Compliance Profile",
+ "summary": "An Example Compliance Profile",
+ "sha256": "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215ff",
+ "version": "0.1.1",
+ "maintainer": "Nathen Harvey <nharvey@chef.io>",
+ "license": "Apache 2.0 License",
+ "copyright": "Nathen Harvey <nharvey@chef.io>",
+ "supports": [],
+ "controls":
+ [{ "id": "tmp-2.0",
+ "title": "A bunch of directories must exist",
+ "desc": "A bunch of directories must exist for testing",
+ "impact": 0.3,
+ "refs": [],
+ "tags": {},
+ "code": "control 'tmp-2.0' do\n impact 0.3\n title 'A bunch of directories must exist'\n desc 'A bunch of directories must exist for testing'\n describe file '/tmp' do\n it { should be_directory }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 3 },
+ "results": [
+ { "status": "passed", "code_desc": "File /tmp should be directory", "run_time": 0.002312, "start_time": "2016-10-19 11:09:43 -0400" },
+ { "status": "passed", "code_desc": "File /etc should be directory", "run_time": 0.002314, "start_time": "2016-10-19 11:09:45 -0400" },
+ { "status": "passed", "code_desc": "File /opt should be directory", "run_time": 0.002315, "start_time": "2016-10-19 11:09:46 -0400" },
+ { "status": "skipped", "code_desc": "No-op", "run_time": 0.002316, "start_time": "2016-10-19 11:09:44 -0400", "skip_message": "4 testing" },
+ { "status": "skipped", "code_desc": "No-op", "run_time": 0.002317, "start_time": "2016-10-19 11:09:44 -0400", "skip_message": "4 testing" },
+ { "status": "skipped", "code_desc": "No-op", "run_time": 0.002318, "start_time": "2016-10-19 11:09:44 -0400", "skip_message": "4 testing" },
+ { "status": "failed", "code_desc": "File /etc/passwd should be directory", "run_time": 0.002313, "start_time": "2016-10-19 11:09:44 -0400" },
+ { "status": "failed", "code_desc": "File /etc/passwd should be directory", "run_time": 0.002313, "start_time": "2016-10-19 11:09:44 -0400" },
+ { "status": "failed", "code_desc": "File /etc/passwd should be directory", "run_time": 0.002313, "start_time": "2016-10-19 11:09:44 -0400" },
+ ],
+ },
+ { "id": "tmp-2.1",
+ "title": "/tmp directory is owned by the root user",
+ "desc": "The /tmp directory must be owned by the root user",
+ "impact": 0.3,
+ "refs": [{ "url": "https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf", "ref": "Compliance Whitepaper" }],
+ "tags": { "production": nil, "development": nil, "identifier": "value", "remediation": "https://github.com/chef-cookbooks/audit" },
+ "code": "control 'tmp-2.1' do\n impact 0.3\n title '/tmp directory is owned by the root user'\n desc 'The /tmp directory must be owned by the root user'\n tag 'production','development'\n tag identifier: 'value'\n tag remediation: 'https://github.com/chef-cookbooks/audit'\n ref 'Compliance Whitepaper', url: 'https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf'\n describe file '/tmp' do\n it { should be_owned_by 'root' }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 12 },
+ "results": [
+ { "status": "passed", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ { "status": "passed", "code_desc": 'File /etc should be owned by "root"', "run_time": 1.238845, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ },
+ ],
+ "groups": [{ "title": "/tmp Compliance Profile", "controls": ["tmp-1.0", "tmp-1.1"], "id": "controls/tmp.rb" }],
+ "attributes": [{ "name": "syslog_pkg", "options": { "default": "rsyslog", "description": "syslog package..." } }] }],
+ "other_checks": [],
+ "statistics": { "duration": 0.032332 },
+ }
+ end
+
+ it "truncates controls results 1" do
+ truncated_report = reporter.truncate_controls_results(report, 5)
+ expect(truncated_report[:profiles][0][:controls][0][:results].length).to eq(5)
+ statuses = truncated_report[:profiles][0][:controls][0][:results].map { |r| r[:status] }
+ expect(statuses).to eq(%w{failed failed failed skipped skipped})
+ expect(truncated_report[:profiles][0][:controls][0][:removed_results_counts]).to eq(failed: 0, skipped: 1, passed: 3)
+ end
+
+ it "truncates controls results 2" do
+ truncated_report = reporter.truncate_controls_results(report, 5)
+ expect(truncated_report[:profiles][0][:controls][1][:results].length).to eq(2)
+ statuses = truncated_report[:profiles][0][:controls][1][:results].map { |r| r[:status] }
+ expect(statuses).to eq(%w{passed passed})
+ expect(truncated_report[:profiles][0][:controls][1][:removed_results_counts]).to eq(nil)
+ end
+
+ it "truncates controls results 3" do
+ truncated_report = reporter.truncate_controls_results(report, 0)
+ expect(truncated_report[:profiles][0][:controls][0][:results].length).to eq(9)
+ end
+
+ it "truncates controls results 4" do
+ truncated_report = reporter.truncate_controls_results(report, 1)
+ expect(truncated_report[:profiles][0][:controls][0][:results].length).to eq(1)
+ end
+ end
+
+ describe "#strip_profiles_meta" do
+ it "removes the metadata from seen profiles" do
+ expected = {
+ other_checks: [],
+ profiles: [
+ {
+ attributes: [
+ {
+ name: "syslog_pkg",
+ options: {
+ default: "rsyslog",
+ description: "syslog package...",
+ },
+ },
+ ],
+ controls: [
+ {
+ id: "tmp-1.0",
+ results: [
+ {
+ code_desc: "File /tmp should be directory",
+ status: "passed",
+ },
+ ],
+ },
+ {
+ id: "tmp-1.1",
+ results: [
+ {
+ code_desc: 'File /tmp should be owned by "root"',
+ run_time: 1.228845,
+ start_time: "2016-10-19 11:09:43 -0400",
+ status: "passed",
+ },
+ {
+ code_desc: 'File /tmp should be owned by "root"',
+ run_time: 1.228845,
+ start_time: "2016-10-19 11:09:43 -0400",
+ status: "skipped",
+ },
+ {
+ code_desc: "File /etc/hosts is expected to be directory",
+ message: "expected `File /etc/hosts.directory?` to return true, got false",
+ run_time: 1.228845,
+ start_time: "2016-10-19 11:09:43 -0400",
+ status: "failed",
+ },
+ ],
+ },
+ ],
+ sha256: "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd",
+ title: "/tmp Compliance Profile",
+ version: "0.1.1",
+ },
+ ],
+ run_time_limit: 1.1,
+ statistics: {
+ duration: 0.032332,
+ },
+ version: "1.2.1",
+ }
+ expect(reporter.strip_profiles_meta(inspec_report, [], 1.1)).to eq(expected)
+ end
+
+ it "does not remove the metadata from missing profiles" do
+ expected = inspec_report.merge(run_time_limit: 1.1)
+ expect(reporter.strip_profiles_meta(inspec_report, ["7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd"], 1.1)).to eq(expected)
+ end
+ end
+end
diff --git a/spec/unit/compliance/reporter/chef_server_automate_spec.rb b/spec/unit/compliance/reporter/chef_server_automate_spec.rb
new file mode 100644
index 0000000000..e45a7157ee
--- /dev/null
+++ b/spec/unit/compliance/reporter/chef_server_automate_spec.rb
@@ -0,0 +1,177 @@
+require "spec_helper"
+
+describe Chef::Compliance::Reporter::ChefServerAutomate do
+ before do
+ WebMock.disable_net_connect!
+
+ Chef::Config[:client_key] = File.expand_path("../../../data/ssl/private_key.pem", __dir__)
+ Chef::Config[:node_name] = "spec-node"
+ end
+
+ let(:reporter) { Chef::Compliance::Reporter::ChefServerAutomate.new(opts) }
+
+ let(:opts) do
+ {
+ entity_uuid: "aaaaaaaa-709a-475d-bef5-zzzzzzzzzzzz",
+ run_id: "3f0536f7-3361-4bca-ae53-b45118dceb5d",
+ node_info: {
+ node: "chef-client.solo",
+ environment: "My Prod Env",
+ roles: %w{base_linux apache_linux},
+ recipes: ["some_cookbook::some_recipe", "some_cookbook"],
+ policy_name: "test_policy_name",
+ policy_group: "test_policy_group",
+ chef_tags: ["mylinux", "my.tag", "some=tag"],
+ organization_name: "test_org",
+ source_fqdn: "api.chef.io",
+ ipaddress: "192.168.56.33",
+ fqdn: "lb1.prod.example.com",
+ },
+ url: "https://chef.server/data_collector",
+ control_results_limit: 2,
+ timestamp: Time.parse("2016-07-19T19:19:19+01:00"),
+ }
+ end
+
+ let(:inspec_report) do
+ {
+ "version": "1.2.1",
+ "profiles":
+ [{ "name": "tmp_compliance_profile",
+ "title": "/tmp Compliance Profile",
+ "summary": "An Example Compliance Profile",
+ "sha256": "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd",
+ "version": "0.1.1",
+ "maintainer": "Nathen Harvey <nharvey@chef.io>",
+ "license": "Apache 2.0 License",
+ "copyright": "Nathen Harvey <nharvey@chef.io>",
+ "supports": [],
+ "controls":
+ [{ "title": "A /tmp directory must exist",
+ "desc": "A /tmp directory must exist",
+ "impact": 0.3,
+ "refs": [],
+ "tags": {},
+ "code": "control 'tmp-1.0' do\n impact 0.3\n title 'A /tmp directory must exist'\n desc 'A /tmp directory must exist'\n describe file '/tmp' do\n it { should be_directory }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 3 },
+ "id": "tmp-1.0",
+ "results": [
+ { "status": "passed", "code_desc": "File /tmp should be directory", "run_time": 0.002312, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ },
+ { "title": "/tmp directory is owned by the root user",
+ "desc": "The /tmp directory must be owned by the root user",
+ "impact": 0.3,
+ "refs": [{ "url": "https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf", "ref": "Compliance Whitepaper" }],
+ "tags": { "production": nil, "development": nil, "identifier": "value", "remediation": "https://github.com/chef-cookbooks/audit" },
+ "code": "control 'tmp-1.1' do\n impact 0.3\n title '/tmp directory is owned by the root user'\n desc 'The /tmp directory must be owned by the root user'\n tag 'production','development'\n tag identifier: 'value'\n tag remediation: 'https://github.com/chef-cookbooks/audit'\n ref 'Compliance Whitepaper', url: 'https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf'\n describe file '/tmp' do\n it { should be_owned_by 'root' }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 12 },
+ "id": "tmp-1.1",
+ "results": [
+ { "status": "passed", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ { "status": "skipped", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ { "status": "failed", "code_desc": "File /etc/hosts is expected to be directory", "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400", "message": "expected `File /etc/hosts.directory?` to return true, got false" },
+ ],
+ },
+ ],
+ "groups": [{ "title": "/tmp Compliance Profile", "controls": ["tmp-1.0", "tmp-1.1"], "id": "controls/tmp.rb" }],
+ "attributes": [{ "name": "syslog_pkg", "options": { "default": "rsyslog", "description": "syslog package..." } }] }],
+ "other_checks": [],
+ "statistics": { "duration": 0.032332 },
+ }
+ end
+
+ let(:enriched_report) do
+ {
+ "version": "1.2.1",
+ "profiles": [
+ {
+ "name": "tmp_compliance_profile",
+ "title": "/tmp Compliance Profile",
+ "summary": "An Example Compliance Profile",
+ "sha256": "7bd598e369970002fc6f2d16d5b988027d58b044ac3fa30ae5fc1b8492e215cd",
+ "version": "0.1.1",
+ "maintainer": "Nathen Harvey <nharvey@chef.io>",
+ "license": "Apache 2.0 License",
+ "copyright": "Nathen Harvey <nharvey@chef.io>",
+ "supports": [],
+ "controls": [
+ {
+ "title": "A /tmp directory must exist",
+ "desc": "A /tmp directory must exist",
+ "impact": 0.3,
+ "refs": [],
+ "tags": {},
+ "code":
+ "control 'tmp-1.0' do\n impact 0.3\n title 'A /tmp directory must exist'\n desc 'A /tmp directory must exist'\n describe file '/tmp' do\n it { should be_directory }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 3 },
+ "id": "tmp-1.0",
+ "results": [{ "status": "passed", "code_desc": "File /tmp should be directory", "run_time": 0.002312, "start_time": "2016-10-19 11:09:43 -0400" }],
+ },
+ {
+ "title": "/tmp directory is owned by the root user",
+ "desc": "The /tmp directory must be owned by the root user",
+ "impact": 0.3,
+ "refs": [{ "url": "https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf", "ref": "Compliance Whitepaper" }],
+ "tags": { "production": nil, "development": nil, "identifier": "value", "remediation": "https://github.com/chef-cookbooks/audit" },
+ "code": "control 'tmp-1.1' do\n impact 0.3\n title '/tmp directory is owned by the root user'\n desc 'The /tmp directory must be owned by the root user'\n tag 'production','development'\n tag identifier: 'value'\n tag remediation: 'https://github.com/chef-cookbooks/audit'\n ref 'Compliance Whitepaper', url: 'https://pages.chef.io/rs/255-VFB-268/images/compliance-at-velocity2015.pdf'\n describe file '/tmp' do\n it { should be_owned_by 'root' }\n end\nend\n",
+ "source_location": { "ref": "/Users/vjeffrey/code/delivery/insights/data_generator/chef-client/cache/cookbooks/test-cookbook/recipes/../files/default/compliance_profiles/tmp_compliance_profile/controls/tmp.rb", "line": 12 },
+ "id": "tmp-1.1",
+ "results": [
+ { "status": "failed", "code_desc": "File /etc/hosts is expected to be directory", "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400", "message": "expected `File /etc/hosts.directory?` to return true, got false" },
+ { "status": "skipped", "code_desc": 'File /tmp should be owned by "root"', "run_time": 1.228845, "start_time": "2016-10-19 11:09:43 -0400" },
+ ],
+ "removed_results_counts": { "failed": 0, "skipped": 0, "passed": 1 },
+ },
+ ],
+ "groups": [{ "title": "/tmp Compliance Profile", "controls": ["tmp-1.0", "tmp-1.1"], "id": "controls/tmp.rb" }],
+ "attributes": [{ "name": "syslog_pkg", "options": { "default": "rsyslog", "description": "syslog package..." } }],
+ },
+ ],
+ "other_checks": [],
+ "statistics": { "duration": 0.032332 },
+ "type": "inspec_report",
+ "node_name": "chef-client.solo",
+ "end_time": "2016-07-19T18:19:19Z",
+ "node_uuid": "aaaaaaaa-709a-475d-bef5-zzzzzzzzzzzz",
+ "environment": "My Prod Env",
+ "roles": %w{base_linux apache_linux},
+ "recipes": ["some_cookbook::some_recipe", "some_cookbook"],
+ "report_uuid": "3f0536f7-3361-4bca-ae53-b45118dceb5d",
+ "source_fqdn": "api.chef.io",
+ "organization_name": "test_org",
+ "policy_group": "test_policy_group",
+ "policy_name": "test_policy_name",
+ "chef_tags": ["mylinux", "my.tag", "some=tag"],
+ "ipaddress": "192.168.56.33",
+ "fqdn": "lb1.prod.example.com",
+ }
+ end
+
+ it "sends report successfully" do
+ # TODO: Had to change 'X-Ops-Server-Api-Version' from 1 to 2, is that correct?
+ report_stub = stub_request(:post, "https://chef.server/data_collector")
+ .with(
+ body: enriched_report,
+ headers: {
+ "X-Chef-Version" => Chef::VERSION,
+ "X-Ops-Authorization-1" => /.+/,
+ "X-Ops-Authorization-2" => /.+/,
+ "X-Ops-Authorization-3" => /.+/,
+ "X-Ops-Authorization-4" => /.+/,
+ "X-Ops-Authorization-5" => /.+/,
+ "X-Ops-Authorization-6" => /.+/,
+ "X-Ops-Content-Hash" => "yfck5nQDcRWta06u45Q+J463LYY=",
+ "X-Ops-Server-Api-Version" => "2",
+ "X-Ops-Sign" => "algorithm=sha1;version=1.1;",
+ "X-Ops-Timestamp" => /.+/,
+ "X-Ops-Userid" => "spec-node",
+ "X-Remote-Request-Id" => /.+/,
+ }
+ ).to_return(status: 200)
+
+ expect(reporter.send_report(inspec_report)).to eq(true)
+
+ expect(report_stub).to have_been_requested
+ end
+end
diff --git a/spec/unit/compliance/reporter/compliance_enforcer_spec.rb b/spec/unit/compliance/reporter/compliance_enforcer_spec.rb
new file mode 100644
index 0000000000..ae63cf0853
--- /dev/null
+++ b/spec/unit/compliance/reporter/compliance_enforcer_spec.rb
@@ -0,0 +1,48 @@
+require "spec_helper"
+
+describe Chef::Compliance::Reporter::AuditEnforcer do
+ let(:reporter) { Chef::Compliance::Reporter::AuditEnforcer.new }
+
+ it "does not raise error for a successful InSpec report" do
+ report = {
+ "profiles": [
+ {
+ "controls": [
+ { "id": "c1", "results": [{ "status": "passed" }] },
+ { "id": "c2", "results": [{ "status": "passed" }] },
+ ],
+ },
+ ],
+ }
+
+ expect(reporter.send_report(report)).to eq(true)
+ end
+
+ it "does not raise error for an InSpec report with no controls" do
+ report = { "profiles": [{ "name": "empty" }] }
+
+ expect(reporter.send_report(report)).to eq(true)
+ end
+
+ it "does not raise error for an InSpec report with controls but no results" do
+ report = { "profiles": [{ "controls": [{ "id": "empty" }] }] }
+ expect(reporter.send_report(report)).to eq(true)
+ end
+
+ it "raises an error for a failed InSpec report" do
+ report = {
+ "profiles": [
+ {
+ "controls": [
+ { "id": "c1", "results": [{ "status": "passed" }] },
+ { "id": "c2", "results": [{ "status": "failed" }] },
+ ],
+ },
+ ],
+ }
+
+ expect {
+ reporter.send_report(report)
+ }.to raise_error(Chef::Compliance::Reporter::AuditEnforcer::ControlFailure, "Audit c2 has failed. Aborting chef-client run.")
+ end
+end
diff --git a/spec/unit/compliance/runner_spec.rb b/spec/unit/compliance/runner_spec.rb
new file mode 100644
index 0000000000..d4d2ba563f
--- /dev/null
+++ b/spec/unit/compliance/runner_spec.rb
@@ -0,0 +1,168 @@
+require "spec_helper"
+
+describe Chef::Compliance::Runner do
+ let(:logger) { double(:logger).as_null_object }
+ let(:node) { Chef::Node.new(logger: logger) }
+
+ let(:runner) do
+ described_class.new.tap do |r|
+ r.node = node
+ r.run_id = "my_run_id"
+ r.recipes = []
+ end
+ end
+
+ describe "#enabled?" do
+ it "is true if the node attributes have audit profiles and the audit cookbook is not present" do
+ node.normal["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
+ runner.recipes = %w{ fancy_cookbook::fanciness tacobell::nachos }
+
+ expect(runner).to be_enabled
+ end
+
+ it "is false if the node attributes have audit profiles and the audit cookbook is present" do
+ node.normal["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
+ runner.recipes = %w{ audit::default fancy_cookbook::fanciness tacobell::nachos }
+
+ expect(runner).not_to be_enabled
+ end
+
+ it "is false if the node attributes do not have audit profiles and the audit cookbook is not present" do
+ node.normal["audit"]["profiles"] = {}
+ runner.recipes = %w{ fancy_cookbook::fanciness tacobell::nachos }
+
+ expect(runner).not_to be_enabled
+ end
+
+ it "is false if the node attributes do not have audit profiles and the audit cookbook is present" do
+ node.normal["audit"]["profiles"] = {}
+ runner.recipes = %w{ audit::default fancy_cookbook::fanciness tacobell::nachos }
+
+ expect(runner).not_to be_enabled
+ end
+
+ it "is false if the node attributes do not have audit attributes and the audit cookbook is not present" do
+ runner.recipes = %w{ fancy_cookbook::fanciness tacobell::nachos }
+ expect(runner).not_to be_enabled
+ end
+ end
+
+ describe "#inspec_profiles" do
+ it "returns an empty list with no profiles defined" do
+ expect(runner.inspec_profiles).to eq([])
+ end
+
+ it "converts from the attribute format to the format Inspec expects" do
+ node.normal["audit"]["profiles"]["linux-baseline"] = {
+ 'compliance': "user/linux-baseline",
+ 'version': "2.1.0",
+ }
+
+ node.normal["audit"]["profiles"]["ssh"] = {
+ 'supermarket': "hardening/ssh-hardening",
+ }
+
+ expected = [
+ {
+ compliance: "user/linux-baseline",
+ name: "linux-baseline",
+ version: "2.1.0",
+ },
+ {
+ name: "ssh",
+ supermarket: "hardening/ssh-hardening",
+ },
+ ]
+
+ expect(runner.inspec_profiles).to eq(expected)
+ end
+
+ it "raises an error when the profiles are in the old audit-cookbook format" do
+ node.normal["audit"]["profiles"] = [
+ {
+ name: "Windows 2019 Baseline",
+ compliance: "admin/windows-2019-baseline",
+ },
+ ]
+
+ expect { runner.inspec_profiles }.to raise_error(/profiles specified in an unrecognized format, expected a hash of hashes./)
+ end
+ end
+
+ describe "#warn_for_deprecated_config_values!" do
+ it "logs a warning when deprecated config values are present" do
+ node.normal["audit"]["owner"] = "my_org"
+ node.normal["audit"]["inspec_version"] = "90210"
+
+ expect(logger).to receive(:warn).with(/config values 'inspec_version', 'owner' are not supported/)
+
+ runner.warn_for_deprecated_config_values!
+ end
+
+ it "does not log a warning with no deprecated config values" do
+ node.normal["audit"]["profiles"]["linux-baseline"] = {
+ 'compliance': "user/linux-baseline",
+ 'version': "2.1.0",
+ }
+
+ expect(logger).not_to receive(:warn)
+
+ runner.warn_for_deprecated_config_values!
+ end
+ end
+
+ describe "#reporter" do
+ context "chef-server-automate reporter" do
+ it "uses the correct URL when 'server' attribute is set" do
+ Chef::Config[:chef_server_url] = "https://chef_config_url.example.com/my_org"
+ node.normal["audit"]["server"] = "https://server_attribute_url.example.com/application/sub_application"
+
+ reporter = runner.reporter("chef-server-automate")
+
+ expect(reporter).to be_kind_of(Chef::Compliance::Reporter::ChefServerAutomate)
+ expect(reporter.url).to eq(URI("https://server_attribute_url.example.com/application/sub_application/organizations/my_org/data-collector"))
+ end
+
+ it "falls back to chef_server_url for URL when 'server' attribute is not set" do
+ Chef::Config[:chef_server_url] = "https://chef_config_url.example.com/my_org"
+
+ reporter = runner.reporter("chef-server-automate")
+
+ expect(reporter).to be_kind_of(Chef::Compliance::Reporter::ChefServerAutomate)
+ expect(reporter.url).to eq(URI("https://chef_config_url.example.com/organizations/my_org/data-collector"))
+ end
+ end
+
+ it "fails with unexpected reporter value" do
+ expect { runner.reporter("tacos") }.to raise_error(/'tacos' is not a supported reporter for Compliance Phase/)
+ end
+ end
+
+ describe "#inspec_opts" do
+ it "does not include chef_node in inputs by default" do
+ node.normal["audit"]["attributes"] = {
+ "tacos" => "lunch",
+ "nachos" => "dinner",
+ }
+
+ inputs = runner.inspec_opts[:inputs]
+
+ expect(inputs["tacos"]).to eq("lunch")
+ expect(inputs.key?("chef_node")).to eq(false)
+ end
+
+ it "includes chef_node in inputs with chef_node_attribute_enabled set" do
+ node.normal["audit"]["chef_node_attribute_enabled"] = true
+ node.normal["audit"]["attributes"] = {
+ "tacos" => "lunch",
+ "nachos" => "dinner",
+ }
+
+ inputs = runner.inspec_opts[:inputs]
+
+ expect(inputs["tacos"]).to eq("lunch")
+ expect(inputs["chef_node"]["audit"]["reporter"]).to eq("json-file")
+ expect(inputs["chef_node"]["chef_environment"]).to eq("_default")
+ end
+ end
+end
diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb
index a1d312836b..8df5c1d73f 100644
--- a/spec/unit/cookbook/synchronizer_spec.rb
+++ b/spec/unit/cookbook/synchronizer_spec.rb
@@ -1,7 +1,7 @@
require "spec_helper"
require "chef/cookbook/synchronizer"
require "chef/cookbook_version"
-require "chef/dist"
+require "chef-utils/dist"
describe Chef::CookbookCacheCleaner do
describe "when cleaning up unused cookbook components" do
@@ -50,7 +50,7 @@ describe Chef::CookbookCacheCleaner do
cleaner.cleanup_file_cache
end
- it "does not remove anything on #{Chef::Dist::SOLOEXEC}" do
+ it "does not remove anything on #{ChefUtils::Dist::Solo::EXEC}" do
Chef::Config[:solo_legacy_mode] = true
allow(cleaner.cache).to receive(:find).and_return(%w{cookbooks/valid1/recipes/default.rb cookbooks/valid2/recipes/default.rb})
expect(cleaner.cache).not_to receive(:delete)
diff --git a/spec/unit/cookbook_spec.rb b/spec/unit/cookbook_spec.rb
index 85c31ab42b..04b729c127 100644
--- a/spec/unit/cookbook_spec.rb
+++ b/spec/unit/cookbook_spec.rb
@@ -19,10 +19,10 @@
require "spec_helper"
describe Chef::CookbookVersion do
- COOKBOOK_PATH = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks", "openldap"))
+ COOKBOOK_PATH = File.expand_path(File.join(__dir__, "..", "data", "cookbooks", "openldap"))
before(:each) do
- @cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks"))
+ @cookbook_repo = File.expand_path(File.join(__dir__, "..", "data", "cookbooks"))
cl = Chef::CookbookLoader.new(@cookbook_repo)
cl.load_cookbooks
@cookbook_collection = Chef::CookbookCollection.new(cl)
diff --git a/spec/unit/data_collector/config_validation_spec.rb b/spec/unit/data_collector/config_validation_spec.rb
new file mode 100644
index 0000000000..239ef4b249
--- /dev/null
+++ b/spec/unit/data_collector/config_validation_spec.rb
@@ -0,0 +1,208 @@
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+require "chef/data_collector/config_validation"
+
+describe Chef::DataCollector::ConfigValidation do
+ describe "#should_be_enabled?" do
+ shared_examples_for "a solo-like run" do
+ it "is disabled in solo-legacy without a data_collector url and token" do
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is disabled in solo-legacy with only a url" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is disabled in solo-legacy with only a token" do
+ Chef::Config[:data_collector][:token] = "admit_one"
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is enabled in solo-legacy with both a token and url" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ Chef::Config[:data_collector][:token] = "no_cash_value"
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is enabled in solo-legacy with only an output location to a file" do
+ Chef::Config[:data_collector][:output_locations] = { files: [ "/always/be/counting/down" ] }
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is disabled in solo-legacy with only an output location to a uri" do
+ Chef::Config[:data_collector][:output_locations] = { urls: [ "https://esa.local/ariane5" ] }
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is enabled in solo-legacy with only an output location to a uri with a token" do
+ Chef::Config[:data_collector][:output_locations] = { urls: [ "https://esa.local/ariane5" ] }
+ Chef::Config[:data_collector][:token] = "good_for_one_fare"
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is enabled in solo-legacy when the mode is :solo" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ Chef::Config[:data_collector][:token] = "non_redeemable"
+ Chef::Config[:data_collector][:mode] = :solo
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is enabled in solo-legacy when the mode is :both" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ Chef::Config[:data_collector][:token] = "non_negotiable"
+ Chef::Config[:data_collector][:mode] = :both
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is disabled in solo-legacy when the mode is :client" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ Chef::Config[:data_collector][:token] = "NYCTA"
+ Chef::Config[:data_collector][:mode] = :client
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is disabled in solo-legacy mode when the mode is :nonsense" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ Chef::Config[:data_collector][:token] = "MTA"
+ Chef::Config[:data_collector][:mode] = :nonsense
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+ end
+
+ it "by default it is enabled" do
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is disabled in why-run" do
+ Chef::Config[:why_run] = true
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ describe "a solo legacy run" do
+ before(:each) do
+ Chef::Config[:solo_legacy_mode] = true
+ end
+
+ it_behaves_like "a solo-like run"
+ end
+
+ describe "a local mode run" do
+ before(:each) do
+ Chef::Config[:local_mode] = true
+ end
+
+ it_behaves_like "a solo-like run"
+ end
+
+ it "is enabled in client mode when the mode is :both" do
+ Chef::Config[:data_collector][:mode] = :both
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+
+ it "is disabled in client mode when the mode is :solo" do
+ Chef::Config[:data_collector][:mode] = :solo
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is disabled in client mode when the mode is :nonsense" do
+ Chef::Config[:data_collector][:mode] = :nonsense
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
+ end
+
+ it "is still enabled if you set a token in client mode" do
+ Chef::Config[:data_collector][:token] = "good_for_one_ride"
+ expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
+ end
+ end
+
+ describe "validate_server_url!" do
+ it "with valid server url" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ expect(Chef::DataCollector::ConfigValidation.validate_server_url!).to be_nil
+ end
+
+ it "with invalid server URL" do
+ Chef::Config[:data_collector][:server_url] = "not valid URL"
+ expect { Chef::DataCollector::ConfigValidation.validate_server_url! }.to raise_error(Chef::Exceptions::ConfigurationError,
+ "Chef::Config[:data_collector][:server_url] (not valid URL) is not a valid URI.")
+ end
+
+ it "with invalid server URL without host" do
+ Chef::Config[:data_collector][:server_url] = "no-host"
+ expect { Chef::DataCollector::ConfigValidation.validate_server_url! }.to raise_error(Chef::Exceptions::ConfigurationError,
+ "Chef::Config[:data_collector][:server_url] (no-host) is a URI with no host. Please supply a valid URL.")
+ end
+
+ it "skip validation if output_locations is set" do
+ Chef::Config[:data_collector][:output_locations] = { files: ["https://www.esa.local/ariane5"] }
+ expect(Chef::DataCollector::ConfigValidation.validate_server_url!).to be_nil
+ end
+
+ it "skip validation if output_locations & server_url both are set" do
+ Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
+ Chef::Config[:data_collector][:output_locations] = { files: ["https://www.esa.local/ariane5"] }
+ expect(Chef::DataCollector::ConfigValidation.validate_server_url!).to be_nil
+ end
+ end
+
+ describe "validate_output_locations!" do
+ it "with nil or not set skip validation" do
+ Chef::Config[:data_collector][:output_locations] = nil
+ expect(Chef::DataCollector::ConfigValidation.validate_output_locations!).to be_nil
+ end
+
+ it "with empty value raise validation error" do
+ Chef::Config[:data_collector][:output_locations] = {}
+ expect { Chef::DataCollector::ConfigValidation.validate_output_locations! }.to raise_error(Chef::Exceptions::ConfigurationError,
+ "Chef::Config[:data_collector][:output_locations] is empty. Please supply an hash of valid URLs and / or local file paths.")
+ end
+
+ it "with valid URLs options" do
+ Chef::Config[:data_collector][:output_locations] = { urls: ["https://www.esa.local/ariane5/data-collector"] }
+ expect { Chef::DataCollector::ConfigValidation.validate_output_locations! }.not_to raise_error
+ end
+
+ context "output_locations contains files" do
+ let(:file_path) { "/tmp/client-runs.txt" }
+
+ before(:each) do
+ allow(File).to receive(:exist?).with(file_path).and_return(true)
+ allow(File).to receive(:readable?).with(file_path).and_return(true)
+ allow(File).to receive(:writable?).with(file_path).and_return(true)
+ allow(File).to receive(:expand_path).with(file_path).and_return(file_path)
+ end
+
+ it "with valid files options" do
+ Chef::Config[:data_collector][:output_locations] = { files: [file_path] }
+ expect { Chef::DataCollector::ConfigValidation.validate_output_locations! }.not_to raise_error
+ end
+
+ it "with valid files & URLs options" do
+ Chef::Config[:data_collector][:output_locations] = { urls: ["https://www.esa.local/ariane5/data-collector"], files: [file_path] }
+ expect { Chef::DataCollector::ConfigValidation.validate_output_locations! }.not_to raise_error
+ end
+
+ it "with valid files options & String location value" do
+ Chef::Config[:data_collector][:output_locations] = { files: file_path }
+ expect { Chef::DataCollector::ConfigValidation.validate_output_locations! }.not_to raise_error
+ end
+ end
+ end
+end
diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb
index bcce058d81..63531663ee 100644
--- a/spec/unit/data_collector_spec.rb
+++ b/spec/unit/data_collector_spec.rb
@@ -26,10 +26,6 @@ require "socket"
# actually running -- another testing requirement similar to the integration testing framework in cheffish as well)
#
describe Chef::DataCollector do
- before(:each) do
- Chef::Config[:enable_reporting] = true
- end
-
let(:node) { Chef::Node.new }
let(:rest_client) { double("Chef::ServerAPI (mock)") }
@@ -296,119 +292,6 @@ describe Chef::DataCollector do
end
end
- describe "#should_be_enabled?" do
- shared_examples_for "a solo-like run" do
- it "is disabled in solo-legacy without a data_collector url and token" do
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is disabled in solo-legacy with only a url" do
- Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is disabled in solo-legacy with only a token" do
- Chef::Config[:data_collector][:token] = "admit_one"
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is enabled in solo-legacy with both a token and url" do
- Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
- Chef::Config[:data_collector][:token] = "no_cash_value"
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is enabled in solo-legacy with only an output location to a file" do
- Chef::Config[:data_collector][:output_locations] = { files: [ "/always/be/counting/down" ] }
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is disabled in solo-legacy with only an output location to a uri" do
- Chef::Config[:data_collector][:output_locations] = { urls: [ "https://esa.local/ariane5" ] }
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is enabled in solo-legacy with only an output location to a uri with a token" do
- Chef::Config[:data_collector][:output_locations] = { urls: [ "https://esa.local/ariane5" ] }
- Chef::Config[:data_collector][:token] = "good_for_one_fare"
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is enabled in solo-legacy when the mode is :solo" do
- Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
- Chef::Config[:data_collector][:token] = "non_redeemable"
- Chef::Config[:data_collector][:mode] = :solo
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is enabled in solo-legacy when the mode is :both" do
- Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
- Chef::Config[:data_collector][:token] = "non_negotiable"
- Chef::Config[:data_collector][:mode] = :both
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is disabled in solo-legacy when the mode is :client" do
- Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
- Chef::Config[:data_collector][:token] = "NYCTA"
- Chef::Config[:data_collector][:mode] = :client
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is disabled in solo-legacy mode when the mode is :nonsense" do
- Chef::Config[:data_collector][:server_url] = "https://www.esa.local/ariane5"
- Chef::Config[:data_collector][:token] = "MTA"
- Chef::Config[:data_collector][:mode] = :nonsense
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
- end
-
- it "by default it is enabled" do
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is disabled in why-run" do
- Chef::Config[:why_run] = true
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- describe "a solo legacy run" do
- before(:each) do
- Chef::Config[:solo_legacy_mode] = true
- end
-
- it_behaves_like "a solo-like run"
- end
-
- describe "a local mode run" do
- before(:each) do
- Chef::Config[:local_mode] = true
- end
-
- it_behaves_like "a solo-like run"
- end
-
- it "is enabled in client mode when the mode is :both" do
- Chef::Config[:data_collector][:mode] = :both
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
-
- it "is disabled in client mode when the mode is :solo" do
- Chef::Config[:data_collector][:mode] = :solo
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is disabled in client mode when the mode is :nonsense" do
- Chef::Config[:data_collector][:mode] = :nonsense
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be false
- end
-
- it "is still enabled if you set a token in client mode" do
- Chef::Config[:data_collector][:token] = "good_for_one_ride"
- expect(Chef::DataCollector::ConfigValidation.should_be_enabled?).to be true
- end
- end
-
describe "when the run fails during node load" do
let(:exception) { Exception.new("imperial to metric conversion error") }
let(:error_description) { Chef::Formatters::ErrorMapper.registration_failed(node_name, exception, Chef::Config).for_json }
diff --git a/spec/unit/dsl/declare_resource_spec.rb b/spec/unit/dsl/declare_resource_spec.rb
index 4fcdd4d048..53b0713c42 100644
--- a/spec/unit/dsl/declare_resource_spec.rb
+++ b/spec/unit/dsl/declare_resource_spec.rb
@@ -19,7 +19,7 @@ require "spec_helper"
describe Chef::ResourceCollection do
let(:run_context) do
- cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "data", "cookbooks"))
+ cookbook_repo = File.expand_path(File.join(__dir__, "..", "..", "data", "cookbooks"))
cookbook_loader = Chef::CookbookLoader.new(cookbook_repo)
cookbook_loader.load_cookbooks
node = Chef::Node.new
diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb
index 18983e6ff5..dfa0bcf673 100644
--- a/spec/unit/file_access_control_spec.rb
+++ b/spec/unit/file_access_control_spec.rb
@@ -26,7 +26,7 @@ describe Chef::FileAccessControl do
# we have to re-load the file so the proper
# platform specific module is mixed in
@node = Chef::Node.new
- load File.join(File.dirname(__FILE__), "..", "..", "lib", "chef", "file_access_control.rb")
+ load File.join(__dir__, "..", "..", "lib", "chef", "file_access_control.rb")
@resource = Chef::Resource::File.new("/tmp/a_file.txt")
@resource.owner("toor")
@resource.group("wheel")
diff --git a/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
index 0d6289a999..0760bcee1d 100644
--- a/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
+++ b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
@@ -93,8 +93,8 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do
end
describe "script command opts switch" do
- let(:command_opts) { {} }
- let(:guard_interpreter) { Chef::GuardInterpreter::ResourceGuardInterpreter.new(parent_resource, "exit 0", command_opts) }
+ let(:guard_interpreter) { Chef::GuardInterpreter::ResourceGuardInterpreter.new(parent_resource, "exit 0", {}) }
+ let(:resource) { guard_interpreter.instance_variable_get("@resource") }
context "resource is a Script" do
context "and guard_interpreter is a :script" do
@@ -117,9 +117,9 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do
end
end
- it "merges to :code" do
- expect(command_opts).to receive(:merge).with({ code: "exit 0" }).and_call_original
- expect(guard_interpreter.evaluate).to eq(true)
+ it "assigns the comand to the resource's code property" do
+ guard_interpreter.evaluate
+ expect(resource.code).to eq("exit 0")
end
end
@@ -130,9 +130,9 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do
parent_resource
end
- it "merges to :code" do
- expect(command_opts).to receive(:merge).with({ command: "exit 0" }).and_call_original
- expect(guard_interpreter.evaluate).to eq(true)
+ it "assigns the comand to the resource's command property" do
+ guard_interpreter.evaluate
+ expect(resource.command).to eq("exit 0")
end
end
end
@@ -144,9 +144,9 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do
parent_resource
end
- it "merges to :command" do
- expect(command_opts).to receive(:merge).with({ command: "exit 0" }).and_call_original
- expect(guard_interpreter.evaluate).to eq(true)
+ it "assigns the comand to the resource's command property" do
+ guard_interpreter.evaluate
+ expect(resource.command).to eq("exit 0")
end
end
diff --git a/spec/unit/http/ssl_policies_spec.rb b/spec/unit/http/ssl_policies_spec.rb
index 73ee2790e3..6fc00b5fd9 100644
--- a/spec/unit/http/ssl_policies_spec.rb
+++ b/spec/unit/http/ssl_policies_spec.rb
@@ -26,83 +26,86 @@ describe "HTTP SSL Policy" do
Chef::Config[:ssl_client_key] = nil
Chef::Config[:ssl_ca_path] = nil
Chef::Config[:ssl_ca_file] = nil
+ ENV["SSL_CERT_FILE"] = nil
end
- let(:unconfigured_http_client) { Net::HTTP.new("example.com", 443) }
let(:http_client) do
- unconfigured_http_client.use_ssl = true
- ssl_policy.apply
- unconfigured_http_client
+ ssl_policy_class.apply_to(Net::HTTP.new("example.com"))
end
describe Chef::HTTP::DefaultSSLPolicy do
- let(:ssl_policy) { Chef::HTTP::DefaultSSLPolicy.new(unconfigured_http_client) }
+ let(:ssl_policy_class) { Chef::HTTP::DefaultSSLPolicy }
- describe "when configured with :ssl_verify_mode set to :verify peer" do
- before do
- Chef::Config[:ssl_verify_mode] = :verify_peer
- end
-
- it "configures the HTTP client to use SSL when given a URL with the https protocol" do
- expect(http_client.use_ssl?).to be_truthy
- end
+ it "raises a ConfigurationError if :ssl_ca_path is set to a path that doesn't exist" do
+ Chef::Config[:ssl_ca_path] = "/dev/null/nothing_here"
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
+ end
- it "sets the OpenSSL verify mode to verify_peer" do
- expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
- end
+ it "should set the CA path if that is set in the configuration" do
+ Chef::Config[:ssl_ca_path] = File.join(CHEF_SPEC_DATA, "ssl")
+ expect(http_client.ca_path).to eq(File.join(CHEF_SPEC_DATA, "ssl"))
+ end
- it "raises a ConfigurationError if :ssl_ca_path is set to a path that doesn't exist" do
- Chef::Config[:ssl_ca_path] = "/dev/null/nothing_here"
- expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
- end
+ it "raises a ConfigurationError if :ssl_ca_file is set to a file that does not exist" do
+ Chef::Config[:ssl_ca_file] = "/dev/null/nothing_here"
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
+ end
- it "should set the CA path if that is set in the configuration" do
- Chef::Config[:ssl_ca_path] = File.join(CHEF_SPEC_DATA, "ssl")
- expect(http_client.ca_path).to eq(File.join(CHEF_SPEC_DATA, "ssl"))
- end
+ it "should set the CA file if that is set in the configuration" do
+ Chef::Config[:ssl_ca_file] = CHEF_SPEC_DATA + "/ssl/5e707473.0"
+ expect(http_client.ca_file).to eq(CHEF_SPEC_DATA + "/ssl/5e707473.0")
+ end
- it "raises a ConfigurationError if :ssl_ca_file is set to a file that does not exist" do
- Chef::Config[:ssl_ca_file] = "/dev/null/nothing_here"
- expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
- end
+ it "should set the custom CA file if SSL_CERT_FILE environment variable is set" do
+ ENV["SSL_CERT_FILE"] = CHEF_SPEC_DATA + "/trusted_certs/intermediate.pem"
+ expect(http_client.ca_file).to eq(CHEF_SPEC_DATA + "/trusted_certs/intermediate.pem")
+ end
- it "should set the CA file if that is set in the configuration" do
- Chef::Config[:ssl_ca_file] = CHEF_SPEC_DATA + "/ssl/5e707473.0"
- expect(http_client.ca_file).to eq(CHEF_SPEC_DATA + "/ssl/5e707473.0")
- end
+ it "raises a ConfigurationError if SSL_CERT_FILE environment variable is set to a file that does not exist" do
+ ENV["SSL_CERT_FILE"] = "/dev/null/nothing_here"
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
end
- describe "when configured with :ssl_verify_mode set to :verify peer" do
- before do
- @url = URI.parse("https://chef.example.com:4443/")
- Chef::Config[:ssl_verify_mode] = :verify_none
- end
+ it "sets the OpenSSL verify mode to verify_peer when configured with :ssl_verify_mode set to :verify_peer" do
+ Chef::Config[:ssl_verify_mode] = :verify_peer
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
+ end
- it "sets the OpenSSL verify mode to :verify_none" do
- expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
- end
+ it "sets the OpenSSL verify mode to :verify_none when configured with :ssl_verify_mode set to :verify_none" do
+ Chef::Config[:ssl_verify_mode] = :verify_none
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
end
describe "when configured with a client certificate" do
- before { @url = URI.parse("https://chef.example.com:4443/") }
-
it "raises ConfigurationError if the certificate file doesn't exist" do
Chef::Config[:ssl_client_cert] = "/dev/null/nothing_here"
Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + "/ssl/chef-rspec.key"
- expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError, /ssl_client_cert .* does not exist/)
end
- it "raises ConfigurationError if the certificate file doesn't exist" do
+ it "raises ConfigurationError if the private key file doesn't exist" do
Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + "/ssl/chef-rspec.cert"
Chef::Config[:ssl_client_key] = "/dev/null/nothing_here"
- expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError, /ssl_client_key .* does not exist/)
end
it "raises a ConfigurationError if one of :ssl_client_cert and :ssl_client_key is set but not both" do
Chef::Config[:ssl_client_cert] = "/dev/null/nothing_here"
Chef::Config[:ssl_client_key] = nil
- expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError)
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError, /configure ssl_client_cert and ssl_client_key together/)
+ end
+
+ it "raises a ConfigurationError with a bad cert file" do
+ Chef::Config[:ssl_client_cert] = __FILE__
+ Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + "/ssl/chef-rspec.key"
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError, /Error reading cert file '#{__FILE__}'/)
+ end
+
+ it "raises a ConfigurationError with a bad key file" do
+ Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + "/ssl/chef-rspec.cert"
+ Chef::Config[:ssl_client_key] = __FILE__
+ expect { http_client }.to raise_error(Chef::Exceptions::ConfigurationError, /Error reading key file '#{__FILE__}'/)
end
it "configures the HTTP client's cert and private key" do
@@ -111,20 +114,31 @@ describe "HTTP SSL Policy" do
expect(http_client.cert.to_s).to eq(OpenSSL::X509::Certificate.new(IO.read(CHEF_SPEC_DATA + "/ssl/chef-rspec.cert")).to_s)
expect(http_client.key.to_s).to eq(OpenSSL::PKey::RSA.new(IO.read(CHEF_SPEC_DATA + "/ssl/chef-rspec.key")).to_s)
end
- end
- context "when additional certs are located in the trusted_certs dir" do
- let(:self_signed_crt_path) { File.join(CHEF_SPEC_DATA, "trusted_certs", "example.crt") }
- let(:self_signed_crt) { OpenSSL::X509::Certificate.new(File.read(self_signed_crt_path)) }
+ it "configures the HTTP client's cert and private key with a DER encoded cert" do
+ Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + "/ssl/binary/chef-rspec-der.cert"
+ Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + "/ssl/chef-rspec.key"
+ expect(http_client.cert.to_s).to eq(OpenSSL::X509::Certificate.new(IO.read(CHEF_SPEC_DATA + "/ssl/chef-rspec.cert")).to_s)
+ expect(http_client.key.to_s).to eq(OpenSSL::PKey::RSA.new(IO.read(CHEF_SPEC_DATA + "/ssl/chef-rspec.key")).to_s)
+ end
- let(:additional_pem_path) { File.join(CHEF_SPEC_DATA, "trusted_certs", "opscode.pem") }
- let(:additional_pem) { OpenSSL::X509::Certificate.new(File.read(additional_pem_path)) }
+ it "configures the HTTP client's cert and private key with a DER encoded key" do
+ Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + "/ssl/chef-rspec.cert"
+ Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + "/ssl/binary/chef-rspec-der.key"
+ expect(http_client.cert.to_s).to eq(OpenSSL::X509::Certificate.new(IO.read(CHEF_SPEC_DATA + "/ssl/chef-rspec.cert")).to_s)
+ expect(http_client.key.to_s).to eq(OpenSSL::PKey::RSA.new(IO.read(CHEF_SPEC_DATA + "/ssl/chef-rspec.key")).to_s)
+ end
+ end
+ context "when additional certs are located in the trusted_certs dir" do
before do
Chef::Config.trusted_certs_dir = File.join(CHEF_SPEC_DATA, "trusted_certs")
end
it "enables verification of self-signed certificates" do
+ path = File.join(CHEF_SPEC_DATA, "trusted_certs", "example.crt")
+ self_signed_crt = OpenSSL::X509::Certificate.new(File.binread(path))
+
expect(http_client.cert_store.verify(self_signed_crt)).to be_truthy
end
@@ -137,39 +151,64 @@ describe "HTTP SSL Policy" do
# If the machine running the test doesn't have ruby SSL configured correctly,
# then the root cert also has to be loaded for the test to succeed.
# The system under test **SHOULD** do both of these things.
+ path = File.join(CHEF_SPEC_DATA, "trusted_certs", "opscode.pem")
+ additional_pem = OpenSSL::X509::Certificate.new(File.binread(path))
+
expect(http_client.cert_store.verify(additional_pem)).to be_truthy
end
- context "and some certs are duplicates" do
- it "skips duplicate certs" do
- # For whatever reason, OpenSSL errors out when adding a
- # cert you already have to the certificate store.
- ssl_policy.set_custom_certs
- ssl_policy.set_custom_certs # should not raise an error
+ it "skips duplicate certs" do
+ # For whatever reason, OpenSSL errors out when adding a
+ # cert you already have to the certificate store.
+ ssl_policy = ssl_policy_class.new(Net::HTTP.new("example.com"))
+ ssl_policy.set_custom_certs
+ ssl_policy.set_custom_certs # should not raise an error
+ end
+
+ it "raises ConfigurationError with a bad cert file in the trusted_certs dir" do
+ ssl_policy = ssl_policy_class.new(Net::HTTP.new("example.com"))
+
+ Dir.mktmpdir do |dir|
+ bad_cert_file = File.join(dir, "bad_cert_file.crt")
+ File.write(bad_cert_file, File.read(__FILE__))
+
+ Chef::Config.trusted_certs_dir = dir
+ expect { ssl_policy.set_custom_certs }.to raise_error(Chef::Exceptions::ConfigurationError, /Error reading cert file/)
end
end
+
+ it "works with binary certs" do
+ Chef::Config.trusted_certs_dir = File.join(CHEF_SPEC_DATA, "ssl", "binary")
+
+ ssl_policy = ssl_policy_class.new(Net::HTTP.new("example.com"))
+ ssl_policy.set_custom_certs
+ end
end
end
describe Chef::HTTP::APISSLPolicy do
- let(:ssl_policy) { Chef::HTTP::APISSLPolicy.new(unconfigured_http_client) }
+ let(:ssl_policy_class) { Chef::HTTP::APISSLPolicy }
- context "when verify_api_cert is set" do
- before do
- Chef::Config[:verify_api_cert] = true
- end
+ it "sets the OpenSSL verify mode to verify_peer when configured with :ssl_verify_mode set to :verify_peer" do
+ Chef::Config[:ssl_verify_mode] = :verify_peer
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
+ end
- it "sets the OpenSSL verify mode to verify_peer" do
- expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
- end
+ it "sets the OpenSSL verify mode to :verify_none when configured with :ssl_verify_mode set to :verify_none" do
+ Chef::Config[:ssl_verify_mode] = :verify_none
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
end
+ it "sets the OpenSSL verify mode to verify_peer when verify_api_cert is set" do
+ Chef::Config[:verify_api_cert] = true
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
+ end
end
describe Chef::HTTP::VerifyPeerSSLPolicy do
- let(:ssl_policy) { Chef::HTTP::VerifyPeerSSLPolicy.new(unconfigured_http_client) }
+ let(:ssl_policy_class) { Chef::HTTP::VerifyPeerSSLPolicy }
it "sets the OpenSSL verify mode to verify_peer" do
expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
@@ -179,7 +218,7 @@ describe "HTTP SSL Policy" do
describe Chef::HTTP::VerifyNoneSSLPolicy do
- let(:ssl_policy) { Chef::HTTP::VerifyNoneSSLPolicy.new(unconfigured_http_client) }
+ let(:ssl_policy_class) { Chef::HTTP::VerifyNoneSSLPolicy }
it "sets the OpenSSL verify mode to verify_peer" do
expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 130a097da2..3797207b6d 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -185,7 +185,7 @@ describe Chef::Knife::Bootstrap do
context "when :bootstrap_template config is set to a template name" do
let(:bootstrap_template) { "example" }
- let(:builtin_template_path) { File.expand_path(File.join(File.dirname(__FILE__), "../../../lib/chef/knife/bootstrap/templates", "example.erb")) }
+ let(:builtin_template_path) { File.expand_path(File.join(__dir__, "../../../lib/chef/knife/bootstrap/templates", "example.erb")) }
let(:chef_config_dir_template_path) { "/knife/chef/config/bootstrap/example.erb" }
@@ -472,21 +472,13 @@ describe Chef::Knife::Bootstrap do
end
describe "when transferring trusted certificates" do
- let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(File.dirname(__FILE__), "../../data/trusted_certs")) }
-
let(:rendered_template) do
knife.merge_configs
knife.render_template
end
before do
- Chef::Config[:trusted_certs_dir] = trusted_certs_dir
- allow(IO).to receive(:read).and_call_original
- allow(IO).to receive(:read).with(File.expand_path(Chef::Config[:validation_key])).and_return("")
- end
-
- def certificates
- Dir[File.join(trusted_certs_dir, "*.{crt,pem}")]
+ Chef::Config[:trusted_certs_dir] = Chef::Util::PathHelper.cleanpath(File.join(CHEF_SPEC_DATA, "trusted_certs"))
end
it "creates /etc/chef/trusted_certs" do
@@ -494,27 +486,23 @@ describe Chef::Knife::Bootstrap do
end
it "copies the certificates in the directory" do
- certificates.each do |cert|
- expect(IO).to receive(:read).with(File.expand_path(cert))
- end
+ certificates = Dir[File.join(Chef::Config[:trusted_certs_dir], "*.{crt,pem}")]
certificates.each do |cert|
expect(rendered_template).to match(%r{cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'})
end
end
- context "when :trusted_cets_dir is empty" do
- let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(File.dirname(__FILE__), "../../data/trusted_certs_empty")) }
- it "doesn't create /etc/chef/trusted_certs if :trusted_certs_dir is empty" do
+ it "doesn't create /etc/chef/trusted_certs if :trusted_certs_dir is empty" do
+ Dir.mktmpdir do |dir|
+ Chef::Config[:trusted_certs_dir] = dir
expect(rendered_template).not_to match(%r{mkdir -p /etc/chef/trusted_certs})
end
end
-
end
context "when doing fips things" do
let(:template_file) { File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "no_proxy.erb")) }
- let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(File.dirname(__FILE__), "../../data/trusted_certs")) }
before do
Chef::Config[:knife][:bootstrap_template] = template_file
@@ -570,7 +558,7 @@ describe Chef::Knife::Bootstrap do
context "when client_d_dir is set" do
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_00")
+ File.join(__dir__, "../../data/client.d_00")
)
end
@@ -597,7 +585,7 @@ describe Chef::Knife::Bootstrap do
context "a nested directory structure" do
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_01")
+ File.join(__dir__, "../../data/client.d_01")
)
end
it "creates a file foo/bar.rb" do
diff --git a/spec/unit/knife/client_create_spec.rb b/spec/unit/knife/client_create_spec.rb
index de0888f375..d8b67de101 100644
--- a/spec/unit/knife/client_create_spec.rb
+++ b/spec/unit/knife/client_create_spec.rb
@@ -81,7 +81,7 @@ describe Chef::Knife::ClientCreate do
it "prints a relevant error message" do
expect { knife.run }.to raise_error(SystemExit)
- expect(stderr.string).to match /You cannot pass --public-key and --prevent-keygen/
+ expect(stderr.string).to match(/You cannot pass --public-key and --prevent-keygen/)
end
end
@@ -93,7 +93,7 @@ describe Chef::Knife::ClientCreate do
it "should print a message upon creation" do
expect(knife).to receive(:create_client)
knife.run
- expect(stderr.string).to match /Created client.*adam/i
+ expect(stderr.string).to match(/Created client.*adam/i)
end
it "should set the Client name" do
diff --git a/spec/unit/knife/configure_client_spec.rb b/spec/unit/knife/configure_client_spec.rb
index be76250e7c..b104718c89 100644
--- a/spec/unit/knife/configure_client_spec.rb
+++ b/spec/unit/knife/configure_client_spec.rb
@@ -59,21 +59,21 @@ describe Chef::Knife::ConfigureClient do
allow(FileUtils).to receive(:mkdir_p)
@knife.run
expect(@client_file.string).to match %r{chef_server_url\s+'https\://chef\.example\.com'}
- expect(@client_file.string).to match /validation_client_name\s+'chef-validator'/
+ expect(@client_file.string).to match(/validation_client_name\s+'chef-validator'/)
end
it "should write out the validation.pem file" do
allow(FileUtils).to receive(:mkdir_p)
@knife.run
- expect(@validation_file.string).to match /foo_bar_baz/
+ expect(@validation_file.string).to match(/foo_bar_baz/)
end
it "should print information on what is being configured" do
allow(FileUtils).to receive(:mkdir_p)
@knife.run
- expect(@stderr.string).to match /creating client configuration/i
- expect(@stderr.string).to match /writing client\.rb/i
- expect(@stderr.string).to match /writing validation\.pem/i
+ expect(@stderr.string).to match(/creating client configuration/i)
+ expect(@stderr.string).to match(/writing client\.rb/i)
+ expect(@stderr.string).to match(/writing validation\.pem/i)
end
end
end
diff --git a/spec/unit/knife/configure_spec.rb b/spec/unit/knife/configure_spec.rb
index 6b41e54778..7d6c840d1f 100644
--- a/spec/unit/knife/configure_spec.rb
+++ b/spec/unit/knife/configure_spec.rb
@@ -157,9 +157,9 @@ describe Chef::Knife::Configure do
expect(::File).to receive(:open).with("/home/you/.chef/credentials", "w").and_yield config_file
@knife.config[:repository] = "/home/you/chef-repo"
@knife.run
- expect(config_file.string).to match(/^client_name[\s]+=[\s]+'#{Etc.getlogin}'$/)
- expect(config_file.string).to match(%r{^client_key[\s]+=[\s]+'/home/you/.chef/#{Etc.getlogin}.pem'$})
- expect(config_file.string).to match(/^chef_server_url\s+=[\s]+'#{default_server_url}'$/)
+ expect(config_file.string).to match(/^client_name\s+=\s+'#{Etc.getlogin}'$/)
+ expect(config_file.string).to match(%r{^client_key\s+=\s+'/home/you/.chef/#{Etc.getlogin}.pem'$})
+ expect(config_file.string).to match(/^chef_server_url\s+=\s+'#{default_server_url}'$/)
end
it "creates a new client when given the --initial option" do
diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb
index 4de907e94d..f2aa7e1be0 100644
--- a/spec/unit/knife/cookbook_delete_spec.rb
+++ b/spec/unit/knife/cookbook_delete_spec.rb
@@ -152,7 +152,7 @@ describe Chef::Knife::CookbookDelete do
it "should print an error" do
@knife.available_versions
- expect(@stderr.string).to match /error.+cannot find a cookbook named foobar/i
+ expect(@stderr.string).to match(/error.+cannot find a cookbook named foobar/i)
end
it "should return nil" do
@@ -204,7 +204,7 @@ describe Chef::Knife::CookbookDelete do
it "should output that the cookbook was deleted" do
allow(@knife).to receive(:delete_request)
@knife.delete_version_without_confirmation("1.0.0")
- expect(@stderr.string).to match /deleted cookbook\[foobar\]\[1.0.0\]/im
+ expect(@stderr.string).to match(/deleted cookbook\[foobar\]\[1.0.0\]/im)
end
describe "with --print-after" do
diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb
index 62b6e58c75..c8903dea5b 100644
--- a/spec/unit/knife/cookbook_download_spec.rb
+++ b/spec/unit/knife/cookbook_download_spec.rb
@@ -138,9 +138,9 @@ describe Chef::Knife::CookbookDownload do
expect(File).to receive(:exist?).with("/var/tmp/chef/foobar-1.0.0").and_return(false)
@knife.run
%w{attributes recipes templates}.each do |segment|
- expect(@stderr.string).to match /downloading #{segment}/im
+ expect(@stderr.string).to match(/downloading #{segment}/im)
end
- expect(@stderr.string).to match /downloading foobar cookbook version 1\.0\.0/im
+ expect(@stderr.string).to match(/downloading foobar cookbook version 1\.0\.0/im)
expect(@stderr.string).to match %r{cookbook downloaded to /var/tmp/chef/foobar-1\.0\.0}im
end
diff --git a/spec/unit/knife/cookbook_list_spec.rb b/spec/unit/knife/cookbook_list_spec.rb
index e34b58b672..4cf806c6f0 100644
--- a/spec/unit/knife/cookbook_list_spec.rb
+++ b/spec/unit/knife/cookbook_list_spec.rb
@@ -41,7 +41,7 @@ describe Chef::Knife::CookbookList do
.and_return(@cookbook_data)
@knife.run
@cookbook_names.each do |item|
- expect(@stdout.string).to match /#{item}\s+1\.0\.1/
+ expect(@stdout.string).to match(/#{item}\s+1\.0\.1/)
end
end
@@ -79,7 +79,7 @@ describe Chef::Knife::CookbookList do
.and_return(@cookbook_data)
@knife.run
@cookbook_names.each do |item|
- expect(@stdout.string).to match /#{item}\s+1\.0\.1\s+1\.0\.0/
+ expect(@stdout.string).to match(/#{item}\s+1\.0\.1\s+1\.0\.0/)
end
end
end
diff --git a/spec/unit/knife/cookbook_metadata_spec.rb b/spec/unit/knife/cookbook_metadata_spec.rb
index 04d851be6a..732cf78421 100644
--- a/spec/unit/knife/cookbook_metadata_spec.rb
+++ b/spec/unit/knife/cookbook_metadata_spec.rb
@@ -145,20 +145,20 @@ describe Chef::Knife::CookbookMetadata do
create_metadata_rb(name: "foobar", version: "1.0.0", depends: [ "foo:bar", ">> 0.2" ])
expect(Chef::Cookbook::Metadata).not_to receive(:validate_json)
expect { knife.run }.to raise_error(SystemExit)
- expect(stderr.string).to match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
+ expect(stderr.string).to match(/error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im)
end
it "should fail for obsolete format in metadata.rb (sadly)" do
create_metadata_rb(name: "foobar", version: "1.0.0", depends: [ "foo:bar", "> 0.2", "< 1.0" ])
expect(Chef::Cookbook::Metadata).not_to receive(:validate_json)
expect { knife.run }.to raise_error(SystemExit)
- expect(stderr.string).to match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
+ expect(stderr.string).to match(/error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im)
end
it "should fail for obsolete operators in metadata.json" do
create_metadata_json(name: "foobar", version: "1.0.0", dependencies: { "foo:bar" => ">> 0.2" })
expect { knife.run }.to raise_error(SystemExit)
- expect(stderr.string).to match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
+ expect(stderr.string).to match(/error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im)
end
it "should not fail for unknown field in metadata.rb" do
diff --git a/spec/unit/knife/core/node_editor_spec.rb b/spec/unit/knife/core/node_editor_spec.rb
index 4eac07c313..d8e5c86d2c 100644
--- a/spec/unit/knife/core/node_editor_spec.rb
+++ b/spec/unit/knife/core/node_editor_spec.rb
@@ -74,7 +74,7 @@ describe Chef::Knife::NodeEditor do
expect(ui).to have_received(:warn)
.with "Changing the name of a node results in a new node being " +
- "created, test_node will not be modified or removed."
+ "created, test_node will not be modified or removed."
expect(ui).to have_received(:confirm)
.with("Proceed with creation of new node")
diff --git a/spec/unit/knife/environment_compare_spec.rb b/spec/unit/knife/environment_compare_spec.rb
index 82960f3db3..bfaeed0c82 100644
--- a/spec/unit/knife/environment_compare_spec.rb
+++ b/spec/unit/knife/environment_compare_spec.rb
@@ -62,7 +62,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:format] = "summary"
@knife.run
@environments.each_key do |item|
- expect(@stdout.string).to(match /#{item}/) && expect(@stdout.string.lines.count).to(be 4)
+ expect(@stdout.string).to(match(/#{item}/)) && expect(@stdout.string.lines.count).to(be 4)
end
end
@@ -79,7 +79,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:mismatch] = true
@knife.run
@constraints.each_value do |ver|
- expect(@stdout.string).to match /#{ver[1]}/
+ expect(@stdout.string).to match(/#{ver[1]}/)
end
end
@@ -97,7 +97,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:all] = true
@knife.run
@constraints.each_value do |ver|
- expect(@stdout.string).to match /#{ver[1]}/
+ expect(@stdout.string).to match(/#{ver[1]}/)
end
end
diff --git a/spec/unit/knife/supermarket_download_spec.rb b/spec/unit/knife/supermarket_download_spec.rb
index e7058c24e9..5d15e74966 100644
--- a/spec/unit/knife/supermarket_download_spec.rb
+++ b/spec/unit/knife/supermarket_download_spec.rb
@@ -86,8 +86,8 @@ describe Chef::Knife::SupermarketDownload do
.with(/.+deprecated.+replaced by other_apache2.+/i)
expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run
- expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match(/downloading apache2.+version.+#{Regexp.escape(@version)}/i)
+ expect(@stderr.string).to match(/cookbook save.+#{Regexp.escape(@file)}/i)
end
end
@@ -95,8 +95,8 @@ describe Chef::Knife::SupermarketDownload do
it "should download the latest version" do
expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run
- expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match(/downloading apache2.+version.+#{Regexp.escape(@version)}/i)
+ expect(@stderr.string).to match(/cookbook save.+#{Regexp.escape(@file)}/i)
end
context "with -f or --file" do
@@ -108,8 +108,8 @@ describe Chef::Knife::SupermarketDownload do
it "should download the cookbook to the desired file" do
@knife.run
- expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match(/downloading apache2.+version.+#{Regexp.escape(@version)}/i)
+ expect(@stderr.string).to match(/cookbook save.+#{Regexp.escape(@file)}/i)
end
end
@@ -140,8 +140,8 @@ describe Chef::Knife::SupermarketDownload do
.and_return(@temp_file)
expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run
- expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match(/downloading apache2.+version.+#{Regexp.escape(@version)}/i)
+ expect(@stderr.string).to match(/cookbook save.+#{Regexp.escape(@file)}/i)
end
end
diff --git a/spec/unit/knife/supermarket_list_spec.rb b/spec/unit/knife/supermarket_list_spec.rb
index db96ff5d3c..a1acccaaaa 100644
--- a/spec/unit/knife/supermarket_list_spec.rb
+++ b/spec/unit/knife/supermarket_list_spec.rb
@@ -52,7 +52,7 @@ describe Chef::Knife::SupermarketList do
it "should display all supermarket cookbooks" do
knife.run
cookbooks_data.each do |item|
- expect(stdout.string).to match /#{item["cookbook_name"]}\s/
+ expect(stdout.string).to match(/#{item["cookbook_name"]}\s/)
end
end
@@ -61,8 +61,8 @@ describe Chef::Knife::SupermarketList do
knife.config[:with_uri] = true
knife.run
cookbooks_data.each do |item|
- expect(stdout.string).to match /#{item["cookbook_name"]}\s/
- expect(stdout.string).to match /#{item["cookbook"]}\s/
+ expect(stdout.string).to match(/#{item["cookbook_name"]}\s/)
+ expect(stdout.string).to match(/#{item["cookbook"]}\s/)
end
end
end
diff --git a/spec/unit/knife/supermarket_search_spec.rb b/spec/unit/knife/supermarket_search_spec.rb
index 5d3c0accf0..cba2f615aa 100644
--- a/spec/unit/knife/supermarket_search_spec.rb
+++ b/spec/unit/knife/supermarket_search_spec.rb
@@ -65,7 +65,7 @@ describe Chef::Knife::SupermarketSearch do
knife.name_args = ["mysql"]
knife.run
cookbooks_data.each do |item|
- expect(stdout.string).to match /#{item["cookbook_name"]}\s/
+ expect(stdout.string).to match(/#{item["cookbook_name"]}\s/)
end
end
end
diff --git a/spec/unit/knife/tag_create_spec.rb b/spec/unit/knife/tag_create_spec.rb
index 6a3ced3f5b..a1a4923871 100644
--- a/spec/unit/knife/tag_create_spec.rb
+++ b/spec/unit/knife/tag_create_spec.rb
@@ -17,7 +17,7 @@ describe Chef::Knife::TagCreate do
it "can create tags on a node" do
@knife.run
expect(@node.tags).to eq(["happytag"])
- expect(@stderr.string).to match /created tags happytag.+node webmonkey.example.com/i
+ expect(@stderr.string).to match(/created tags happytag.+node webmonkey.example.com/i)
end
end
end
diff --git a/spec/unit/knife/tag_delete_spec.rb b/spec/unit/knife/tag_delete_spec.rb
index 5c932706af..4201196de0 100644
--- a/spec/unit/knife/tag_delete_spec.rb
+++ b/spec/unit/knife/tag_delete_spec.rb
@@ -19,7 +19,7 @@ describe Chef::Knife::TagDelete do
expect(@node.tags).to eq(%w{sadtag happytag})
@knife.run
expect(@node.tags).to eq(["happytag"])
- expect(@stderr.string).to match /deleted.+sadtag/i
+ expect(@stderr.string).to match(/deleted.+sadtag/i)
end
end
end
diff --git a/spec/unit/knife/user_create_spec.rb b/spec/unit/knife/user_create_spec.rb
index 3c9a9d3a78..be3d2fd99c 100644
--- a/spec/unit/knife/user_create_spec.rb
+++ b/spec/unit/knife/user_create_spec.rb
@@ -112,7 +112,7 @@ describe Chef::Knife::UserCreate do
it "prints a relevant error message" do
expect { knife.run }.to raise_error(SystemExit)
- expect(stderr.string).to match /You cannot pass --user-key and --prevent-keygen/
+ expect(stderr.string).to match(/You cannot pass --user-key and --prevent-keygen/)
end
end
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb
index a933d23afe..ac2c95d7e7 100644
--- a/spec/unit/lwrp_spec.rb
+++ b/spec/unit/lwrp_spec.rb
@@ -169,7 +169,7 @@ describe "LWRP" do
describe "Lightweight Chef::Resource" do
before do
- Dir[File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "lwrp", "resources", "*"))].each do |file|
+ Dir[File.expand_path(File.join(__dir__, "..", "data", "lwrp", "resources", "*"))].each do |file|
Chef::Resource::LWRPBase.build_from_file("lwrp", file, nil)
end
end
@@ -211,7 +211,7 @@ describe "LWRP" do
node.normal[:penguin_name] = "jackass"
run_context = Chef::RunContext.new(node, Chef::CookbookCollection.new, @events)
- Dir[File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "lwrp", "resources_with_default_attributes", "*"))].each do |file|
+ Dir[File.expand_path(File.join(__dir__, "..", "data", "lwrp", "resources_with_default_attributes", "*"))].each do |file|
Chef::Resource::LWRPBase.build_from_file("lwrp", file, run_context)
end
@@ -654,7 +654,7 @@ describe "LWRP" do
end
let(:run_context) do
- cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks"))
+ cookbook_repo = File.expand_path(File.join(__dir__, "..", "data", "cookbooks"))
cookbook_loader = Chef::CookbookLoader.new(cookbook_repo)
cookbook_loader.load_cookbooks
cookbook_collection = Chef::CookbookCollection.new(cookbook_loader)
diff --git a/spec/unit/mixin/deep_merge_spec.rb b/spec/unit/mixin/deep_merge_spec.rb
index 2122008616..c6681b3d16 100644
--- a/spec/unit/mixin/deep_merge_spec.rb
+++ b/spec/unit/mixin/deep_merge_spec.rb
@@ -236,6 +236,14 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
@dm.deep_merge!(hash_src, hash_dst)
expect(hash_dst).to eq({ "item" => "orange" })
end
+
+ it "should overwrite a string with a nil when merging nil values" do
+ hash_src = { "item" => nil }
+ hash_dst = { "item" => "orange" }
+ @dm.deep_merge!(hash_src, hash_dst)
+ expect(hash_dst).to eq({ "item" => nil })
+ end
+
end # deep_merge!
# Chef specific
@@ -338,5 +346,12 @@ describe Chef::Mixin::DeepMerge do
merge_with_hash = { "top_level_a" => 2, "top_level_b" => true }
@dm.hash_only_merge(merge_ee_hash, merge_with_hash)
end
+
+ it "should overwrite a string with a nil when merging nil values" do
+ hash_src = { "item" => nil }
+ hash_dst = { "item" => "orange" }
+ merged_result = @dm.hash_only_merge(hash_dst, hash_src)
+ expect(merged_result).to eq({ "item" => nil })
+ end
end
end
diff --git a/spec/unit/mixin/openssl_helper_spec.rb b/spec/unit/mixin/openssl_helper_spec.rb
index 1cd3960757..7766e8f9b2 100644
--- a/spec/unit/mixin/openssl_helper_spec.rb
+++ b/spec/unit/mixin/openssl_helper_spec.rb
@@ -21,13 +21,6 @@ describe Chef::Mixin::OpenSSLHelper do
Class.new { include Chef::Mixin::OpenSSLHelper }.new
end
- describe ".included" do
- it "requires openssl" do
- instance
- expect(defined?(OpenSSL)).to_not be(false)
- end
- end
-
# Path helpers
describe "#get_key_filename" do
context "When the input is not a string" do
@@ -99,7 +92,7 @@ describe Chef::Mixin::OpenSSLHelper do
context "When the dhparam.pem file does exist, and does contain a vaild dhparam key" do
it "returns true" do
- @dhparam_file.puts(::OpenSSL::PKey::DH.new(1024).to_pem)
+ @dhparam_file.puts(::OpenSSL::PKey::DH.new(256).to_pem) # this is 256 to speed up specs
@dhparam_file.close
expect(instance.dhparam_pem_valid?(@dhparam_file.path)).to be_truthy
end
diff --git a/spec/unit/mixin/powershell_exec_spec.rb b/spec/unit/mixin/powershell_exec_spec.rb
index 9cc5e50d7f..92e92dc2a1 100644
--- a/spec/unit/mixin/powershell_exec_spec.rb
+++ b/spec/unit/mixin/powershell_exec_spec.rb
@@ -19,13 +19,42 @@
require "spec_helper"
require "chef/mixin/powershell_exec"
-describe Chef::Mixin::PowershellExec, :windows_only, :windows_gte_10 do
+describe Chef::Mixin::PowershellExec, :windows_only do
let(:powershell_mixin) { Class.new { include Chef::Mixin::PowershellExec } }
subject(:object) { powershell_mixin.new }
describe "#powershell_exec" do
- it "runs a basic command and returns a Chef::PowerShell object" do
- expect(object.powershell_exec("$PSVersionTable")).to be_kind_of(Chef::PowerShell)
+ context "not specifying an interpreter" do
+ it "runs a basic command and returns a Chef::PowerShell object" do
+ expect(object.powershell_exec("$PSVersionTable")).to be_kind_of(Chef::PowerShell)
+ end
+
+ it "uses less than version 6" do
+ execution = object.powershell_exec("$PSVersionTable")
+ expect(execution.result["PSVersion"].to_s.to_i).to be < 6
+ end
+ end
+
+ context "using pwsh interpreter" do
+ it "runs a basic command and returns a Chef::PowerShell object" do
+ expect(object.powershell_exec("$PSVersionTable", :pwsh)).to be_kind_of(Chef::Pwsh)
+ end
+
+ it "uses greater than version 6" do
+ execution = object.powershell_exec("$PSVersionTable", :pwsh)
+ expect(execution.result["PSVersion"]["Major"]).to be > 6
+ end
+ end
+
+ context "using powershell interpreter" do
+ it "runs a basic command and returns a Chef::PowerShell object" do
+ expect(object.powershell_exec("$PSVersionTable", :powershell)).to be_kind_of(Chef::PowerShell)
+ end
+
+ it "uses less than version 6" do
+ execution = object.powershell_exec("$PSVersionTable", :powershell)
+ expect(execution.result["PSVersion"].to_s.to_i).to be < 6
+ end
end
it "runs a command that fails with a non-terminating error and can trap the error via .error?" do
@@ -37,7 +66,11 @@ describe Chef::Mixin::PowershellExec, :windows_only, :windows_gte_10 do
execution = object.powershell_exec("this-should-error")
expect(execution.errors).to be_a_kind_of(Array)
expect(execution.errors[0]).to be_a_kind_of(String)
- expect(execution.errors[0]).to include("Runtime exception: this-should-error")
+ expect(execution.errors[0]).to include("The term 'this-should-error' is not recognized")
+ end
+
+ it "raises an error if the interpreter is invalid" do
+ expect { object.powershell_exec("this-should-error", :powerfart) }.to raise_error(ArgumentError)
end
end
@@ -49,5 +82,9 @@ describe Chef::Mixin::PowershellExec, :windows_only, :windows_gte_10 do
it "raises an error if the command fails" do
expect { object.powershell_exec!("this-should-error") }.to raise_error(Chef::PowerShell::CommandFailed)
end
+
+ it "raises an error if the interpreter is invalid" do
+ expect { object.powershell_exec!("this-should-error", :powerfart) }.to raise_error(ArgumentError)
+ end
end
end
diff --git a/spec/unit/mixin/powershell_out_spec.rb b/spec/unit/mixin/powershell_out_spec.rb
index 7306332057..14a9483758 100644
--- a/spec/unit/mixin/powershell_out_spec.rb
+++ b/spec/unit/mixin/powershell_out_spec.rb
@@ -44,6 +44,20 @@ describe Chef::Mixin::PowershellOut, :windows_only do
expect(object.powershell_out("Get-Process", timeout: 600)).to eql(ret)
end
+ it "uses pwsh.exe when given :pwsh interpreter" do
+ ret = double("Mixlib::ShellOut")
+ expect(object).to receive(:shell_out).with(
+ "pwsh.exe #{flags} -Command \"Get-Process\"",
+ timeout: 600
+ ).and_return(ret)
+ expect(object.powershell_out("Get-Process", :pwsh, timeout: 600)).to eql(ret)
+ end
+
+ it "raises error if interpreter is invalid" do
+ ret = double("Mixlib::ShellOut")
+ expect { object.powershell_out("Get-Process", :blah, timeout: 600) }.to raise_error(ArgumentError)
+ end
+
context "when double quote is passed in the powershell command" do
it "passes if double quote is appended with single escape" do
result = object.powershell_out("Write-Verbose \"Some String\" -Verbose")
diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb
index 4863693dba..bbbd6bab84 100644
--- a/spec/unit/mixin/securable_spec.rb
+++ b/spec/unit/mixin/securable_spec.rb
@@ -45,7 +45,7 @@ describe Chef::Mixin::Securable do
describe "unix-specific behavior" do
before(:each) do
platform_mock :unix do
- load File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
+ load File.join(__dir__, "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
@securable = Object.new
@securable.send(:extend, Chef::Mixin::Securable)
@securable.send(:extend, Chef::Mixin::ParamsValidate)
@@ -176,7 +176,7 @@ describe Chef::Mixin::Securable do
describe "windows-specific behavior" do
before(:each) do
platform_mock :windows do
- load File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
+ load File.join(__dir__, "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
securable_class = Class.new do
include Chef::Mixin::Securable
include Chef::Mixin::ParamsValidate
diff --git a/spec/unit/mixin/which.rb b/spec/unit/mixin/which.rb
index 60af349a62..a0030a5c51 100644
--- a/spec/unit/mixin/which.rb
+++ b/spec/unit/mixin/which.rb
@@ -93,7 +93,7 @@ describe Chef::Mixin::Which do
end
test_which("arrays with blocks", "foo1", "foo2", finds: "/dir2/foo1", others: [ "/dir1/foo2" ]) do |f|
- raise "bad arg to block" unless f == "/dir2/foo1" || f == "/dir1/foo2"
+ raise "bad arg to block" unless ["/dir2/foo1", "/dir1/foo2"].include?(f)
true
end
diff --git a/spec/unit/monkey_patches/uri_spec.rb b/spec/unit/monkey_patches/uri_spec.rb
deleted file mode 100644
index 9bd4b22b4a..0000000000
--- a/spec/unit/monkey_patches/uri_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#--
-# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "spec_helper"
-describe URI do
-
- describe "when a URI contains an IPv6 literal" do
-
- let(:ipv6_uri) do
- URI.parse("https://[2a00:1450:4009:809::1008]:8443")
- end
-
- it "returns the hostname without brackets" do
- expect(ipv6_uri.hostname).to eq("2a00:1450:4009:809::1008")
- end
-
- end
-
-end
diff --git a/spec/unit/node/immutable_collections_spec.rb b/spec/unit/node/immutable_collections_spec.rb
index 5ced8053a0..836e9862e9 100644
--- a/spec/unit/node/immutable_collections_spec.rb
+++ b/spec/unit/node/immutable_collections_spec.rb
@@ -130,7 +130,7 @@ describe Chef::Node::ImmutableMash do
end
%w{to_h to_hash dup}.each do |immutable_meth|
- describe "#{immutable_meth}" do
+ describe immutable_meth do
include_examples "ImmutableMash module", description
end
end
@@ -238,7 +238,7 @@ describe Chef::Node::ImmutableArray do
end
%w{to_a to_array dup}.each do |immutable_meth|
- describe "#{immutable_meth}" do
+ describe immutable_meth do
include_examples "ImmutableArray module", description
end
end
diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb
index 728348e9af..0b4169810e 100644
--- a/spec/unit/platform/query_helpers_spec.rb
+++ b/spec/unit/platform/query_helpers_spec.rb
@@ -41,24 +41,23 @@ end
describe "Chef::Platform#dsc_refresh_mode_disabled?" do
let(:node) { instance_double("Chef::Node") }
- let(:cmdlet) { instance_double("Chef::Util::Powershell::Cmdlet") }
- let(:cmdlet_result) { instance_double("Chef::Util::Powershell::CmdletResult") }
+ let(:powershell) { instance_double("Chef::PowerShell") }
it "returns true when RefreshMode is Disabled" do
- expect(Chef::Util::Powershell::Cmdlet).to receive(:new)
- .with(node, "Get-DscLocalConfigurationManager", :object)
- .and_return(cmdlet)
- expect(cmdlet).to receive(:run!).and_return(cmdlet_result)
- expect(cmdlet_result).to receive(:return_value).and_return({ "RefreshMode" => "Disabled" })
+ expect(Chef::PowerShell).to receive(:new)
+ .with("Get-DscLocalConfigurationManager")
+ .and_return(powershell)
+ expect(powershell).to receive(:error!)
+ expect(powershell).to receive(:result).and_return({ "RefreshMode" => "Disabled" })
expect(Chef::Platform.dsc_refresh_mode_disabled?(node)).to be true
end
it "returns false when RefreshMode is not Disabled" do
- expect(Chef::Util::Powershell::Cmdlet).to receive(:new)
- .with(node, "Get-DscLocalConfigurationManager", :object)
- .and_return(cmdlet)
- expect(cmdlet).to receive(:run!).and_return(cmdlet_result)
- expect(cmdlet_result).to receive(:return_value).and_return({ "RefreshMode" => "LaLaLa" })
+ expect(Chef::PowerShell).to receive(:new)
+ .with("Get-DscLocalConfigurationManager")
+ .and_return(powershell)
+ expect(powershell).to receive(:error!)
+ expect(powershell).to receive(:result).and_return({ "RefreshMode" => "LaLaLa" })
expect(Chef::Platform.dsc_refresh_mode_disabled?(node)).to be false
end
end
diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb
index 8613ce4af4..2540cb9df2 100644
--- a/spec/unit/provider/dsc_resource_spec.rb
+++ b/spec/unit/provider/dsc_resource_spec.rb
@@ -85,14 +85,13 @@ describe Chef::Provider::DscResource do
node.automatic[:languages][:powershell][:version] = "5.0.10018.0"
node
end
- let(:resource_result) { double("CmdletResult", return_value: { "InDesiredState" => true }, stream: "description") }
- let(:invoke_dsc_resource) { double("cmdlet", run!: resource_result) }
+ let(:resource_result) { double("PowerShell", result: { "InDesiredState" => true }, verbose: ["description"]) }
let(:store) { double("ResourceStore", find: resource_records) }
let(:resource_records) { [] }
before do
allow(Chef::Util::DSC::ResourceStore).to receive(:instance).and_return(store)
- allow(Chef::Util::Powershell::Cmdlet).to receive(:new).and_return(invoke_dsc_resource)
+ allow(provider).to receive(:powershell_exec!).and_return(resource_result)
allow(provider).to receive(:dsc_refresh_mode_disabled?).and_return(true)
end
@@ -112,9 +111,8 @@ describe Chef::Provider::DscResource do
it "flags the resource as reboot required when required" do
expect(provider).to receive(:test_resource).and_return(false)
expect(provider).to receive(:invoke_resource)
- .and_return(double(stdout: "", return_value: nil))
+ .and_return(double(result: { "RebootRequired" => true }))
expect(provider).to receive(:add_dsc_verbose_log)
- expect(provider).to receive(:return_dsc_resource_result).and_return(true)
expect(provider).to receive(:create_reboot_resource)
provider.run_action(:run)
end
@@ -122,9 +120,8 @@ describe Chef::Provider::DscResource do
it "does not flag the resource as reboot required when not required" do
expect(provider).to receive(:test_resource).and_return(false)
expect(provider).to receive(:invoke_resource)
- .and_return(double(stdout: "", return_value: nil))
+ .and_return(double(stdout: "", result: {}))
expect(provider).to receive(:add_dsc_verbose_log)
- expect(provider).to receive(:return_dsc_resource_result).and_return(false)
expect(provider).to_not receive(:create_reboot_resource)
provider.run_action(:run)
end
@@ -142,9 +139,7 @@ describe Chef::Provider::DscResource do
let(:resource_records) { [{}] }
it "returns the default dsc resource module" do
- expect(Chef::Util::Powershell::Cmdlet).to receive(:new) do |node, cmdlet, format|
- expect(cmdlet).to match(/Module PSDesiredStateConfiguration /)
- end.and_return(invoke_dsc_resource)
+ expect(provider).to receive(:powershell_exec!).with(/Module PSDesiredStateConfiguration /).and_return(resource_result)
provider.run_action(:run)
end
end
@@ -153,9 +148,7 @@ describe Chef::Provider::DscResource do
let(:resource_records) { [{ "Module" => { "Name" => "ModuleName" } }] }
it "returns the default dsc resource module" do
- expect(Chef::Util::Powershell::Cmdlet).to receive(:new) do |node, cmdlet, format|
- expect(cmdlet).to match(/Module ModuleName /)
- end.and_return(invoke_dsc_resource)
+ expect(provider).to receive(:powershell_exec!).with(/Module ModuleName /).and_return(resource_result)
provider.run_action(:run)
end
end
@@ -286,8 +279,6 @@ describe Chef::Provider::DscResource do
end
describe "invoke_resource" do
- let(:cmdlet) { double(run!: nil) }
-
before(:each) do
allow(provider).to receive(:translate_type).and_return("my_properties")
provider.instance_variable_set(:@new_resource, double(
@@ -301,12 +292,8 @@ describe Chef::Provider::DscResource do
end
it "invokes Invoke-DscResource command with module name" do
- expect(Chef::Util::Powershell::Cmdlet).to receive(:new).with(
- node,
- "Invoke-DscResource -Method my_method -Name my_resource -Property my_properties -Module my_module -Verbose",
- "my_output_format"
- ).and_return(cmdlet)
- provider.send(:invoke_resource, "my_method", "my_output_format")
+ expect(provider).to receive(:powershell_exec!).with("Invoke-DscResource -Method my_method -Name my_resource -Property my_properties -Module my_module -Verbose").and_return(nil)
+ provider.send(:invoke_resource, "my_method")
end
end
@@ -318,12 +305,8 @@ describe Chef::Provider::DscResource do
end
it "invokes Invoke-DscResource command with module info object" do
- expect(Chef::Util::Powershell::Cmdlet).to receive(:new).with(
- node,
- "Invoke-DscResource -Method my_method -Name my_resource -Property my_properties -Module @{ModuleName='my_module';ModuleVersion='my_module_version'} -Verbose",
- "my_output_format"
- ).and_return(cmdlet)
- provider.send(:invoke_resource, "my_method", "my_output_format")
+ expect(provider).to receive(:powershell_exec!).with("Invoke-DscResource -Method my_method -Name my_resource -Property my_properties -Module @{ModuleName='my_module';ModuleVersion='my_module_version'} -Verbose").and_return(nil)
+ provider.send(:invoke_resource, "my_method")
end
end
end
diff --git a/spec/unit/provider/dsc_script_spec.rb b/spec/unit/provider/dsc_script_spec.rb
index f0a63e0a5b..d59b6f2480 100644
--- a/spec/unit/provider/dsc_script_spec.rb
+++ b/spec/unit/provider/dsc_script_spec.rb
@@ -99,7 +99,7 @@ describe Chef::Provider::DscScript do
it "should noop if neither code or command are provided" do
allow(provider).to receive(:load_current_resource)
generator = double("Chef::Util::DSC::ConfigurationGenerator")
- expect(generator).to receive(:configuration_document_from_script_code).with("", anything, anything, anything)
+ expect(generator).to receive(:configuration_document_from_script_code).with("", anything, anything)
allow(Chef::Util::DSC::ConfigurationGenerator).to receive(:new).and_return(generator)
provider.send(:generate_configuration_document, "tmp", nil)
end
diff --git a/spec/unit/provider/group/windows_spec.rb b/spec/unit/provider/group/windows_spec.rb
index 61853c90bd..85b88000a8 100644
--- a/spec/unit/provider/group/windows_spec.rb
+++ b/spec/unit/provider/group/windows_spec.rb
@@ -39,6 +39,12 @@ describe Chef::Provider::Group::Windows do
end
describe "when creating the group" do
+ before do
+ @current_resource = Chef::Resource::Group.new("staff")
+ @current_resource.members %w{all your base}
+ @provider.current_resource = @current_resource
+ end
+
it "should call @net_group.local_add" do
expect(@net_group).to receive(:local_set_members).with([])
expect(@net_group).to receive(:local_add)
diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb
index 76fde1e141..a3701c1f45 100644
--- a/spec/unit/provider/group_spec.rb
+++ b/spec/unit/provider/group_spec.rb
@@ -266,7 +266,7 @@ describe Chef::Provider::User do
@new_resource.members << "user1"
allow(@new_resource).to receive(:append).and_return false
expect(@provider.compare_group).to be_truthy
- expect(@provider.change_desc).to eq([ "replace group members with new list of members" ])
+ expect(@provider.change_desc).to eq([ "replace group members with new list of members: aj, user1" ])
end
it "should report the gid will be changed when it does not match" do
diff --git a/spec/unit/provider/mount/linux_spec.rb b/spec/unit/provider/mount/linux_spec.rb
index 1141175780..3e41f895d1 100644
--- a/spec/unit/provider/mount/linux_spec.rb
+++ b/spec/unit/provider/mount/linux_spec.rb
@@ -24,6 +24,7 @@ describe Chef::Provider::Mount::Linux do
before(:each) do
allow(::File).to receive(:exists?).with("/dev/sdz1").and_return true
allow(::File).to receive(:exists?).with("/tmp/foo").and_return true
+ allow(::File).to receive(:exists?).with("//192.168.11.102/Share/backup").and_return true
allow(::File).to receive(:realpath).with("/dev/sdz1").and_return "/dev/sdz1"
allow(::File).to receive(:realpath).with("/tmp/foo").and_return "/tmp/foo"
end
@@ -92,6 +93,15 @@ describe Chef::Provider::Mount::Linux do
expect(provider.current_resource.mounted).to be_falsey
end
+ it "should set mounted true if network_device? is true and the mount point is found in the mounts list" do
+ new_resource.device "//192.168.11.102/Share/backup"
+ new_resource.fstype "cifs"
+ mount = "/tmp/foo //192.168.11.102/Share/backup[/backup] cifs rw\n"
+ mount << "#{new_resource.mount_point} #{new_resource.device} type #{new_resource.fstype}\n"
+ allow(provider).to receive(:shell_out!).and_return(double(stdout: mount))
+ provider.load_current_resource
+ expect(provider.current_resource.mounted).to be_truthy
+ end
end
end
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index b84a07e9ce..9a7d9198b5 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -247,15 +247,6 @@ describe Chef::Provider::Mount::Mount do
expect(@provider.current_resource.enabled).to be_falsey
end
- it "should set enabled to false if the mount point is not last in fstab" do
- line_1 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n"
- line_2 = "/dev/sdy1 #{@new_resource.mount_point} ext3 defaults 1 2\n"
- allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(line_1).and_yield(line_2)
-
- @provider.load_current_resource
- expect(@provider.current_resource.enabled).to be_falsey
- end
-
it "should not mangle the mount options if the device in fstab is a symlink" do
# expand the target path to correct specs on Windows
target = "/dev/mapper/target"
@@ -427,10 +418,30 @@ describe Chef::Provider::Mount::Mount do
@fstab = StringIO.new
allow(::File).to receive(:readlines).and_return([])
expect(::File).to receive(:open).once.with("/etc/fstab", "w").and_yield(@fstab)
- expect(::File).to receive(:open).once.with("/etc/fstab", "a").and_yield(@fstab)
@provider.enable_fs
end
+
+ it "should update the last matching entry if enabled is true" do
+ @new_resource.fstype("ext4")
+ @new_resource.dump(2)
+ @new_resource.pass(1)
+ allow(@current_resource).to receive(:enabled).and_return(true)
+ fstab_read = ["/dev/sdz1 /tmp/foo ext3 defaults 1 2\n",
+ "/dev/sdy1 /tmp/foo ext3 defaults 1 2\n",
+ "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n",
+ "/dev/sdz1 /tmp/foobar ext3 defaults 1 2\n"]
+
+ fstab_write = StringIO.new
+ allow(::File).to receive(:readlines).with("/etc/fstab").and_return(fstab_read)
+ allow(::File).to receive(:open).with("/etc/fstab", "w").and_yield(fstab_write)
+
+ @provider.enable_fs
+ expect(fstab_write.string).to eq("/dev/sdz1 /tmp/foo ext3 defaults 1 2\n" +
+ "/dev/sdy1 /tmp/foo ext3 defaults 1 2\n" +
+ "/dev/sdz1 /tmp/foo #{@new_resource.fstype} defaults #{@new_resource.dump} #{@new_resource.pass}\n" +
+ "/dev/sdz1 /tmp/foobar ext3 defaults 1 2\n")
+ end
end
describe "when disabling the fs" do
diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb
index cbe5f13e48..4ca22b4b78 100644
--- a/spec/unit/provider/mount/solaris_spec.rb
+++ b/spec/unit/provider/mount/solaris_spec.rb
@@ -544,7 +544,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should mount the filesystem with options if options were passed" do
options = "logging,noatime,largefiles,nosuid,rw,quota"
- new_resource.options(options.split(/,/))
+ new_resource.options(options.split(","))
expect(provider).to receive(:shell_out_compacted!).with("mount", "-F", fstype, "-o", options, device, mountpoint)
provider.mount_fs
end
diff --git a/spec/unit/provider/mount/windows_spec.rb b/spec/unit/provider/mount/windows_spec.rb
index aeff294347..3c2999e07e 100644
--- a/spec/unit/provider/mount/windows_spec.rb
+++ b/spec/unit/provider/mount/windows_spec.rb
@@ -23,6 +23,7 @@ class Chef
class Windows
class NetUse
end
+
class Volume
end
end
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index f41be7bd3b..7800d0c666 100644
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -151,6 +151,24 @@ describe Chef::Provider::Mount do
provider.run_action(:enable)
expect(new_resource).not_to be_updated_by_last_action
end
+
+ it "should enable the mount if device changed" do
+ allow(current_resource).to receive(:enabled).and_return(true)
+ expect(provider).to receive(:mount_options_unchanged?).and_return(true)
+ expect(provider).to receive(:device_unchanged?).and_return(false)
+ expect(provider).to receive(:enable_fs).and_return(true)
+ provider.run_action(:enable)
+ expect(new_resource).to be_updated_by_last_action
+ end
+
+ it "should not enable the mount if device not changed" do
+ allow(current_resource).to receive(:enabled).and_return(true)
+ expect(provider).to receive(:mount_options_unchanged?).and_return(true)
+ expect(provider).to receive(:device_unchanged?).and_return(true)
+ expect(provider).not_to receive(:enable_fs)
+ provider.run_action(:enable)
+ expect(new_resource).not_to be_updated_by_last_action
+ end
end
describe "when the target state is to disable the mount" do
@@ -188,4 +206,17 @@ describe Chef::Provider::Mount do
it "should delegates the disable implementation to subclasses" do
expect { provider.disable_fs }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
+
+ # Not supported on solaris because it can't cope with a LABEL device type.
+ describe "#device_unchanged?", :not_supported_on_solaris do
+ it "should be true when device_type not changed" do
+ expect(provider.device_unchanged?).to be_truthy
+ end
+
+ it "should be false when device_type changed" do
+ new_resource.device_type :label
+ current_resource.device_type :device
+ expect(provider.device_unchanged?).to be_falsey
+ end
+ end
end
diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb
index 4c1ccc7834..ba5739fe55 100644
--- a/spec/unit/provider/package/chocolatey_spec.rb
+++ b/spec/unit/provider/package/chocolatey_spec.rb
@@ -150,7 +150,7 @@ describe Chef::Provider::Package::Chocolatey, :windows_only do
new_resource.package_name("package-does-not-exist")
new_resource.returns([0])
allow(provider).to receive(:shell_out_compacted!)
- .with(choco_exe, "list", "-r", "#{new_resource.package_name.first}", { returns: new_resource.returns, timeout: timeout })
+ .with(choco_exe, "list", "-r", new_resource.package_name.first, { returns: new_resource.returns, timeout: timeout })
.and_raise(Mixlib::ShellOut::ShellCommandFailed, "Expected process to exit with [0], but received '2'")
expect { provider.send(:available_packages) }.to raise_error(Mixlib::ShellOut::ShellCommandFailed, "Expected process to exit with [0], but received '2'")
end
@@ -501,8 +501,7 @@ describe "behavior when Chocolatey is not installed" do
before do
# the shellout sometimes returns "", but test nil to be safe.
- allow(provider).to receive(:choco_install_path).and_return(nil)
- provider.instance_variable_set("@choco_install_path", nil)
+ allow(provider).to receive(:choco_install_path).and_return("")
# we don't care what this returns, but we have to let it be called.
allow(provider).to receive(:shell_out_compacted!).and_return(double(stdout: ""))
diff --git a/spec/unit/provider/package/powershell_spec.rb b/spec/unit/provider/package/powershell_spec.rb
index 256901c928..2f4da8c179 100644
--- a/spec/unit/provider/package/powershell_spec.rb
+++ b/spec/unit/provider/package/powershell_spec.rb
@@ -94,19 +94,20 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
double("powershell_out", stdout: "5")
end
- let(:generated_command) { "( Get-Package posh-git -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
- let(:generated_get_cmdlet) { "( Get-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
- let(:generated_get_cmdlet_with_version) { "( Get-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
- let(:generated_find_cmdlet) { "( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
- let(:generated_find_cmdlet_with_version) { "( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
- let(:generated_find_cmdlet_with_source) { "( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version" }
- let(:generated_find_cmdlet_with_source_and_version) { "( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 -Source MyGallery ).Version" }
- let(:generated_install_cmdlet) { "( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
- let(:generated_install_cmdlet_with_version) { "( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
- let(:generated_install_cmdlet_with_source) { "( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version" }
- let(:generated_install_cmdlet_with_source_and_version) { "( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 -Source MyGallery ).Version" }
- let(:generated_uninstall_cmdlet) { "( Uninstall-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
- let(:generated_uninstall_cmdlet_with_version) { "( Uninstall-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
+ let(:tls_set_command) { "if ([Net.ServicePointManager]::SecurityProtocol -lt [Net.SecurityProtocolType]::Tls12) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 };" }
+ let(:generated_command) { "#{tls_set_command} ( Get-Package posh-git -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
+ let(:generated_get_cmdlet) { "#{tls_set_command} ( Get-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
+ let(:generated_get_cmdlet_with_version) { "#{tls_set_command} ( Get-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
+ let(:generated_find_cmdlet) { "#{tls_set_command} ( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
+ let(:generated_find_cmdlet_with_version) { "#{tls_set_command} ( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
+ let(:generated_find_cmdlet_with_source) { "#{tls_set_command} ( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version" }
+ let(:generated_find_cmdlet_with_source_and_version) { "#{tls_set_command} ( Find-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 -Source MyGallery ).Version" }
+ let(:generated_install_cmdlet) { "#{tls_set_command} ( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
+ let(:generated_install_cmdlet_with_version) { "#{tls_set_command} ( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
+ let(:generated_install_cmdlet_with_source) { "#{tls_set_command} ( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version" }
+ let(:generated_install_cmdlet_with_source_and_version) { "#{tls_set_command} ( Install-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 -Source MyGallery ).Version" }
+ let(:generated_uninstall_cmdlet) { "#{tls_set_command} ( Uninstall-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version" }
+ let(:generated_uninstall_cmdlet_with_version) { "#{tls_set_command} ( Uninstall-Package xNetworking -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 1.0.0.0 ).Version" }
describe "#initialize" do
it "should return the correct class" do
@@ -117,14 +118,14 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
describe "#candidate_version" do
it "should set the candidate_version to the latest version when not pinning" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
new_resource.package_name(["xNetworking"])
new_resource.version(nil)
expect(provider.candidate_version).to eql(["2.12.0.0"])
end
it "should use the candidate_version from the correct source" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
new_resource.package_name(["xNetworking"])
new_resource.version(nil)
new_resource.source("MyGallery")
@@ -132,60 +133,60 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
end
it "should set the candidate_version to the latest version when not pinning and package name is space separated" do
- allow(provider).to receive(:powershell_out).with("( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
new_resource.package_name(["7-Zip 16.02 (x64)"])
new_resource.version(nil)
expect(provider.candidate_version).to eql(["16.02"])
end
it "should set the candidate_version to pinned version if available" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.0.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available_2_0_0_0)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.0.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available_2_0_0_0)
new_resource.package_name(["xCertificate"])
new_resource.version(["2.0.0.0"])
expect(provider.candidate_version).to eql(["2.0.0.0"])
end
it "should set the candidate_version to nil if there is no candidate" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
new_resource.package_name(["xCertificate"])
expect(provider.candidate_version).to eql([nil])
end
it "should set the candidate_version correctly when there are two packages to install" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(nil)
expect(provider.candidate_version).to eql(["2.1.0.0", "2.12.0.0"])
end
it "should set the candidate_version correctly when only the first is installable" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(nil)
expect(provider.candidate_version).to eql(["2.1.0.0", nil])
end
it "should set the candidate_version correctly when only the last is installable" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(nil)
expect(provider.candidate_version).to eql([nil, "2.12.0.0"])
end
it "should set the candidate_version correctly when neither are is installable and version is passed as nil array" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
new_resource.package_name(%w{xNetworking xCertificate})
new_resource.version([nil, nil])
expect(provider.candidate_version).to eql([nil, nil])
end
it "should set the candidate_version correctly when neither are is installable and version is not passed" do
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
new_resource.package_name(%w{xNetworking xCertificate})
new_resource.version(nil)
expect(provider.candidate_version).to eql([nil, nil])
@@ -284,11 +285,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
provider.load_current_resource
new_resource.package_name(["xCertificate"])
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
end
@@ -298,11 +298,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
new_resource.package_name(["xCertificate"])
new_resource.version(nil)
new_resource.source("MyGallery")
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
end
@@ -312,11 +311,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
new_resource.package_name(["xCertificate"])
new_resource.version(nil)
new_resource.skip_publisher_check(true)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -SkipPublisherCheck ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -SkipPublisherCheck ).Version", { timeout: new_resource.timeout })
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
end
@@ -325,11 +323,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
provider.load_current_resource
new_resource.package_name(["7-Zip 16.02 (x64)"])
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_not_installed)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_not_installed)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 16.02 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 16.02 ).Version", { timeout: new_resource.timeout })
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
end
@@ -341,11 +338,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
provider.load_current_resource
new_resource.package_name(["xCertificate"])
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
end
@@ -354,8 +350,8 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "should not install packages that are up-to-date" do
new_resource.package_name(["xCertificate"])
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
provider.load_current_resource
expect(provider).not_to receive(:install_package)
@@ -366,8 +362,8 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "should not install packages that are up-to-date" do
new_resource.package_name(["xNetworking"])
new_resource.version(["2.11.0.0"])
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
provider.load_current_resource
expect(provider).not_to receive(:install_package)
@@ -380,14 +376,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
# new_version.resource[0]
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version([nil, "2.11.0.0"])
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout })
provider.load_current_resource
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
@@ -396,14 +391,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "should split up commands when given two packages, one with a version pin" do
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(["2.1.0.0", nil])
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
provider.load_current_resource
provider.run_action(:install)
@@ -413,14 +407,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "should do multipackage installs when given two packages without constraints" do
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
provider.load_current_resource
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
@@ -430,14 +423,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(nil)
new_resource.source("MyGallery")
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
- allow(provider).to receive(:powershell_out).with("[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12")
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
- expect(provider).to receive(:powershell_out).with("( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
provider.load_current_resource
provider.run_action(:install)
expect(new_resource).to be_updated_by_last_action
@@ -449,8 +441,8 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
provider.load_current_resource
new_resource.package_name(["xCertificate"])
new_resource.version(["2.1.0.0"])
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
expect(provider).not_to receive(:remove_package)
provider.run_action(:remove)
@@ -461,11 +453,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
new_resource.package_name(["xCertificate"])
new_resource.version(["2.1.0.0"])
new_resource.source("MyGallery")
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
provider.load_current_resource
- expect(provider).to receive(:powershell_out).with("( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
@@ -473,10 +465,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "does nothing when all the packages are already removed" do
new_resource.package_name(%w{xCertificate xNetworking})
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
provider.load_current_resource
expect(provider).not_to receive(:remove_package)
@@ -487,11 +479,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "removes a package when version is specified" do
new_resource.package_name(["xCertificate"])
new_resource.version(["2.1.0.0"])
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
provider.load_current_resource
- expect(provider).to receive(:powershell_out).with("( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
@@ -499,11 +491,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
it "removes a package when version is not specified" do
new_resource.package_name(["xCertificate"])
new_resource.version(nil)
- allow(provider).to receive(:powershell_out).with("( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
- allow(provider).to receive(:powershell_out).with("( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
+ allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
provider.load_current_resource
- expect(provider).to receive(:powershell_out).with("( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
+ expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb
index fe1cd25ee3..a1f6629f55 100644
--- a/spec/unit/provider/package/zypper_spec.rb
+++ b/spec/unit/provider/package/zypper_spec.rb
@@ -96,31 +96,6 @@ describe Chef::Provider::Package::Zypper do
provider.load_current_resource
end
- it "should set the candidate version if zypper info has one (zypper version < 1.13.0)" do
- status = double(stdout: "Version: 1.0\nInstalled: No\nStatus: out-of-date (version 0.9 installed)", exitstatus: 0)
-
- allow(provider).to receive(:shell_out_compacted!).and_return(status)
- provider.load_current_resource
- expect(provider.candidate_version).to eql(["1.0"])
- end
-
- it "should set the candidate version if zypper info has one (zypper version >= 1.13.0)" do
- status = double(stdout: "Version : 1.0 \nInstalled : No \nStatus : out-of-date (version 0.9 installed)", exitstatus: 0)
-
- allow(provider).to receive(:shell_out_compacted!).and_return(status)
- provider.load_current_resource
- expect(provider.candidate_version).to eql(["1.0"])
- end
-
- it "should have differing current and candidate versions if zypper detects an upgrade" do
- status = double(stdout: "Version : 1.0 \nInstalled : Yes \nStatus : out-of-date (version 0.9 installed)", exitstatus: 0)
-
- allow(provider).to receive(:shell_out_compacted!).and_return(status)
- provider.load_current_resource
- expect(provider.get_current_versions).to eq(["0.9"])
- expect(provider.get_candidate_versions).to eq(["1.0"])
- end
-
it "should return the current resouce" do
expect(provider.load_current_resource).to eql(current_resource)
end
diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb
index 505dfff417..a6e1da188c 100644
--- a/spec/unit/provider/package_spec.rb
+++ b/spec/unit/provider/package_spec.rb
@@ -517,8 +517,8 @@ describe "Chef::Provider::Package - Multi" do
end
it "installs the specified version when some are out of date" do
- current_resource.version(["1.0", "6.2"])
- new_resource.version(["1.0", "6.3"])
+ current_resource.version(["1.0", "6.1"])
+ new_resource.version(["1.0", "6.2"])
provider.run_action(:install)
expect(new_resource).to be_updated
end
diff --git a/spec/unit/provider/powershell_script_spec.rb b/spec/unit/provider/powershell_script_spec.rb
index 1c49c52160..0bece73bd0 100644
--- a/spec/unit/provider/powershell_script_spec.rb
+++ b/spec/unit/provider/powershell_script_spec.rb
@@ -46,5 +46,16 @@ describe Chef::Provider::PowershellScript, "action_run" do
expect(provider.command).to eq(expected)
end
+
+ it "uses pwsh when given the pwsh interpreter" do
+ new_resource.interpreter = "pwsh"
+ provider.send(:script_file_path=, "C:\\Temp\\Script.ps1")
+
+ expected = <<~CMD.strip
+ "pwsh" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:\\Temp\\Script.ps1"
+ CMD
+
+ expect(provider.command).to eq(expected)
+ end
end
end
diff --git a/spec/unit/provider/route_spec.rb b/spec/unit/provider/route_spec.rb
index ad5223a04f..d39ca8b155 100644
--- a/spec/unit/provider/route_spec.rb
+++ b/spec/unit/provider/route_spec.rb
@@ -230,8 +230,6 @@ describe Chef::Provider::Route do
@provider.generate_config
end
- end
- %w{ rhel fedora amazon }.each do |platform_family|
it "should write a default route file on #{platform_family} platform family" do
@node.automatic_attrs[:platform_family] = platform_family
diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb
index f3d8404841..f249f564b1 100644
--- a/spec/unit/provider/subversion_spec.rb
+++ b/spec/unit/provider/subversion_spec.rb
@@ -271,9 +271,6 @@ describe Chef::Provider::Subversion do
end
context "selects the correct svn binary" do
- before do
- end
-
it "selects 'svn' as the binary by default" do
@resource.svn_binary nil
allow(ChefUtils).to receive(:windows?) { false }
diff --git a/spec/unit/provider/systemd_unit_spec.rb b/spec/unit/provider/systemd_unit_spec.rb
index e1170b4fc5..d31d5f0919 100644
--- a/spec/unit/provider/systemd_unit_spec.rb
+++ b/spec/unit/provider/systemd_unit_spec.rb
@@ -18,7 +18,7 @@
require "spec_helper"
-describe Chef::Provider::SystemdUnit do
+describe Chef::Provider::SystemdUnit, :linux_only do
let(:node) { Chef::Node.new }
let(:events) { Chef::EventDispatch::Dispatcher.new }
diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb
index ac1c943dbf..16428de1a9 100644
--- a/spec/unit/provider/user_spec.rb
+++ b/spec/unit/provider/user_spec.rb
@@ -259,6 +259,7 @@ describe Chef::Provider::User do
it "should call manage_user if the user exists and has mismatched properties" do
@provider.user_exists = true
allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
expect(@provider).to receive(:manage_user).and_return(true)
@provider.action_create
end
@@ -266,6 +267,7 @@ describe Chef::Provider::User do
it "should set the new_resources updated flag when it creates the user if we call manage_user" do
@provider.user_exists = true
allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
allow(@provider).to receive(:manage_user).and_return(true)
@provider.action_create
@provider.set_updated_status
@@ -315,14 +317,16 @@ describe Chef::Provider::User do
# @provider.stub(:manage_user).and_return(true)
end
- it "should run manage_user if the user exists and has mismatched properties" do
+ it "should call manage_user if the user exists and has mismatched properties" do
expect(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
expect(@provider).to receive(:manage_user).and_return(true)
@provider.action_manage
end
it "should set the new resources updated flag to true if manage_user is called" do
allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
allow(@provider).to receive(:manage_user).and_return(true)
@provider.action_manage
@provider.set_updated_status
@@ -360,12 +364,14 @@ describe Chef::Provider::User do
it "should run manage_user if the user exists and has mismatched properties" do
expect(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
expect(@provider).to receive(:manage_user).and_return(true)
@provider.action_modify
end
it "should set the new resources updated flag to true if manage_user is called" do
allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
allow(@provider).to receive(:manage_user).and_return(true)
@provider.action_modify
@provider.set_updated_status
diff --git a/spec/unit/provider/windows_env_spec.rb b/spec/unit/provider/windows_env_spec.rb
index 5d14128230..7f64622d20 100644
--- a/spec/unit/provider/windows_env_spec.rb
+++ b/spec/unit/provider/windows_env_spec.rb
@@ -18,21 +18,17 @@
require "spec_helper"
-describe Chef::Provider::WindowsEnv, :windows_only do
+describe "windows_env provider", :windows_only do
let(:run_context) do
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
end
before do
- @new_resource = Chef::Resource::WindowsEnv.new("FOO")
+ @new_resource = Chef::Resource::WindowsEnv.new("FOO", run_context)
@new_resource.value("bar")
@new_resource.user("<System>")
- @provider = Chef::Provider::WindowsEnv.new(@new_resource, run_context)
- end
-
- it "assumes the key_name exists by default" do
- expect(@provider.key_exists).to be_truthy
+ @provider = @new_resource.provider_for_action(:create)
end
describe "when loading the current status" do
@@ -41,7 +37,7 @@ describe Chef::Provider::WindowsEnv, :windows_only do
# Chef::Resource::Env.stub(:new).and_return(@current_resource)
@provider.current_resource = @current_resource
allow(@provider).to receive(:env_value).with("FOO").and_return("bar")
- allow(@provider).to receive(:env_key_exists).and_return(true)
+ allow(@provider).to receive(:key_exists?).and_return(true)
end
it "should create a current resource with the same name as the new resource" do
@@ -59,18 +55,6 @@ describe Chef::Provider::WindowsEnv, :windows_only do
expect(@provider.current_resource.key_name).to eq("FOO")
end
- it "should check if the key_name and user exist" do
- expect(@provider).to receive(:env_key_exists).with("FOO").and_return(true)
- @provider.load_current_resource
- expect(@provider.key_exists).to be_truthy
- end
-
- it "should flip the value of exists if the key does not exist" do
- expect(@provider).to receive(:env_key_exists).with("FOO").and_return(false)
- @provider.load_current_resource
- expect(@provider.key_exists).to be_falsey
- end
-
it "should return the current resource" do
expect(@provider.load_current_resource).to be_a_kind_of(Chef::Resource::WindowsEnv)
end
@@ -78,7 +62,7 @@ describe Chef::Provider::WindowsEnv, :windows_only do
describe "action_create" do
before do
- @provider.key_exists = false
+ allow(@provider).to receive(:key_exists?).and_return(false)
allow(@provider).to receive(:create_env).and_return(true)
allow(@provider).to receive(:modify_env).and_return(true)
end
@@ -94,20 +78,20 @@ describe Chef::Provider::WindowsEnv, :windows_only do
end
it "should check to see if the values are the same if the key exists" do
- @provider.key_exists = true
+ allow(@provider).to receive(:key_exists?).and_return(true)
expect(@provider).to receive(:requires_modify_or_create?).and_return(false)
@provider.action_create
end
it "should call modify_env if the key exists with provided user and values are not equal" do
- @provider.key_exists = true
+ allow(@provider).to receive(:key_exists?).and_return(true)
allow(@provider).to receive(:requires_modify_or_create?).and_return(true)
expect(@provider).to receive(:modify_env).and_return(true)
@provider.action_create
end
it "should set the new_resources updated flag when it updates an existing value" do
- @provider.key_exists = true
+ allow(@provider).to receive(:key_exists?).and_return(true)
allow(@provider).to receive(:requires_modify_or_create?).and_return(true)
allow(@provider).to receive(:modify_env).and_return(true)
@provider.action_create
@@ -118,7 +102,7 @@ describe Chef::Provider::WindowsEnv, :windows_only do
describe "action_delete" do
before(:each) do
@provider.current_resource = @current_resource
- @provider.key_exists = false
+ allow(@provider).to receive(:key_exists?).and_return(false)
allow(@provider).to receive(:delete_element).and_return(false)
allow(@provider).to receive(:delete_env).and_return(true)
end
@@ -134,13 +118,13 @@ describe Chef::Provider::WindowsEnv, :windows_only do
end
it "should call delete_env if the key exists" do
- @provider.key_exists = true
+ allow(@provider).to receive(:key_exists?).and_return(true)
expect(@provider).to receive(:delete_env)
@provider.action_delete
end
it "should set the new_resources updated flag to true if the key is deleted" do
- @provider.key_exists = true
+ allow(@provider).to receive(:key_exists?).and_return(true)
@provider.action_delete
expect(@new_resource).to be_updated
end
@@ -149,7 +133,7 @@ describe Chef::Provider::WindowsEnv, :windows_only do
describe "action_modify" do
before(:each) do
@provider.current_resource = @current_resource
- @provider.key_exists = true
+ allow(@provider).to receive(:key_exists?).and_return(true)
allow(@provider).to receive(:modify_env).and_return(true)
end
@@ -179,7 +163,7 @@ describe Chef::Provider::WindowsEnv, :windows_only do
end
it "should raise a Chef::Exceptions::WindowsEnv if the key doesn't exist" do
- @provider.key_exists = false
+ allow(@provider).to receive(:key_exists?).and_return(false)
expect { @provider.action_modify }.to raise_error(Chef::Exceptions::WindowsEnv)
end
end
@@ -324,12 +308,12 @@ describe Chef::Provider::WindowsEnv, :windows_only do
context "when environment variable is not PATH" do
let(:new_resource) do
- new_resource = Chef::Resource::WindowsEnv.new("CHEF_WINDOWS_ENV_TEST")
+ new_resource = Chef::Resource::WindowsEnv.new("CHEF_WINDOWS_ENV_TEST", run_context)
new_resource.value("foo")
new_resource
end
let(:provider) do
- provider = Chef::Provider::WindowsEnv.new(new_resource, run_context)
+ provider = new_resource.provider_for_action(:create)
allow(provider).to receive(:env_obj).and_return(double("null object").as_null_object)
provider
end
@@ -337,7 +321,7 @@ describe Chef::Provider::WindowsEnv, :windows_only do
describe "action_create" do
before do
ENV.delete("CHEF_WINDOWS_ENV_TEST")
- provider.key_exists = false
+ allow(provider).to receive(:key_exists?).and_return(false)
end
it "should update the ruby ENV object when it creates the key" do
@@ -376,12 +360,12 @@ describe Chef::Provider::WindowsEnv, :windows_only do
let(:system_root) { "%SystemRoot%" }
let(:system_root_value) { 'D:\Windows' }
let(:new_resource) do
- new_resource = Chef::Resource::WindowsEnv.new("PATH")
+ new_resource = Chef::Resource::WindowsEnv.new("PATH", run_context)
new_resource.value(system_root)
new_resource
end
let(:provider) do
- provider = Chef::Provider::WindowsEnv.new(new_resource, run_context)
+ provider = new_resource.provider_for_action(:create)
allow(provider).to receive(:env_obj).and_return(double("null object").as_null_object)
provider
end
diff --git a/spec/unit/provider/windows_path_spec.rb b/spec/unit/provider/windows_path_spec.rb
index 6036772af0..0c6c590ece 100644
--- a/spec/unit/provider/windows_path_spec.rb
+++ b/spec/unit/provider/windows_path_spec.rb
@@ -18,7 +18,7 @@
require "spec_helper"
-describe Chef::Provider::WindowsPath, :windows_only do
+describe "windows_path provider", :windows_only do
before(:all) do
@old_path = ENV["PATH"].dup
end
@@ -27,14 +27,9 @@ describe Chef::Provider::WindowsPath, :windows_only do
ENV["PATH"] = @old_path
end
- let(:new_resource) { Chef::Resource::WindowsPath.new("some_path") }
-
- let(:provider) do
- node = Chef::Node.new
- events = Chef::EventDispatch::Dispatcher.new
- run_context = Chef::RunContext.new(node, {}, events)
- Chef::Provider::WindowsPath.new(new_resource, run_context)
- end
+ let(:run_context) { Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new) }
+ let(:new_resource) { Chef::Resource::WindowsPath.new("some_path", run_context) }
+ let(:provider) { new_resource.provider_for_action(:add) }
describe "#load_current_resource" do
it "returns a current_resource" do
@@ -50,7 +45,7 @@ describe Chef::Provider::WindowsPath, :windows_only do
describe "#action_add" do
it "uses env resource to add 'path' environment variable" do
allow(provider).to receive(:expand_env_vars)
- expect(provider).to receive(:declare_resource).with(:env, "path")
+ expect(provider).to receive(:declare_resource).with(:env, "path", hash_including)
provider.run_action(:add)
end
end
@@ -58,7 +53,7 @@ describe Chef::Provider::WindowsPath, :windows_only do
describe "#action_remove" do
it "uses env resource to remove 'path' environment variable" do
allow(provider).to receive(:expand_env_vars)
- expect(provider).to receive(:declare_resource).with(:env, "path")
+ expect(provider).to receive(:declare_resource).with(:env, "path", hash_including)
provider.run_action(:remove)
end
end
diff --git a/spec/unit/provider/windows_task_spec.rb b/spec/unit/provider/windows_task_spec.rb
index 62a3885faa..dce898154b 100644
--- a/spec/unit/provider/windows_task_spec.rb
+++ b/spec/unit/provider/windows_task_spec.rb
@@ -18,15 +18,16 @@
require "spec_helper"
-describe Chef::Provider::WindowsTask, :windows_only do
- let(:new_resource) { Chef::Resource::WindowsTask.new("sample_task") }
+describe "windows_task provider", :windows_only do
+ let(:new_resource) { Chef::Resource::WindowsTask.new("sample_task", run_context) }
let(:current_resource) { Chef::Resource::WindowsTask.new }
+ let(:run_context) do
+ Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
+ end
+
let(:provider) do
- node = Chef::Node.new
- events = Chef::EventDispatch::Dispatcher.new
- run_context = Chef::RunContext.new(node, {}, events)
- Chef::Provider::WindowsTask.new(new_resource, run_context)
+ new_resource.provider_for_action(:create)
end
describe "#load_current_resource" do
diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb
deleted file mode 100644
index 20c07a5c45..0000000000
--- a/spec/unit/provider_resolver_spec.rb
+++ /dev/null
@@ -1,885 +0,0 @@
-#
-# Author:: Lamont Granquist (<lamont@chef.io>)
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "spec_helper"
-require "chef/mixin/convert_to_class_name"
-require "chef/provider_resolver"
-require "chef/platform/service_helpers"
-require "support/shared/integration/integration_helper"
-require "tmpdir"
-require "fileutils"
-
-include Chef::Mixin::ConvertToClassName
-
-# Open up Provider so we can write things down easier in here
-# module Chef::Provider
-
-describe Chef::ProviderResolver do
- include IntegrationSupport
-
- # Root the filesystem under a temp directory so Chef.path_to will point at it
- when_the_repository "is empty" do
- before do
- allow(Chef::Resource::DnfPackage).to receive(:which).with("dnf").and_return(nil)
- end
- let(:resource_name) { :service }
- let(:provider) { nil }
- let(:action) { :start }
-
- let(:node) do
- node = Chef::Node.new
- node.automatic[:os] = os
- node.automatic[:platform_family] = platform_family
- node.automatic[:platform] = platform
- node.automatic[:platform_version] = platform_version
- node.automatic[:kernel] = { machine: "i386" }
- node
- end
- let(:run_context) { Chef::RunContext.new(node, nil, nil) }
-
- let(:provider_resolver) { Chef::ProviderResolver.new(node, resource, action) }
- let(:resolved_provider) do
-
- resource ? resource.provider_for_action(action).class : nil
- rescue Chef::Exceptions::ProviderNotFound
- nil
-
- end
-
- let(:service_name) { "test" }
- let(:resource) do
- resource_class = Chef::ResourceResolver.resolve(resource_name, node: node)
- if resource_class
- resource = resource_class.new(service_name, run_context)
- resource.provider = provider if provider
- end
- resource
- end
-
- def self.on_platform(platform, *tags,
- platform_version: "11.0.1",
- platform_family: nil,
- os: nil,
- &block)
- Array(platform).each do |platform|
- Array(platform_version).each do |platform_version|
- on_one_platform(platform, platform_version, platform_family || platform, os || platform_family || platform, *tags, &block)
- end
- end
- end
-
- def self.on_one_platform(platform, platform_version, platform_family, os, *tags, &block)
- describe "on #{platform} #{platform_version}, platform_family: #{platform_family}, os: #{os}", *tags do
- let(:os) { os }
- let(:platform) { platform }
- let(:platform_family) { platform_family }
- let(:platform_version) { platform_version }
-
- define_singleton_method(:os) { os }
- define_singleton_method(:platform) { platform }
- define_singleton_method(:platform_family) { platform_family }
- define_singleton_method(:platform_version) { platform_version }
-
- instance_eval(&block)
- end
- end
-
- def self.expect_providers(**providers)
- providers.each do |name, expected|
- describe name.to_s do
- let(:resource_name) { name }
-
- tags = []
- expected_provider = nil
- expected_resource = nil
- Array(expected).each do |p|
- if p.is_a?(Class) && p <= Chef::Provider
- expected_provider = p
- elsif p.is_a?(Class) && p <= Chef::Resource
- expected_resource = p
- else
- tags << p
- end
- end
-
- if expected_resource && expected_provider
- it "'#{name}' resolves to resource #{expected_resource} and provider #{expected_provider}", *tags do
- expect(resource.class).to eql(expected_resource)
- provider = double(expected_provider, class: expected_provider)
- expect(provider).to receive(:action=).with(action)
- expect(expected_provider).to receive(:new).with(resource, run_context).and_return(provider)
- expect(resolved_provider).to eql(expected_provider)
- end
- elsif expected_provider
- it "'#{name}' resolves to provider #{expected_provider}", *tags do
- provider = double(expected_provider)
- expect(provider).to receive(:action=).with(action)
- expect(expected_provider).to receive(:new).with(resource, run_context).and_return(provider)
- expect(resolved_provider).to eql(expected_provider)
- end
- elsif expected_resource
- it "'#{name}' resolves to resource #{expected_resource}", *tags do
- expect(resource.class).to eql(expected_resource)
- end
- else
- it "'#{name}' fails to resolve (since #{name.inspect} is unsupported on #{platform} #{platform_version})", *tags do
- Chef::Config[:treat_deprecation_warnings_as_errors] = false
- expect(resolved_provider).to be_nil
- end
- end
- end
- end
- end
-
- describe "resolving service resource" do
- def stub_service_providers(*services)
- allowed = %i{debianrcd invokercd insserv upstart redhatrcd systemd}
-
- (allowed - services).each do |api|
- allow(Chef::Provider::Service).to receive(:"#{api}?").and_return(false)
- end
-
- raise ArgumentError unless (services - allowed).empty?
-
- services.each do |api|
- allow(Chef::Provider::Service).to receive(:"#{api}?").and_return(true)
- end
- end
-
- def stub_service_configs(*configs)
- allowed = %i{initd upstart xinetd systemd etc_rcd}
-
- (allowed - configs).each do |type|
- allow(Chef::Provider::Service).to receive(:service_script_exist?).with(type, service_name).and_return(false)
- end
-
- raise ArgumentError unless (configs - allowed).empty?
-
- configs.each do |type|
- allow(Chef::Provider::Service).to receive(:service_script_exist?).with(type, service_name).and_return(true)
- end
- end
-
- shared_examples_for "an ubuntu platform with upstart, update-rc.d and systemd" do
- before do
- stub_service_providers(:debianrcd, :invokercd, :upstart, :systemd)
- end
-
- it "when both the SysV init and Systemd script exists, it returns a Service::Debian provider" do
- stub_service_configs(:initd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
-
- it "when SysV, Upstart, and Systemd scripts exist, it returns a Service::Systemd provider" do
- stub_service_configs(:initd, :upstart, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
-
- it "when both the Upstart and Systemd scripts exists, it returns a Service::Systemd provider" do
- stub_service_configs(:upstart, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
-
- it "when both do not exist, it calls the old style provider resolver and returns a Systemd Provider" do
- stub_service_configs(:systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
-
- it "when only the SysV init script exists, it returns a Service::Systemd provider" do
- stub_service_configs(:initd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
-
- it "when both SysV and Upstart scripts exist, it returns a Service::Systemd provider" do
- stub_service_configs(:initd, :systemd, :upstart)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
-
- it "when only the Upstart script exists, it returns a Service::Upstart provider" do
- stub_service_configs(:upstart)
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
-
- it "when both do not exist, it calls the old style provider resolver and returns a Systemd Provider" do
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
- end
-
- shared_examples_for "an ubuntu platform with upstart and update-rc.d" do
- before do
- stub_service_providers(:debianrcd, :invokercd, :upstart)
- end
-
- # needs to be handled by the highest priority init.d handler
- context "when only the SysV init script exists" do
- before do
- stub_service_configs(:initd)
- end
-
- it "enables init, invokercd, debian and upstart providers" do
- expect(provider_resolver.enabled_handlers).to include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd,
- Chef::Provider::Service::Upstart
- )
- end
-
- it "supports all the enabled handlers except for upstart" do
- expect(provider_resolver.supported_handlers).to include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd
- )
- expect(provider_resolver.supported_handlers).to_not include(
- Chef::Provider::Service::Upstart
- )
- end
-
- it "returns a Service::Debian provider" do
- expect(resolved_provider).to eql(Chef::Provider::Service::Debian)
- end
- end
-
- # on ubuntu this must be handled by upstart, the init script will exit 1 and fail
- context "when both SysV and Upstart scripts exist" do
- before do
- stub_service_configs(:initd, :upstart)
- end
-
- it "enables init, invokercd, debian and upstart providers" do
- expect(provider_resolver.enabled_handlers).to include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd,
- Chef::Provider::Service::Upstart
- )
- end
-
- it "supports all the enabled handlers" do
- expect(provider_resolver.supported_handlers).to include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd,
- Chef::Provider::Service::Upstart
- )
- end
-
- it "returns a Service::Upstart provider" do
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
- end
-
- # this case is a pure-upstart script which is easy
- context "when only the Upstart script exists" do
- before do
- stub_service_configs(:upstart)
- end
-
- it "enables init, invokercd, debian and upstart providers" do
- expect(provider_resolver.enabled_handlers).to include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd,
- Chef::Provider::Service::Upstart
- )
- end
-
- it "supports only the upstart handler" do
- expect(provider_resolver.supported_handlers).to include(
- Chef::Provider::Service::Upstart
- )
- expect(provider_resolver.supported_handlers).to_not include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd
- )
- end
-
- it "returns a Service::Upstart provider" do
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
- end
-
- # this case is important to get correct for why-run when no config is setup
- context "when both do not exist" do
- before do
- stub_service_configs
- end
-
- it "enables init, invokercd, debian and upstart providers" do
- expect(provider_resolver.enabled_handlers).to include(
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd,
- Chef::Provider::Service::Upstart
- )
- end
-
- it "no providers claim to support the resource" do
- expect(provider_resolver.supported_handlers).to_not include(
- Chef::Provider::Service::Upstart,
- Chef::Provider::Service::Debian,
- Chef::Provider::Service::Init,
- Chef::Provider::Service::Invokercd
- )
- end
-
- it "returns a Debian Provider" do
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
- end
- end
-
- shared_examples_for "a debian platform using the insserv provider" do
- context "with a default install" do
- before do
- stub_service_providers(:debianrcd, :invokercd, :insserv)
- end
-
- it "uses the Service::Insserv Provider to manage sysv init scripts" do
- stub_service_configs(:initd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Insserv)
- end
-
- it "uses the Service::Insserv Provider when there is no config" do
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Insserv)
- end
- end
-
- context "when the user has installed upstart" do
- before do
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart)
- end
-
- it "when only the SysV init script exists, it returns an Insserv provider" do
- stub_service_configs(:initd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Insserv)
- end
-
- it "when both SysV and Upstart scripts exist, it returns a Service::Upstart provider" do
- stub_service_configs(:initd, :upstart)
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
-
- it "when only the Upstart script exists, it returns a Service::Upstart provider" do
- stub_service_configs(:upstart)
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
-
- it "when both do not exist, it calls the old style provider resolver and returns a Debian Provider" do
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
- end
- end
- end
-
- on_platform "ubuntu", platform_version: "15.10", platform_family: "debian", os: "linux" do
- it_behaves_like "an ubuntu platform with upstart, update-rc.d and systemd"
-
- it "when the unit-files are missing and system-ctl list-unit-files returns an error" do
- stub_service_providers(:debianrcd, :invokercd, :upstart, :systemd)
- stub_service_configs(:initd, :upstart, :systemd)
- mock_shellout_command("/bin/systemctl list-unit-files", exitstatus: 1)
- expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
- end
- end
-
- on_platform "ubuntu", platform_version: "14.10", platform_family: "debian", os: "linux" do
- it_behaves_like "an ubuntu platform with upstart, update-rc.d and systemd"
- end
-
- on_platform "ubuntu", platform_version: "14.04", platform_family: "debian", os: "linux" do
- it_behaves_like "an ubuntu platform with upstart and update-rc.d"
- end
-
- on_platform "ubuntu", platform_version: "10.04", platform_family: "debian", os: "linux" do
- it_behaves_like "an ubuntu platform with upstart and update-rc.d"
- end
-
- # old debian uses the Debian provider (does not have insserv or upstart, or update-rc.d???)
- on_platform "debian", platform_version: "4.0", os: "linux" do
- # it_behaves_like "a debian platform using the debian provider"
- end
-
- # Debian replaced the debian provider with insserv in the FIXME:VERSION distro
- on_platform "debian", platform_version: "7.0", os: "linux" do
- it_behaves_like "a debian platform using the insserv provider"
- end
-
- on_platform %w{solaris2 openindiana opensolaris nexentacore omnios smartos}, os: "solaris2", platform_version: "5.11" do
- it "returns a Solaris provider" do
- stub_service_providers
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Solaris)
- end
-
- it "always returns a Solaris provider" do
- # no matter what we stub on the next two lines we should get a Solaris provider
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Solaris)
- end
- end
-
- on_platform %w{mswin mingw32 windows}, platform_family: "windows", platform_version: "5.11" do
- it "returns a Windows provider" do
- stub_service_providers
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Windows)
- end
-
- it "always returns a Windows provider" do
- # no matter what we stub on the next two lines we should get a Windows provider
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Windows)
- end
- end
-
- on_platform %w{mac_os_x mac_os_x_server}, os: "darwin", platform_family: "mac_os_x", platform_version: "10.9.2" do
- it "returns a Macosx provider" do
- stub_service_providers
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Macosx)
- end
-
- it "always returns a Macosx provider" do
- # no matter what we stub on the next two lines we should get a Macosx provider
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Macosx)
- end
- end
-
- on_platform "freebsd", os: "freebsd", platform_version: "10.3" do
- it "returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
- stub_service_providers
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "returns a Freebsd provider if it finds the /etc/rc.d initscript" do
- stub_service_providers
- stub_service_configs(:etc_rcd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "always returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "always returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
- # should only care about :etc_rcd stub in the service configs
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:etc_rcd, :initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "always returns a freebsd provider by default?" do
- stub_service_providers
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
- end
-
- on_platform "netbsd", os: "netbsd", platform_version: "7.0.1" do
- it "returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
- stub_service_providers
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "returns a Freebsd provider if it finds the /etc/rc.d initscript" do
- stub_service_providers
- stub_service_configs(:etc_rcd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "always returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "always returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
- # should only care about :etc_rcd stub in the service configs
- stub_service_providers(:debianrcd, :invokercd, :insserv, :upstart, :redhatrcd, :systemd)
- stub_service_configs(:etc_rcd, :initd, :upstart, :xinetd, :systemd)
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
-
- it "always returns a freebsd provider by default?" do
- stub_service_providers
- stub_service_configs
- expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
- end
- end
-
- end
-
- PROVIDERS =
- {
- aix_user: [ Chef::Resource::User::AixUser, Chef::Provider::User::Aix ],
- apt_package: [ Chef::Resource::AptPackage, Chef::Provider::Package::Apt ],
- bash: [ Chef::Resource::Bash, Chef::Provider::Script ],
- bff_package: [ Chef::Resource::BffPackage, Chef::Provider::Package::Bff ],
- breakpoint: [ Chef::Resource::Breakpoint, Chef::Resource::Breakpoint.action_class ],
- chef_gem: [ Chef::Resource::ChefGem, Chef::Provider::Package::Rubygems ],
- cookbook_file: [ Chef::Resource::CookbookFile, Chef::Provider::CookbookFile ],
- csh: [ Chef::Resource::Csh, Chef::Provider::Script ],
- directory: [ Chef::Resource::Directory, Chef::Provider::Directory ],
- dpkg_package: [ Chef::Resource::DpkgPackage, Chef::Provider::Package::Dpkg ],
- dsc_script: [ Chef::Resource::DscScript, Chef::Provider::DscScript ],
- dscl_user: [ Chef::Resource::User::DsclUser, Chef::Provider::User::Dscl ],
- execute: [ Chef::Resource::Execute, Chef::Provider::Execute ],
- file: [ Chef::Resource::File, Chef::Provider::File ],
- gem_package: [ Chef::Resource::GemPackage, Chef::Provider::Package::Rubygems ],
- git: [ Chef::Resource::Git, Chef::Provider::Git ],
- group: [ Chef::Resource::Group, Chef::Provider::Group::Gpasswd ],
- homebrew_package: [ Chef::Resource::HomebrewPackage, Chef::Provider::Package::Homebrew ],
- http_request: [ Chef::Resource::HttpRequest, Chef::Provider::HttpRequest ],
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- ips_package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ],
- link: [ Chef::Resource::Link, Chef::Provider::Link ],
- linux_user: [ Chef::Resource::User::LinuxUser, Chef::Provider::User::Linux ],
- log: [ Chef::Resource::Log ],
- macports_package: [ Chef::Resource::MacportsPackage, Chef::Provider::Package::Macports ],
- mdadm: [ Chef::Resource::Mdadm ],
- mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Mount ],
- pacman_package: [ Chef::Resource::PacmanPackage, Chef::Provider::Package::Pacman ],
- paludis_package: [ Chef::Resource::PaludisPackage, Chef::Provider::Package::Paludis ],
- perl: [ Chef::Resource::Perl, Chef::Provider::Script ],
- portage_package: [ Chef::Resource::PortagePackage, Chef::Provider::Package::Portage ],
- pw_user: [ Chef::Resource::User::PwUser, Chef::Provider::User::Pw ],
- python: [ Chef::Resource::Python, Chef::Provider::Script ],
- remote_directory: [ Chef::Resource::RemoteDirectory, Chef::Provider::RemoteDirectory ],
- route: [ Chef::Resource::Route, Chef::Provider::Route ],
- rpm_package: [ Chef::Resource::Package::RpmPackage, Chef::Provider::Package::Rpm ],
- ruby_block: [ Chef::Resource::RubyBlock, Chef::Provider::RubyBlock ],
- ruby: [ Chef::Resource::Ruby, Chef::Provider::Script ],
- script: [ Chef::Resource::Script, Chef::Provider::Script ],
- smartos_package: [ Chef::Resource::SmartosPackage, Chef::Provider::Package::SmartOS ],
- snap_package: [ Chef::Resource::SnapPackage, Chef::Provider::Package::Snap ],
- solaris_package: [ Chef::Resource::SolarisPackage, Chef::Provider::Package::Solaris ],
- solaris_user: [ Chef::Resource::User::SolarisUser, Chef::Provider::User::Solaris ],
- subversion: [ Chef::Resource::Subversion, Chef::Provider::Subversion ],
- template: [ Chef::Resource::Template, Chef::Provider::Template ],
- whyrun_safe_ruby_block: [ Chef::Resource::WhyrunSafeRubyBlock, Chef::Provider::WhyrunSafeRubyBlock ],
- windows_package: [ Chef::Resource::WindowsPackage, Chef::Provider::Package::Windows ],
- windows_service: [ Chef::Resource::WindowsService, Chef::Provider::Service::Windows ],
- windows_user: [ Chef::Resource::User::WindowsUser, Chef::Provider::User::Windows ],
- yum_package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ],
- build_essential: [ Chef::Resource::BuildEssential ],
-
- "linux" => {
- "debian" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Debian ],
- package: [ Chef::Resource::AptPackage, Chef::Provider::Package::Apt ],
- # service: [ Chef::Resource::DebianService, Chef::Provider::Service::Debian ],
-
- "debian" => {
- "7.0" => {
- },
- "6.0" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ],
- },
- "5.0" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- },
- },
- "gcel" => {
- "3.1.4" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- },
- },
- "linaro" => {
- "3.1.4" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- },
- },
- "linuxmint" => {
- "3.1.4" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ],
- },
- },
- "raspbian" => {
- "3.1.4" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- },
- },
- "ubuntu" => {
- "11.10" => {
- },
- "10.04" => {
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
- },
- },
- },
-
- "arch" => {
- # TODO should be Chef::Resource::PacmanPackage
- package: [ Chef::Resource::Package, Chef::Provider::Package::Pacman ],
-
- "arch" => {
- "3.1.4" => {
- },
- },
- },
-
- "suse" => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Gpasswd ],
- "suse" => {
- "12.0" => {
- },
- %w{11.1 11.2 11.3} => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ],
- },
- },
- "opensuseleap" => {
- %w{42.3} => {
- package: [ Chef::Resource::ZypperPackage, Chef::Provider::Package::Zypper ],
- group: [ Chef::Resource::Group, Chef::Provider::Group::Gpasswd ],
- },
- },
- },
-
- "gentoo" => {
- # TODO should be Chef::Resource::PortagePackage
- package: [ Chef::Resource::Package, Chef::Provider::Package::Portage ],
- portage_package: [ Chef::Resource::PortagePackage, Chef::Provider::Package::Portage ],
- # service: [ Chef::Resource::GentooService, Chef::Provider::Service::Gentoo ],
-
- "gentoo" => {
- "3.1.4" => {
- },
- },
- },
-
- "rhel" => {
- # service: [ Chef::Resource::SystemdService, Chef::Provider::Service::Systemd ],
- package: [ Chef::Resource::DnfPackage, Chef::Provider::Package::Dnf ],
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Redhat ],
-
- %w{amazon xcp xenserver ibm_powerkvm cloudlinux parallels} => {
- "3.1.4" => {
- package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ],
- # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
- },
- },
- %w{redhat centos scientific oracle} => {
- "7.0" => {
- package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ],
- },
- "6.0" => {
- package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ],
- # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
- },
- },
- "fedora" => {
- "15.0" => {
- },
- "14.0" => {
- # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
- },
- },
- },
-
- },
-
- "freebsd" => {
- "freebsd" => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Pw ],
- user: [ Chef::Resource::User::PwUser, Chef::Provider::User::Pw ],
-
- "freebsd" => {
- "10.3" => {
- },
- },
- },
- },
-
- "darwin" => {
- %w{mac_os_x mac_os_x_server} => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Dscl ],
- package: [ Chef::Resource::HomebrewPackage, Chef::Provider::Package::Homebrew ],
- osx_profile: [ Chef::Resource::OsxProfile],
- user: [ Chef::Resource::User::DsclUser, Chef::Provider::User::Dscl ],
-
- "mac_os_x" => {
- "10.9.2" => {
- },
- },
- },
- },
-
- "windows" => {
- batch: [ Chef::Resource::Batch, Chef::Provider::Batch ],
- dsc_script: [ Chef::Resource::DscScript, Chef::Provider::DscScript ],
- windows_env: [ Chef::Resource::WindowsEnv, Chef::Provider::WindowsEnv ],
- group: [ Chef::Resource::Group, Chef::Provider::Group::Windows ],
- mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Windows ],
- package: [ Chef::Resource::WindowsPackage, Chef::Provider::Package::Windows ],
- powershell_script: [ Chef::Resource::PowershellScript, Chef::Provider::PowershellScript ],
- service: [ Chef::Resource::WindowsService, Chef::Provider::Service::Windows ],
- user: [ Chef::Resource::User::WindowsUser, Chef::Provider::User::Windows ],
- windows_package: [ Chef::Resource::WindowsPackage, Chef::Provider::Package::Windows ],
- windows_service: [ Chef::Resource::WindowsService, Chef::Provider::Service::Windows ],
-
- "windows" => {
- %w{mswin mingw32 windows} => {
- "10.9.2" => {
- },
- },
- },
- },
-
- "aix" => {
- cron: [ Chef::Resource::Cron, Chef::Provider::Cron::Aix ],
- group: [ Chef::Resource::Group, Chef::Provider::Group::Aix ],
- ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Aix ],
- mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Aix ],
- package: [ Chef::Resource::Package, Chef::Provider::Package::Bff ],
- rpm_package: [ Chef::Resource::RpmPackage, Chef::Provider::Package::Rpm ],
- user: [ Chef::Resource::User::AixUser, Chef::Provider::User::Aix ],
- # service: [ Chef::Resource::AixService, Chef::Provider::Service::Aix ],
-
- "aix" => {
- "aix" => {
- "5.6" => {
- },
- },
- },
- },
-
- "netbsd" => {
- "netbsd" => {
- "netbsd" => {
- "3.1.4" => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ],
- },
- },
- },
- },
-
- "openbsd" => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ],
- package: [ Chef::Resource::OpenbsdPackage, Chef::Provider::Package::Openbsd ],
-
- "openbsd" => {
- "openbsd" => {
- "3.1.4" => {
- },
- },
- },
- },
-
- "solaris2" => {
- group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ],
- ips_package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ],
- package: [ Chef::Resource::SolarisPackage, Chef::Provider::Package::Solaris ],
- mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Solaris ],
- solaris_package: [ Chef::Resource::SolarisPackage, Chef::Provider::Package::Solaris ],
-
- "smartos" => {
- smartos_package: [ Chef::Resource::SmartosPackage, Chef::Provider::Package::SmartOS ],
- package: [ Chef::Resource::SmartosPackage, Chef::Provider::Package::SmartOS ],
-
- "smartos" => {
- "3.1.4" => {
- },
- },
- },
-
- "solaris2" => {
- "nexentacore" => {
- "3.1.4" => {
- },
- },
- "omnios" => {
- "3.1.4" => {
- user: [ Chef::Resource::User::SolarisUser, Chef::Provider::User::Solaris ],
- },
- },
- "openindiana" => {
- "3.1.4" => {
- },
- },
- "opensolaris" => {
- "3.1.4" => {
- },
- },
- "solaris2" => {
- user: [ Chef::Resource::User::SolarisUser, Chef::Provider::User::Solaris ],
- "5.11" => {
- package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ],
- group: [ Chef::Resource::Group, Chef::Provider::Group::Solaris ],
- },
- },
- },
-
- },
-
- "exherbo" => {
- "exherbo" => {
- "exherbo" => {
- "3.1.4" => {
- # TODO should be Chef::Resource::PaludisPackage
- package: [ Chef::Resource::Package, Chef::Provider::Package::Paludis ],
- },
- },
- },
- },
- }.freeze
-
- def self.create_provider_tests(providers, test, expected, filter)
- expected = expected.merge(providers.select { |key, value| key.is_a?(Symbol) })
- providers.each do |key, value|
- unless key.is_a?(Symbol)
- next_test = test.merge({ filter => key })
- next_filter =
- case filter
- when :os
- :platform_family
- when :platform_family
- :platform
- when :platform
- :platform_version
- when :platform_version
- nil
- else
- raise "Hash too deep; only os, platform_family, platform and platform_version supported"
- end
- create_provider_tests(value, next_test, expected, next_filter)
- end
- end
- # If there is no filter, we're as deep as we need to go
- unless filter
- on_platform test.delete(:platform), **test do
- expect_providers(**expected)
- end
- end
- end
-
- create_provider_tests(PROVIDERS, {}, {}, :os)
- end
-end
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 9df46b46e2..ffa7025e3f 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -25,7 +25,7 @@ require "chef/platform/resource_priority_map"
describe Chef::Recipe do
let(:cookbook_collection) do
- cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks"))
+ cookbook_repo = File.expand_path(File.join(__dir__, "..", "data", "cookbooks"))
cookbook_loader = Chef::CookbookLoader.new(cookbook_repo)
cookbook_loader.load_cookbooks
Chef::CookbookCollection.new(cookbook_loader)
diff --git a/spec/unit/resource/breakpoint_spec.rb b/spec/unit/resource/breakpoint_spec.rb
index 0804c27cab..4b1aed6f8e 100644
--- a/spec/unit/resource/breakpoint_spec.rb
+++ b/spec/unit/resource/breakpoint_spec.rb
@@ -58,7 +58,7 @@ describe Chef::Resource::Breakpoint do
it "names itself after the line number of the file where it's created" do
resource = Chef::Resource::Breakpoint.new
- expect(resource.name).to match(/breakpoint_spec\.rb\:[\d]{2}\:in \`new\'$/)
+ expect(resource.name).to match(/breakpoint_spec\.rb\:\d{2}\:in \`new\'$/)
end
end
diff --git a/spec/unit/resource/build_essential_spec.rb b/spec/unit/resource/build_essential_spec.rb
index 547b4dfc3c..f366ceb557 100644
--- a/spec/unit/resource/build_essential_spec.rb
+++ b/spec/unit/resource/build_essential_spec.rb
@@ -57,18 +57,6 @@ describe Chef::Resource::BuildEssential do
end
end
- describe "#xcode_cli_installed?" do
- it "returns true if the CLI is in the InstallHistory plist" do
- allow(::File).to receive(:open).with("/Library/Receipts/InstallHistory.plist", "r").and_return(::File.join(::File.dirname(__FILE__), "data/InstallHistory_with_CLT.plist"))
- expect(provider.xcode_cli_installed?).to eql(true)
- end
-
- it "returns false if the pkgutil doesn't list the package" do
- allow(::File).to receive(:open).with("/Library/Receipts/InstallHistory.plist", "r").and_return(::File.join(::File.dirname(__FILE__), "data/InstallHistory_without_CLT.plist"))
- expect(provider.xcode_cli_installed?).to eql(false)
- end
- end
-
describe "#xcode_cli_package_label" do
it "returns a package name on macOS < 10.15" do
allow(provider).to receive(:shell_out).with("softwareupdate", "--list").and_return(softwareupdate_pre_catalina)
diff --git a/spec/unit/resource/chef_client_config_spec.rb b/spec/unit/resource/chef_client_config_spec.rb
new file mode 100644
index 0000000000..7e6d7a5c5c
--- /dev/null
+++ b/spec/unit/resource/chef_client_config_spec.rb
@@ -0,0 +1,137 @@
+#
+# Author:: Tim Smith (<tsmith@chef.io>)
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::ChefClientConfig do
+ let(:node) { Chef::Node.new }
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
+ let(:run_context) { Chef::RunContext.new(node, {}, events) }
+ let(:resource) { Chef::Resource::ChefClientConfig.new("fakey_fakerton", run_context) }
+ let(:provider) { resource.provider_for_action(:create) }
+
+ it "sets the default action as :create" do
+ expect(resource.action).to eql([:create])
+ end
+
+ it "supports :create and :remove actions" do
+ expect { resource.action :create }.not_to raise_error
+ expect { resource.action :remove }.not_to raise_error
+ end
+
+ describe "ssl_verify_mode property" do
+ it "coerces String to Symbol" do
+ resource.ssl_verify_mode "verify_peer"
+ expect(resource.ssl_verify_mode).to eql(:verify_peer)
+ end
+
+ it "coerces Symbol-like String to Symbol" do
+ resource.ssl_verify_mode ":verify_peer"
+ expect(resource.ssl_verify_mode).to eql(:verify_peer)
+ end
+
+ it "raises an error if it is not an allowed value" do
+ expect { resource.ssl_verify_mode("foo") }.to raise_error(Chef::Exceptions::ValidationFailed)
+ expect { resource.ssl_verify_mode(:verify_none) }.not_to raise_error
+ expect { resource.ssl_verify_mode(:verify_peer) }.not_to raise_error
+ end
+ end
+
+ describe "no_proxy property" do
+ it "coerces Array into comma separated list" do
+ resource.no_proxy ["something.com", "example.com"]
+ expect(resource.no_proxy).to eql("something.com,example.com")
+ end
+
+ it "accepts String of comma separated values" do
+ resource.no_proxy "something.com,example.com"
+ expect(resource.no_proxy).to eql("something.com,example.com")
+ end
+ end
+
+ describe "ohai_disabled_plugins property" do
+ it "coerces String values into capitalized symbols" do
+ resource.ohai_disabled_plugins %w{foo Bar}
+ expect(resource.ohai_disabled_plugins).to eql(%i{Foo Bar})
+ end
+
+ it "coerces symbol-like string values into capitalized Symbols" do
+ resource.ohai_disabled_plugins [":foo", ":Bar"]
+ expect(resource.ohai_disabled_plugins).to eql(%i{Foo Bar})
+ end
+
+ it "coerces Symbol values into capitalized Symbols" do
+ resource.ohai_disabled_plugins %i{foo Bar}
+ expect(resource.ohai_disabled_plugins).to eql(%i{Foo Bar})
+ end
+ end
+
+ describe "ohai_optional_plugins property" do
+ it "coerces String values into capitalized symbols" do
+ resource.ohai_optional_plugins %w{foo Bar}
+ expect(resource.ohai_optional_plugins).to eql(%i{Foo Bar})
+ end
+
+ it "coerces symbol-like string values into capitalized Symbols" do
+ resource.ohai_optional_plugins [":foo", ":Bar"]
+ expect(resource.ohai_optional_plugins).to eql(%i{Foo Bar})
+ end
+
+ it "coerces Symbol values into capitalized Symbols" do
+ resource.ohai_optional_plugins %i{foo Bar}
+ expect(resource.ohai_optional_plugins).to eql(%i{Foo Bar})
+ end
+ end
+
+ describe "log_level property" do
+ it "accepts auto trace debug info warn fatal" do
+ expect { resource.log_level(:auto) }.not_to raise_error
+ expect { resource.log_level(:trace) }.not_to raise_error
+ expect { resource.log_level(:debug) }.not_to raise_error
+ expect { resource.log_level(:info) }.not_to raise_error
+ expect { resource.log_level(:warn) }.not_to raise_error
+ end
+
+ it "raises an error if an invalid value is passed" do
+ expect { resource.log_level(":foo") }.to raise_error(Chef::Exceptions::ValidationFailed)
+ end
+ end
+
+ describe "log_location property" do
+ it "accepts a String logfile location" do
+ expect { resource.log_location("/foo/bar/") }.not_to raise_error
+ end
+
+ it "accepts a String form of STDOUT/STDERR" do
+ expect { resource.log_location("STDOUT") }.not_to raise_error
+ expect { resource.log_location("STDERR") }.not_to raise_error
+ end
+
+ it "accepts :syslog or :win_evt Symbols" do
+ expect { resource.log_location(:syslog) }.not_to raise_error
+ expect { resource.log_location(:win_evt) }.not_to raise_error
+ expect { resource.log_location(:nope) }.to raise_error(Chef::Exceptions::ValidationFailed)
+ end
+ end
+
+ describe "#format_handler" do
+ it "provides an array of handler object creation code" do
+ expect(provider.format_handler([{ "class" => "Foo", "arguments" => ["'one'", "two", "three"] }])).to eql(["Foo.new('one',two,three)"])
+ end
+ end
+end
diff --git a/spec/unit/resource/chef_client_systemd_timer_spec.rb b/spec/unit/resource/chef_client_systemd_timer_spec.rb
index 1866060530..dfe01973fb 100644
--- a/spec/unit/resource/chef_client_systemd_timer_spec.rb
+++ b/spec/unit/resource/chef_client_systemd_timer_spec.rb
@@ -33,6 +33,12 @@ describe Chef::Resource::ChefClientSystemdTimer do
expect(resource.user).to eql("root")
end
+ it "validates the cpu_quota property input" do
+ expect { resource.cpu_quota(0) }.to raise_error(Chef::Exceptions::ValidationFailed)
+ expect { resource.cpu_quota(50) }.not_to raise_error
+ expect { resource.cpu_quota(101) }.not_to raise_error
+ end
+
it "builds a default value for chef_binary_path dist values" do
expect(resource.chef_binary_path).to eql("/opt/chef/bin/chef-client")
end
@@ -70,4 +76,33 @@ describe Chef::Resource::ChefClientSystemdTimer do
expect(provider.chef_client_cmd).to eql("/opt/chef/bin/chef-client --chef-license accept -c #{root_path}")
end
end
-end
+
+ describe "#service_content" do
+ it "does not set ConditionACPower if run_on_battery property is set to true (the default)" do
+ expect(provider.service_content["Service"]).not_to have_key("ConditionACPower")
+ end
+
+ it "sets ConditionACPower if run_on_battery property is set to false" do
+ resource.run_on_battery false
+ expect(provider.service_content["Service"]["ConditionACPower"]).to eq("true")
+ end
+
+ it "does not set Environment if environment property is empty" do
+ expect(provider.service_content["Service"]).not_to have_key("Environment")
+ end
+
+ it "sets Environment if environment property is set" do
+ resource.environment({ "foo" => "bar" })
+ expect(provider.service_content["Service"]["Environment"]).to eq(["\"foo=bar\""])
+ end
+
+ it "does not set CPUQuota if cpu_quota property is not set" do
+ expect(provider.service_content["Service"]).not_to have_key("CPUQuota")
+ end
+
+ it "sets CPUQuota if cpu_quota property is set" do
+ resource.cpu_quota 50
+ expect(provider.service_content["Service"]["CPUQuota"]).to eq(50)
+ end
+ end
+end \ No newline at end of file
diff --git a/spec/unit/resource/data/InstallHistory_with_CLT.plist b/spec/unit/resource/data/InstallHistory_with_CLT.plist
deleted file mode 100644
index 402c8f344d..0000000000
--- a/spec/unit/resource/data/InstallHistory_with_CLT.plist
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<array>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-10-07T20:09:37Z</date>
- <key>displayName</key>
- <string>XProtectPlistConfigData</string>
- <key>displayVersion</key>
- <string>2106</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.XProtectPlistConfigData_10_15.16U4081</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-10-07T20:09:37Z</date>
- <key>displayName</key>
- <string>Gatekeeper Configuration Data</string>
- <key>displayVersion</key>
- <string>181</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.GatekeeperConfigData.16U1873</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-10-07T20:09:37Z</date>
- <key>displayName</key>
- <string>MRTConfigData</string>
- <key>displayVersion</key>
- <string>1.50</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.MRTConfigData_10_15.16U4082</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>date</key>
- <date>2019-10-09T02:37:33Z</date>
- <key>displayName</key>
- <string>Chef Infra Client</string>
- <key>displayVersion</key>
- <string></string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.getchef.pkg.chef</string>
- </array>
- <key>processName</key>
- <string>installer</string>
- </dict>
- <dict>
- <key>date</key>
- <date>2019-10-09T02:47:02Z</date>
- <key>displayName</key>
- <string>Command Line Tools for Xcode</string>
- <key>displayVersion</key>
- <string>11.0</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.CLTools_Executables</string>
- <string>com.apple.pkg.CLTools_SDK_macOS1015</string>
- <string>com.apple.pkg.CLTools_SDK_macOS1014</string>
- <string>com.apple.pkg.CLTools_macOS_SDK</string>
- <string>com.apple.pkg.DevSDK</string>
- <string>com.apple.pkg.DevSDK_OSX109</string>
- <string>com.apple.pkg.DevSDK_OSX1010</string>
- <string>com.apple.pkg.DevSDK_OSX1011</string>
- <string>com.apple.pkg.DevSDK_OSX1012</string>
- <string>com.apple.pkg.DevSDK_macOS1013_Public</string>
- <string>com.apple.pkg.macOS_SDK_headers_for_macOS_10.14</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
-</array>
-</plist>
diff --git a/spec/unit/resource/data/InstallHistory_without_CLT.plist b/spec/unit/resource/data/InstallHistory_without_CLT.plist
deleted file mode 100644
index 2cc10d63ff..0000000000
--- a/spec/unit/resource/data/InstallHistory_without_CLT.plist
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<array>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-09-30T20:36:29Z</date>
- <key>displayName</key>
- <string>Gatekeeper Configuration Data</string>
- <key>displayVersion</key>
- <string>181</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.GatekeeperConfigData.16U1873</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-09-30T20:36:29Z</date>
- <key>displayName</key>
- <string>MRTConfigData</string>
- <key>displayVersion</key>
- <string>1.49</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.MRTConfigData_10_15.16U4080</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
-</array>
-</plist>
diff --git a/spec/unit/resource/ifconfig_spec.rb b/spec/unit/resource/ifconfig_spec.rb
index 3221d0b864..bc018baee6 100644
--- a/spec/unit/resource/ifconfig_spec.rb
+++ b/spec/unit/resource/ifconfig_spec.rb
@@ -90,19 +90,11 @@ describe Chef::Resource::Ifconfig do
it_should_behave_like "being a platform based on RedHat", "redhat", "4.0"
end
- describe "when it is an old Debian platform" do
- it_should_behave_like "being a platform based on an old Debian", "debian", "6.0"
- end
-
- describe "when it is a new Debian platform" do
+ describe "when it is a Debian platform" do
it_should_behave_like "being a platform based on a recent Debian", "debian", "7.0"
end
- describe "when it is an old Ubuntu platform" do
- it_should_behave_like "being a platform based on an old Debian", "ubuntu", "11.04"
- end
-
- describe "when it is a new Ubuntu platform" do
+ describe "when it is a Ubuntu platform" do
it_should_behave_like "being a platform based on a recent Debian", "ubuntu", "11.10"
end
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index b58777ccca..c9800f1381 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -49,9 +49,18 @@ describe Chef::Resource::Mount do
expect(resource.mount_point).to eql("U:")
end
+ it "splits strings passed to the mount_point property" do
+ resource.mount_point "U:"
+ expect(resource.mount_point).to eql("U:")
+ end
+
+ it "strips trailing slashes from mount_point values" do
+ resource.mount_point "//192.168.11.102/Share/backup/"
+ expect(resource.mount_point).to eql("//192.168.11.102/Share/backup")
+ end
+
it "raises error when mount_point property is not set" do
- resource.mount_point nil
- expect { resource.mounted("poop") }.to raise_error(ArgumentError)
+ expect { resource.mount_point nil }.to raise_error(Chef::Exceptions::ValidationFailed, "Property mount_point must be one of: String! You passed nil.")
end
it "sets fsck_device to '-' by default" do
@@ -88,12 +97,17 @@ describe Chef::Resource::Mount do
it "allows options to be sent as a string, and convert to array" do
resource.options "rw,noexec"
- expect(resource.options).to be_a_kind_of(Array)
+ expect(resource.options).to eql(%w{rw noexec})
+ end
+
+ it "strips whitespace around options in a comma deliminated string" do
+ resource.options "rw, noexec"
+ expect(resource.options).to eql(%w{rw noexec})
end
it "allows options property as an array" do
resource.options %w{ro nosuid}
- expect(resource.options).to be_a_kind_of(Array)
+ expect(resource.options).to eql(%w{ro nosuid})
end
it "allows options to be sent as a delayed evaluator" do
@@ -103,7 +117,6 @@ describe Chef::Resource::Mount do
it "allows options to be sent as a delayed evaluator, and convert to array" do
resource.options Chef::DelayedEvaluator.new { "rw,noexec" }
- expect(resource.options).to be_a_kind_of(Array)
expect(resource.options).to eql(%w{rw noexec})
end
diff --git a/spec/unit/resource/osx_profile_spec.rb b/spec/unit/resource/osx_profile_spec.rb
index 7e2173f823..c6909a842d 100644
--- a/spec/unit/resource/osx_profile_spec.rb
+++ b/spec/unit/resource/osx_profile_spec.rb
@@ -102,6 +102,72 @@ describe Chef::Resource::OsxProfile do
"ProfileVersion" => 1 }],
}
end
+ let(:profile_raw_xml) do
+ <<~OUT
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ <key>tsmith</key>
+ <array>
+ <dict>
+ <key>ProfileDisplayName</key>
+ <string>Screensaver Settings</string>
+ <key>ProfileIdentifier</key>
+ <string>com.company.screensaver</string>
+ <key>ProfileInstallDate</key>
+ <string>2020-09-17 17:20:49 +0000</string>
+ <key>ProfileItems</key>
+ <array>
+ <dict>
+ <key>PayloadContent</key>
+ <dict>
+ <key>PayloadContentManagedPreferences</key>
+ <dict>
+ <key>com.apple.screensaver</key>
+ <dict>
+ <key>Forced</key>
+ <array>
+ <dict>
+ <key>mcx_preference_settings</key>
+ <dict>
+ <key>idleTime</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ </dict>
+ <key>PayloadDisplayName</key>
+ <string>com.apple.screensaver</string>
+ <key>PayloadIdentifier</key>
+ <string>com.company.screensaver</string>
+ <key>PayloadType</key>
+ <string>com.apple.ManagedClient.preferences</string>
+ <key>PayloadUUID</key>
+ <string>73fc30e0-1e57-0131-c32d-000c2944c108</string>
+ <key>PayloadVersion</key>
+ <integer>1</integer>
+ </dict>
+ </array>
+ <key>ProfileOrganization</key>
+ <string>Chef</string>
+ <key>ProfileType</key>
+ <string>Configuration</string>
+ <key>ProfileUUID</key>
+ <string>ed5e36c8-ea0b-5960-8f49-3c7d9121687e</string>
+ <key>ProfileVersion</key>
+ <integer>1</integer>
+ </dict>
+ </array>
+ </dict>
+ </plist>
+ OUT
+ end
+ let(:shell_out_profiles) do
+ double("shell_out", exitstatus: 0, error?: false, stdout: profile_raw_xml)
+ end
# If anything is changed within this profile, be sure to update the
# ProfileUUID in all_profiles to match the new config specific UUID
let(:test_profile) do
@@ -155,7 +221,7 @@ describe Chef::Resource::OsxProfile do
resource.profile_name profile_name
allow(provider).to receive(:get_installed_profiles).and_call_original
allow(provider).to receive(:read_plist).and_return(all_profiles)
- expect(provider).to receive(:shell_out_compacted).with("/usr/bin/profiles", "-P", "-o", kind_of(String))
+ expect(provider).to receive(:shell_out_compacted).with("/usr/bin/profiles", "-P", "-o", "stdout-xml").and_return(shell_out_profiles)
provider.load_current_resource
end
diff --git a/spec/unit/resource/powershell_package_source_spec.rb b/spec/unit/resource/powershell_package_source_spec.rb
index 2640d9f3c5..1032902a0f 100644
--- a/spec/unit/resource/powershell_package_source_spec.rb
+++ b/spec/unit/resource/powershell_package_source_spec.rb
@@ -87,58 +87,58 @@ describe Chef::Resource::PowershellPackageSource do
context "#register" do
it "builds a minimal command" do
- expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted'")
+ expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' | Out-Null")
end
it "builds a command with trusted set to true" do
resource.trusted(true)
- expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Trusted'")
+ expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Trusted' | Out-Null")
end
it "builds a command with a publish location" do
resource.publish_location("https://mygallery.company.co/api/v2/package")
- expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -PublishLocation 'https://mygallery.company.co/api/v2/package'")
+ expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -PublishLocation 'https://mygallery.company.co/api/v2/package' | Out-Null")
end
it "builds a command with a script source location" do
resource.script_source_location("https://mygallery.company.co/api/v2/scripts")
- expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptSourceLocation 'https://mygallery.company.co/api/v2/scripts'")
+ expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptSourceLocation 'https://mygallery.company.co/api/v2/scripts' | Out-Null")
end
it "builds a command with a script publish location" do
resource.script_publish_location("https://mygallery.company.co/api/v2/scripts/package")
- expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptPublishLocation 'https://mygallery.company.co/api/v2/scripts/package'")
+ expect(provider.build_ps_repository_command("Register", resource)).to eql("Register-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptPublishLocation 'https://mygallery.company.co/api/v2/scripts/package' | Out-Null")
end
end
context "#set" do
it "builds a minimal command" do
- expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted'")
+ expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' | Out-Null")
end
it "builds a command to change the url" do
resource.url("https://othergallery.company.co/api/v2/")
- expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://othergallery.company.co/api/v2/' -InstallationPolicy 'Untrusted'")
+ expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://othergallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' | Out-Null")
end
it "builds a command with trusted set to true" do
resource.trusted(true)
- expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Trusted'")
+ expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Trusted' | Out-Null")
end
it "builds a command with a publish location" do
resource.publish_location("https://mygallery.company.co/api/v2/package")
- expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -PublishLocation 'https://mygallery.company.co/api/v2/package'")
+ expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -PublishLocation 'https://mygallery.company.co/api/v2/package' | Out-Null")
end
it "builds a command with a script source location" do
resource.script_source_location("https://mygallery.company.co/api/v2/scripts")
- expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptSourceLocation 'https://mygallery.company.co/api/v2/scripts'")
+ expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptSourceLocation 'https://mygallery.company.co/api/v2/scripts' | Out-Null")
end
it "builds a command with a script publish location" do
resource.script_publish_location("https://mygallery.company.co/api/v2/scripts/package")
- expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptPublishLocation 'https://mygallery.company.co/api/v2/scripts/package'")
+ expect(provider.build_ps_repository_command("Set", resource)).to eql("Set-PSRepository -Name 'MyGallery' -SourceLocation 'https://mygallery.company.co/api/v2/' -InstallationPolicy 'Untrusted' -ScriptPublishLocation 'https://mygallery.company.co/api/v2/scripts/package' | Out-Null")
end
end
end
@@ -151,42 +151,42 @@ describe Chef::Resource::PowershellPackageSource do
context "#register" do
it "builds a minimal command" do
- expect(provider.build_package_source_command("Register", resource)).to eql("Register-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$false -ProviderName 'NuGet'")
+ expect(provider.build_package_source_command("Register", resource)).to eql("Register-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$false -ProviderName 'NuGet' | Out-Null")
end
it "builds a command with trusted set to true" do
resource.trusted(true)
- expect(provider.build_package_source_command("Register", resource)).to eql("Register-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$true -ProviderName 'NuGet'")
+ expect(provider.build_package_source_command("Register", resource)).to eql("Register-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$true -ProviderName 'NuGet' | Out-Null")
end
it "builds a command with a different provider" do
resource.source_name("choco")
resource.url("https://chocolatey.org/api/v2/")
resource.provider_name("chocolatey")
- expect(provider.build_package_source_command("Register", resource)).to eql("Register-PackageSource -Name 'choco' -Location 'https://chocolatey.org/api/v2/' -Trusted:$false -ProviderName 'chocolatey'")
+ expect(provider.build_package_source_command("Register", resource)).to eql("Register-PackageSource -Name 'choco' -Location 'https://chocolatey.org/api/v2/' -Trusted:$false -ProviderName 'chocolatey' | Out-Null")
end
end
context "#set" do
it "builds a minimal command" do
- expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$false -ProviderName 'NuGet'")
+ expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$false -ProviderName 'NuGet' | Out-Null")
end
it "builds a command to change the url" do
resource.url("https://nuget.company.co/api/v2/")
- expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'NuGet' -Location 'https://nuget.company.co/api/v2/' -Trusted:$false -ProviderName 'NuGet'")
+ expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'NuGet' -Location 'https://nuget.company.co/api/v2/' -Trusted:$false -ProviderName 'NuGet' | Out-Null")
end
it "builds a command with trusted set to true" do
resource.trusted(true)
- expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$true -ProviderName 'NuGet'")
+ expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'NuGet' -Location 'http://nuget.org/api/v2/' -Trusted:$true -ProviderName 'NuGet' | Out-Null")
end
it "builds a command with a different provider" do
resource.source_name("choco")
resource.url("https://chocolatey.org/api/v2/")
resource.provider_name("chocolatey")
- expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'choco' -Location 'https://chocolatey.org/api/v2/' -Trusted:$false -ProviderName 'chocolatey'")
+ expect(provider.build_package_source_command("Set", resource)).to eql("Set-PackageSource -Name 'choco' -Location 'https://chocolatey.org/api/v2/' -Trusted:$false -ProviderName 'chocolatey' | Out-Null")
end
end
end
@@ -205,13 +205,13 @@ describe Chef::Resource::PowershellPackageSource do
describe "#package_source_exists?" do
it "returns true if it exists" do
- allow(provider).to receive(:powershell_out!).with("(Get-PackageSource -Name 'MyGallery' -WarningAction SilentlyContinue).Name").and_return(double("powershell_out!", stdout: "MyGallery\r\n"))
+ allow(provider).to receive(:powershell_exec!).with("(Get-PackageSource -Name 'MyGallery' -ErrorAction SilentlyContinue).Name").and_return(double("powershell_exec!", result: "MyGallery\r\n"))
resource.source_name("MyGallery")
expect(provider.package_source_exists?).to eql(true)
end
it "returns false if it doesn't exist" do
- allow(provider).to receive(:powershell_out!).with("(Get-PackageSource -Name 'MyGallery' -WarningAction SilentlyContinue).Name").and_return(double("powershell_out!", stdout: ""))
+ allow(provider).to receive(:powershell_exec!).with("(Get-PackageSource -Name 'MyGallery' -ErrorAction SilentlyContinue).Name").and_return(double("powershell_exec!", result: ""))
resource.source_name("MyGallery")
expect(provider.package_source_exists?).to eql(false)
end
diff --git a/spec/unit/resource/powershell_script_spec.rb b/spec/unit/resource/powershell_script_spec.rb
index 9bc91204be..a913583cfa 100644
--- a/spec/unit/resource/powershell_script_spec.rb
+++ b/spec/unit/resource/powershell_script_spec.rb
@@ -47,81 +47,11 @@ describe Chef::Resource::PowershellScript do
expect(resource.convert_boolean_return).to eq(false)
end
- context "when using guards" do
- before(:each) do
- allow(resource).to receive(:run_action)
- allow(resource).to receive(:updated).and_return(true)
- end
+ it "inherits exactly the :cwd, :domain, :environment, :group, :password, :path, :user, :umask, :architecture, :elevated, :interpreter properties from a parent resource class" do
+ inherited_difference = Chef::Resource::PowershellScript.guard_inherited_attributes -
+ %i{cwd domain environment group password path user umask architecture elevated interpreter}
- it "inherits exactly the :cwd, :environment, :group, :path, :user, :umask, :architecture, :elevated properties from a parent resource class" do
- inherited_difference = Chef::Resource::PowershellScript.guard_inherited_attributes -
- %i{cwd environment group path user umask architecture elevated}
-
- expect(inherited_difference).to eq([])
- end
-
- it "allows guard interpreter to be set to Chef::Resource::Script" do
- resource.guard_interpreter(:script)
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
- resource.only_if("echo hi")
- end
-
- it "allows guard interpreter to be set to Chef::Resource::Bash derived from Chef::Resource::Script" do
- resource.guard_interpreter(:bash)
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
- resource.only_if("echo hi")
- end
-
- it "allows guard interpreter to be set to Chef::Resource::PowershellScript derived indirectly from Chef::Resource::Script" do
- resource.guard_interpreter(:powershell_script)
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
- resource.only_if("echo hi")
- end
-
- it "enables convert_boolean_return by default for guards in the context of powershell_script when no guard params are specified" do
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(true)
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with(
- { convert_boolean_return: true, code: "$true" }
- ).and_return(Proc.new {})
- resource.only_if("$true")
- end
-
- it "enables convert_boolean_return by default for guards in non-Chef::Resource::Script derived resources when no guard params are specified" do
- node = Chef::Node.new
- run_context = Chef::RunContext.new(node, nil, nil)
- file_resource = Chef::Resource::File.new("idontexist", run_context)
- file_resource.guard_interpreter :powershell_script
-
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with(
- { convert_boolean_return: true, code: "$true" }
- ).and_return(Proc.new {})
- resource.only_if("$true")
- end
-
- it "enables convert_boolean_return by default for guards in the context of powershell_script when guard params are specified" do
- guard_parameters = { cwd: "/etc/chef", architecture: :x86_64 }
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with(
- { convert_boolean_return: true, code: "$true" }.merge(guard_parameters)
- ).and_return(Proc.new {})
- resource.only_if("$true", guard_parameters)
- end
-
- it "passes convert_boolean_return as true if it was specified as true in a guard parameter" do
- guard_parameters = { cwd: "/etc/chef", convert_boolean_return: true, architecture: :x86_64 }
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with(
- { convert_boolean_return: true, code: "$true" }.merge(guard_parameters)
- ).and_return(Proc.new {})
- resource.only_if("$true", guard_parameters)
- end
-
- it "passes convert_boolean_return as false if it was specified as true in a guard parameter" do
- other_guard_parameters = { cwd: "/etc/chef", architecture: :x86_64 }
- parameters_with_boolean_disabled = other_guard_parameters.merge({ convert_boolean_return: false, code: "$true" })
- allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with(
- parameters_with_boolean_disabled
- ).and_return(Proc.new {})
- resource.only_if("$true", parameters_with_boolean_disabled)
- end
+ expect(inherited_difference).to eq([])
end
context "as a script running in Windows-based scripting language" do
diff --git a/spec/unit/resource/rhsm_register_spec.rb b/spec/unit/resource/rhsm_register_spec.rb
index 79cf694b5f..7ce76ad908 100644
--- a/spec/unit/resource/rhsm_register_spec.rb
+++ b/spec/unit/resource/rhsm_register_spec.rb
@@ -41,23 +41,34 @@ describe Chef::Resource::RhsmRegister do
end
describe "#katello_cert_rpm_installed?" do
- let(:cmd) { double("cmd") }
-
- before do
- allow(Mixlib::ShellOut).to receive(:new).and_return(cmd)
- allow(cmd).to receive(:run_command)
- end
-
context "when the output contains katello-ca-consumer" do
+ let(:with_katello) { double("shell_out", stdout: <<~RPM) }
+ libevent-2.0.21-4.el7.x86_64
+ gettext-libs-0.19.8.1-3.el7.x86_64
+ yum-metadata-parser-1.1.4-10.el7.x86_64
+ pyliblzma-0.5.3-11.el7.x86_64
+ python-IPy-0.75-6.el7.noarch
+ grubby-8.28-26.el7.x86_64
+ fipscheck-lib-1.4.1-6.el7.x86_64
+ centos-logos-70.0.6-3.el7.centos.noarch
+ nss-tools-3.44.0-7.el7_7.x86_64
+ katello-ca-consumer-somehostname-1.0-1.el7.x86_64
+ rpm-4.11.3-43.el7.x86_64
+ gpgme-1.3.2-5.el7.x86_64
+ libnfsidmap-0.25-19.el7.x86_64
+ RPM
+
it "returns true" do
- allow(cmd).to receive(:stdout).and_return("katello-ca-consumer-somehostname-1.0-1")
+ allow(provider).to receive(:shell_out).and_return(with_katello)
expect(provider.katello_cert_rpm_installed?).to eq(true)
end
end
context "when the output does not contain katello-ca-consumer" do
+ let(:without_katello) { double("shell_out", stdout: "") }
+
it "returns false" do
- allow(cmd).to receive(:stdout).and_return("katello-agent-but-not-the-ca")
+ allow(provider).to receive(:shell_out).and_return(without_katello)
expect(provider.katello_cert_rpm_installed?).to eq(false)
end
end
@@ -89,6 +100,22 @@ describe Chef::Resource::RhsmRegister do
end
end
+ context "when a system_name is provided" do
+ it "returns a command containing the system name" do
+ allow(resource).to receive(:organization).and_return("myorg")
+ allow(resource).to receive(:system_name).and_return("myname")
+ expect(provider.register_command).to match("--name=myname")
+ end
+ end
+
+ context "when a system_name is not provided" do
+ it "returns a command containing the system name" do
+ allow(resource).to receive(:organization).and_return("myorg")
+ allow(resource).to receive(:system_name).and_return(nil)
+ expect(provider.register_command).not_to match("--name")
+ end
+ end
+
context "when auto_attach is true" do
it "does not return a command with --auto-attach since it is not supported with activation keys" do
allow(resource).to receive(:organization).and_return("myorg")
@@ -124,6 +151,20 @@ describe Chef::Resource::RhsmRegister do
end
end
+ context "when a system_name is provided" do
+ it "returns a command containing the system name" do
+ allow(resource).to receive(:system_name).and_return("myname")
+ expect(provider.register_command).to match("--name=myname")
+ end
+ end
+
+ context "when a system_name is not provided" do
+ it "returns a command containing the system name" do
+ allow(resource).to receive(:system_name).and_return(nil)
+ expect(provider.register_command).not_to match("--name")
+ end
+ end
+
context "when auto_attach is nil" do
it "returns a command that does not contain --auto-attach" do
allow(resource).to receive(:auto_attach).and_return(nil)
@@ -204,23 +245,20 @@ describe Chef::Resource::RhsmRegister do
end
describe "#registered_with_rhsm?" do
- let(:cmd) { double("cmd") }
-
- before do
- allow(Mixlib::ShellOut).to receive(:new).and_return(cmd)
- allow(cmd).to receive(:run_command)
- end
-
context "when the status is Unknown" do
+ let(:unknown_status) { double("shell_out", stdout: "Overall Status: Unknown") }
+
it "returns false" do
- allow(cmd).to receive(:stdout).and_return("Overall Status: Unknown")
+ allow(provider).to receive(:shell_out).and_return(unknown_status)
expect(provider.registered_with_rhsm?).to eq(false)
end
end
context "when the status is anything else" do
+ let(:known_status) { double("shell_out", stdout: "Overall Status: Insufficient") }
+
it "returns true" do
- allow(cmd).to receive(:stdout).and_return("Overall Status: Insufficient")
+ allow(provider).to receive(:shell_out).and_return(known_status)
expect(provider.registered_with_rhsm?).to eq(true)
end
end
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb
index a94beece6b..24155e3b8f 100644
--- a/spec/unit/resource/service_spec.rb
+++ b/spec/unit/resource/service_spec.rb
@@ -62,7 +62,7 @@ describe Chef::Resource::Service do
it "does not accept a regexp for the service pattern" do
expect do
- resource.pattern /.*/
+ resource.pattern(/.*/)
end.to raise_error(ArgumentError)
end
@@ -89,7 +89,7 @@ describe Chef::Resource::Service do
it "does not accept a regexp for the init_command property" do
expect do
- resource.init_command /.*/
+ resource.init_command(/.*/)
end.to raise_error(ArgumentError)
end
diff --git a/spec/unit/resource/solaris_package_spec.rb b/spec/unit/resource/solaris_package_spec.rb
index 57cf6e7a3a..e663ab5684 100644
--- a/spec/unit/resource/solaris_package_spec.rb
+++ b/spec/unit/resource/solaris_package_spec.rb
@@ -21,16 +21,14 @@ require "support/shared/unit/resource/static_provider_resolution"
describe Chef::Resource::SolarisPackage, "initialize" do
- %w{solaris2 nexentacore}.each do |platform_family|
- static_provider_resolution(
- resource: Chef::Resource::SolarisPackage,
- provider: Chef::Provider::Package::Solaris,
- name: :solaris_package,
- action: :install,
- os: "solaris2",
- platform_family: platform_family
- )
- end
+ static_provider_resolution(
+ resource: Chef::Resource::SolarisPackage,
+ provider: Chef::Provider::Package::Solaris,
+ name: :solaris_package,
+ action: :install,
+ os: "solaris2",
+ platform_family: "solaris2"
+ )
let(:resource) { Chef::Resource::SolarisPackage.new("foo") }
diff --git a/spec/unit/resource/windows_certificate_spec.rb b/spec/unit/resource/windows_certificate_spec.rb
index 7c0df35571..71ef8a9498 100644
--- a/spec/unit/resource/windows_certificate_spec.rb
+++ b/spec/unit/resource/windows_certificate_spec.rb
@@ -80,4 +80,16 @@ describe Chef::Resource::WindowsCertificate do
resource.store_name "MY"
expect { resource.action :create }.not_to raise_error
end
+
+ it "the exportable property defaults to false" do
+ expect(resource.exportable).to be false
+ end
+
+ it "doesn't raise error if exportable option is passed" do
+ resource.pfx_password "chef$123"
+ resource.source "C:\\certs\\test-cert.pfx"
+ resource.store_name "MY"
+ resource.exportable true
+ expect { resource.action :create }.not_to raise_error
+ end
end
diff --git a/spec/unit/resource/windows_uac_spec.rb b/spec/unit/resource/windows_uac_spec.rb
index a82ca65421..48f2f33a16 100644
--- a/spec/unit/resource/windows_uac_spec.rb
+++ b/spec/unit/resource/windows_uac_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Resource::WindowsUac do
expect { resource.consent_behavior_users :bogus }.to raise_error(ArgumentError)
end
- it "sets the default action as :create" do
+ it "sets the default action as :configure" do
expect(resource.action).to eql([:configure])
end
end
diff --git a/spec/unit/resource/windows_user_privilege_spec.rb b/spec/unit/resource/windows_user_privilege_spec.rb
new file mode 100644
index 0000000000..73c800c8bd
--- /dev/null
+++ b/spec/unit/resource/windows_user_privilege_spec.rb
@@ -0,0 +1,55 @@
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsUserPrivilege do
+ let(:resource) { Chef::Resource::WindowsUserPrivilege.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_user_privilege" do
+ expect(resource.resource_name).to eql(:windows_user_privilege)
+ end
+
+ it "the principal property is the name_property" do
+ expect(resource.principal).to eql("fakey_fakerton")
+ end
+
+ it "the users property coerces to an array" do
+ resource.users "Administrator"
+ expect(resource.users).to eql(["Administrator"])
+ end
+
+ it "the privilege property coerces to an array" do
+ resource.privilege "SeDenyRemoteInteractiveLogonRight"
+ expect(resource.privilege).to eql(["SeDenyRemoteInteractiveLogonRight"])
+ end
+
+ it "the privilege property validates inputs against the allowed list of privs" do
+ expect { resource.privilege "invalidPriv" }.to raise_error(Chef::Exceptions::ValidationFailed)
+ end
+
+ it "sets the default action as :add" do
+ expect(resource.action).to eql([:add])
+ end
+
+ it "supports :add, :set, :clear, :remove actions" do
+ expect { resource.action :add }.not_to raise_error
+ expect { resource.action :set }.not_to raise_error
+ expect { resource.action :clear }.not_to raise_error
+ expect { resource.action :remove }.not_to raise_error
+ end
+end
diff --git a/spec/unit/resource_inspector_spec.rb b/spec/unit/resource_inspector_spec.rb
index 31aafa1cbe..f3a4b2aa0a 100644
--- a/spec/unit/resource_inspector_spec.rb
+++ b/spec/unit/resource_inspector_spec.rb
@@ -33,9 +33,9 @@ class DummyResource < Chef::Resource
end
end
-describe ResourceInspector do
+describe Chef::ResourceInspector do
describe "inspecting a resource" do
- subject { ResourceInspector.extract_resource(DummyResource, false) }
+ subject { Chef::ResourceInspector.extract_resource(DummyResource, false) }
it "returns a hash with required data" do
expect(subject[:description]).to eq "A dummy resource"
@@ -50,7 +50,7 @@ describe ResourceInspector do
end
context "including built in properties" do
- subject { ResourceInspector.extract_resource(DummyResource, true) }
+ subject { Chef::ResourceInspector.extract_resource(DummyResource, true) }
it "returns many properties" do
expect(subject[:properties].count).to be > 1
expect(subject[:properties].map { |n| n[:name] }).to include(:name, :first, :sensitive)
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index 0dd8d43136..500ec13f7b 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -111,8 +111,7 @@ describe Chef::Runner do
it "should use the provider specified by the resource (if it has one)" do
provider = Chef::Provider::Easy.new(run_context.resource_collection[0], run_context)
- # Expect provider to be called twice, because will fall back to old provider lookup
- expect(run_context.resource_collection[0]).to receive(:provider).twice.and_return(Chef::Provider::Easy)
+ expect(run_context.resource_collection[0]).to receive(:provider).once.and_return(Chef::Provider::Easy)
expect(Chef::Provider::Easy).to receive(:new).once.and_return(provider)
runner.converge
end
diff --git a/spec/unit/shell_spec.rb b/spec/unit/shell_spec.rb
index 18b622698e..9c1a0c8e3d 100644
--- a/spec/unit/shell_spec.rb
+++ b/spec/unit/shell_spec.rb
@@ -150,8 +150,8 @@ describe Shell do
end
it "creates a help banner with the command descriptions" do
- expect(@chef_object.help_banner).to match(/^\|\ Command[\s]+\|\ Description[\s]*$/)
- expect(@chef_object.help_banner).to match(/^\|\ rspec_method[\s]+\|\ rspecin\'[\s]*$/)
+ expect(@chef_object.help_banner).to match(/^\|\ Command\s+\|\ Description\s*$/)
+ expect(@chef_object.help_banner).to match(/^\|\ rspec_method\s+\|\ rspecin\'\s*$/)
end
end
diff --git a/spec/unit/train_transport_spec.rb b/spec/unit/train_transport_spec.rb
index 0922c5b00d..d0724911cb 100644
--- a/spec/unit/train_transport_spec.rb
+++ b/spec/unit/train_transport_spec.rb
@@ -19,32 +19,33 @@
require "spec_helper"
describe Chef::TrainTransport do
+ let(:transport) { Chef::TrainTransport.new(Chef::Log) }
+
describe "load_credentials" do
- let(:transport) { Chef::TrainTransport.new }
let(:good_credentials) { { "switch.cisco.com" => { "user" => "cisco", "password" => "cisco", "enable_password" => "secret" } } }
before do
- allow(Chef::TrainTransport).to receive(:parse_credentials_file).and_return(good_credentials)
+ allow(transport).to receive(:parse_credentials_file).and_return(good_credentials)
end
it "matches credentials when they exist" do
- expect(Chef::TrainTransport.load_credentials("switch.cisco.com")[:user]).to eq("cisco")
- expect(Chef::TrainTransport.load_credentials("switch.cisco.com")[:password]).to eq("cisco")
- expect(Chef::TrainTransport.load_credentials("switch.cisco.com")[:enable_password]).to eq("secret")
+ expect(transport.load_credentials("switch.cisco.com")[:user]).to eq("cisco")
+ expect(transport.load_credentials("switch.cisco.com")[:password]).to eq("cisco")
+ expect(transport.load_credentials("switch.cisco.com")[:enable_password]).to eq("secret")
end
it "returns nil if there is no match" do
- expect(Chef::TrainTransport.load_credentials("router.unicorns.com")).to be_nil
+ expect(transport.load_credentials("router.unicorns.com")).to be_nil
end
# [foo.example.org] => {"foo"=>{"example"=>{"org"=>{}}}}
# ['foo.example.org'] => {"foo.example.org"=>{}}
it "warns if the host has been split by toml" do
- allow(Chef::TrainTransport).to receive(:credentials_file_path).and_return("/Users/scotthourglass/.chef/credentials")
- allow(Chef::TrainTransport).to receive(:parse_credentials_file).and_return({ "foo" => { "example" => { "org" => {} } } })
+ allow(transport).to receive(:credentials_file_path).and_return("/Users/scotthourglass/.chef/credentials")
+ allow(transport).to receive(:parse_credentials_file).and_return({ "foo" => { "example" => { "org" => {} } } })
expect(Chef::Log).to receive(:warn).with(/as a Hash/)
expect(Chef::Log).to receive(:warn).with(/Hostnames must be surrounded by single quotes/)
- expect(Chef::TrainTransport.load_credentials("foo.example.org")).to be_nil
+ expect(transport.load_credentials("foo.example.org")).to be_nil
end
end
@@ -60,25 +61,25 @@ describe Chef::TrainTransport do
it "returns the path if it exists" do
allow(File).to receive(:exist?).with(config_cred_file_path).and_return(true)
- expect(Chef::TrainTransport.credentials_file_path).to eq(config_cred_file_path)
+ expect(transport.credentials_file_path).to eq(config_cred_file_path)
end
it "raises an error if it does not exist" do
allow(File).to receive(:exist?).and_return(false)
- expect { Chef::TrainTransport.credentials_file_path }.to raise_error(ArgumentError, /does not exist/)
+ expect { transport.credentials_file_path }.to raise_error(ArgumentError, /does not exist/)
end
end
it "raises an error if the default creds files do not exist" do
allow(File).to receive(:exist?).and_return(false)
- expect { Chef::TrainTransport.credentials_file_path }.to raise_error(ArgumentError, /does not exist/)
+ expect { transport.credentials_file_path }.to raise_error(ArgumentError, /does not exist/)
end
it "returns the path to the default config file if it exists" do
tm_config = double("Config Context", host: "foo.example.org", credentials_file: nil)
allow(Chef::Config).to receive(:target_mode).and_return(tm_config)
allow(File).to receive(:exist?).with(host_cred_file_path).and_return(true)
- expect(Chef::TrainTransport.credentials_file_path).to eq(host_cred_file_path)
+ expect(transport.credentials_file_path).to eq(host_cred_file_path)
end
end
end
diff --git a/spec/unit/util/dsc/configuration_generator_spec.rb b/spec/unit/util/dsc/configuration_generator_spec.rb
index eee6adbd07..3f85f3189d 100644
--- a/spec/unit/util/dsc/configuration_generator_spec.rb
+++ b/spec/unit/util/dsc/configuration_generator_spec.rb
@@ -25,6 +25,85 @@ describe Chef::Util::DSC::ConfigurationGenerator do
Chef::Util::DSC::ConfigurationGenerator.new(node, "tmp")
end
+ describe "#validate_switch_name!" do
+ it "should not raise an error if a name contains all upper case letters" do
+ conf_man.send(:validate_switch_name!, "HELLO")
+ end
+
+ it "should not raise an error if the name contains all lower case letters" do
+ conf_man.send(:validate_switch_name!, "hello")
+ end
+
+ it "should not raise an error if no special characters are used except _" do
+ conf_man.send(:validate_switch_name!, "hello_world")
+ end
+
+ %w{! @ # $ % ^ & * & * ( ) - = + \{ \} . ? < > \\ /}.each do |sym|
+ it "raises an ArgumentError if configuration name contains #{sym}" do
+ expect do
+ conf_man.send(:validate_switch_name!, "Hello#{sym}")
+ end.to raise_error(ArgumentError)
+ end
+ end
+ end
+
+ describe "#escape_parameter_value" do
+ # Is this list really complete?
+ %w{` " # '}.each do |c|
+ it "escapes #{c}" do
+ expect(conf_man.send(:escape_parameter_value, "stuff #{c}")).to eql("stuff `#{c}")
+ end
+ end
+
+ it "does not do anything to a string without special characters" do
+ expect(conf_man.send(:escape_parameter_value, "stuff")).to eql("stuff")
+ end
+ end
+
+ describe "#escape_string_parameter_value" do
+ it "surrounds a string with ''" do
+ expect(conf_man.send(:escape_string_parameter_value, "stuff")).to eql("'stuff'")
+ end
+ end
+
+ describe "#command_switches_string" do
+ it "raises an ArgumentError if the key is not a symbol" do
+ expect do
+ conf_man.send(:command_switches_string, { "foo" => "bar" })
+ end.to raise_error(ArgumentError)
+ end
+
+ it "does not allow invalid switch names" do
+ expect do
+ conf_man.send(:command_switches_string, { foo!: "bar" })
+ end.to raise_error(ArgumentError)
+ end
+
+ it "ignores switches with a false value" do
+ expect(conf_man.send(:command_switches_string, { foo: false })).to eql("")
+ end
+
+ it "should correctly handle a value type of string" do
+ expect(conf_man.send(:command_switches_string, { foo: "bar" })).to eql("-foo 'bar'")
+ end
+
+ it "should correctly handle a value type of string even when it is 0 length" do
+ expect(conf_man.send(:command_switches_string, { foo: "" })).to eql("-foo ''")
+ end
+
+ it "should not quote integers" do
+ expect(conf_man.send(:command_switches_string, { foo: 1 })).to eql("-foo 1")
+ end
+
+ it "should not quote floats" do
+ expect(conf_man.send(:command_switches_string, { foo: 1.0 })).to eql("-foo 1.0")
+ end
+
+ it "has just the switch when the value is true" do
+ expect(conf_man.send(:command_switches_string, { foo: true })).to eql("-foo")
+ end
+ end
+
describe "#validate_configuration_name!" do
it "should not raise an error if a name contains all upper case letters" do
conf_man.send(:validate_configuration_name!, "HELLO")
diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb
index e0f7c4ddaf..8adf778949 100644
--- a/spec/unit/util/dsc/local_configuration_manager_spec.rb
+++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb
@@ -49,23 +49,22 @@ describe Chef::Util::DSC::LocalConfigurationManager do
EOH
end
- let(:lcm_status) do
- double("LCM cmdlet status", stderr: lcm_standard_error, return_value: lcm_standard_output, succeeded?: lcm_cmdlet_success)
+ let(:powershell) do
+ double("Chef::PowerShell", errors: lcm_errors, error?: !lcm_errors.empty?, result: lcm_result)
end
describe "test_configuration method invocation" do
context "when interacting with the LCM using a PowerShell cmdlet" do
before(:each) do
- allow(lcm).to receive(:run_configuration_cmdlet).and_return(lcm_status)
+ allow(lcm).to receive(:run_configuration_cmdlet).and_return(powershell)
allow(lcm).to receive(:ps_version_gte_5?).and_return(false)
end
context "that returns successfully" do
- let(:lcm_standard_output) { normal_lcm_output }
- let(:lcm_standard_error) { nil }
- let(:lcm_cmdlet_success) { true }
+ let(:lcm_result) { normal_lcm_output }
+ let(:lcm_errors) { [] }
it "successfully returns resource information for normally formatted output when cmdlet the cmdlet succeeds" do
- test_configuration_result = lcm.test_configuration("config", {})
+ test_configuration_result = lcm.test_configuration("config")
expect(test_configuration_result.class).to be(Array)
expect(test_configuration_result.length).to be > 0
expect(Chef::Log).not_to receive(:warn)
@@ -73,13 +72,12 @@ describe Chef::Util::DSC::LocalConfigurationManager do
end
context "when running on PowerShell version 5" do
- let(:lcm_standard_output) { normal_lcm_output }
- let(:lcm_standard_error) { nil }
- let(:lcm_cmdlet_success) { true }
+ let(:lcm_result) { normal_lcm_output }
+ let(:lcm_errors) { [] }
it "successfully returns resource information for normally formatted output when cmdlet the cmdlet succeeds" do
allow(lcm).to receive(:ps_version_gte_5?).and_return(true)
- test_configuration_result = lcm.test_configuration("config", {})
+ test_configuration_result = lcm.test_configuration("config")
expect(test_configuration_result.class).to be(Array)
expect(test_configuration_result.length).to be > 0
expect(Chef::Log).not_to receive(:warn)
@@ -87,13 +85,12 @@ describe Chef::Util::DSC::LocalConfigurationManager do
end
context "when running on PowerShell version less than 5" do
- let(:lcm_standard_output) { normal_lcm_output }
- let(:lcm_standard_error) { nil }
- let(:lcm_cmdlet_success) { true }
+ let(:lcm_result) { normal_lcm_output }
+ let(:lcm_errors) { [] }
it "successfully returns resource information for normally formatted output when cmdlet the cmdlet succeeds" do
allow(lcm).to receive(:ps_version_gte_5?).and_return(false)
- test_configuration_result = lcm.test_configuration("config", {})
+ test_configuration_result = lcm.test_configuration("config")
expect(test_configuration_result.class).to be(Array)
expect(test_configuration_result.length).to be > 0
expect(Chef::Log).not_to receive(:warn)
@@ -104,10 +101,9 @@ describe Chef::Util::DSC::LocalConfigurationManager do
let(:common_command_prefix) { "$ProgressPreference = 'SilentlyContinue';" }
let(:ps4_base_command) { "#{common_command_prefix} Start-DscConfiguration -path tmp -wait -erroraction 'stop' -force" }
let(:lcm_command_ps4) { ps4_base_command + " -whatif; if (! $?) { exit 1 }" }
- let(:lcm_command_ps5) { "#{common_command_prefix} Test-DscConfiguration -path tmp | format-list" }
- let(:lcm_standard_output) { normal_lcm_output }
- let(:lcm_standard_error) { nil }
- let(:lcm_cmdlet_success) { true }
+ let(:lcm_command_ps5) { "#{common_command_prefix} Test-DscConfiguration -path tmp | format-list | Out-String" }
+ let(:lcm_result) { normal_lcm_output }
+ let(:lcm_errors) { [] }
it "successfully returns command when apply_configuration true" do
expect(lcm.send(:lcm_command, true)).to eq(ps4_base_command)
@@ -125,9 +121,8 @@ describe Chef::Util::DSC::LocalConfigurationManager do
end
context "that fails due to missing what-if switch in DSC resource cmdlet implementation" do
- let(:lcm_standard_output) { "" }
- let(:lcm_standard_error) { no_whatif_lcm_output }
- let(:lcm_cmdlet_success) { false }
+ let(:lcm_result) { "" }
+ let(:lcm_errors) { [no_whatif_lcm_output] }
it "returns true when passed to #whatif_not_supported?" do
expect(lcm.send(:whatif_not_supported?, no_whatif_lcm_output)).to be_truthy
@@ -137,40 +132,38 @@ describe Chef::Util::DSC::LocalConfigurationManager do
expect(Chef::Log).to receive(:warn).at_least(:once)
expect(lcm).to receive(:whatif_not_supported?).and_call_original
test_configuration_result = nil
- expect { test_configuration_result = lcm.test_configuration("config", {}) }.not_to raise_error
+ expect { test_configuration_result = lcm.test_configuration("config") }.not_to raise_error
expect(test_configuration_result.class).to be(Array)
end
end
context "that fails due to a DSC resource not being imported before StartDSCConfiguration -whatif is executed" do
- let(:lcm_standard_output) { "" }
- let(:lcm_standard_error) { dsc_resource_import_failure_output }
- let(:lcm_cmdlet_success) { false }
+ let(:lcm_result) { "" }
+ let(:lcm_errors) { [dsc_resource_import_failure_output] }
it "logs a warning if the message is formatted as expected when a resource import failure occurs" do
expect(Chef::Log).to receive(:warn).at_least(:once)
expect(lcm).to receive(:dsc_module_import_failure?).and_call_original
test_configuration_result = nil
- expect { test_configuration_result = lcm.test_configuration("config", {}) }.not_to raise_error
+ expect { test_configuration_result = lcm.test_configuration("config") }.not_to raise_error
end
it "returns a (possibly empty) array of ResourceInfo instances" do
expect(Chef::Log).to receive(:warn).at_least(:once)
test_configuration_result = nil
- expect { test_configuration_result = lcm.test_configuration("config", {}) }.not_to raise_error
+ expect { test_configuration_result = lcm.test_configuration("config") }.not_to raise_error
expect(test_configuration_result.class).to be(Array)
end
end
context "that fails due to an unknown PowerShell cmdlet error" do
- let(:lcm_standard_output) { "some output" }
- let(:lcm_standard_error) { "Abort, Retry, Fail?" }
- let(:lcm_cmdlet_success) { false }
+ let(:lcm_result) { "some output" }
+ let(:lcm_errors) { ["Abort, Retry, Fail?"] }
it "logs a warning" do
expect(Chef::Log).to receive(:warn).at_least(:once)
expect(lcm).to receive(:dsc_module_import_failure?).and_call_original
- expect { lcm.test_configuration("config", {}) }.not_to raise_error
+ expect { lcm.test_configuration("config") }.not_to raise_error
end
end
end
@@ -188,12 +181,11 @@ describe Chef::Util::DSC::LocalConfigurationManager do
end
end
- describe "#run_configuration_cmdlet" do
+ describe "#run_configuration_cmdlet", :windows_powershell_dsc_only do
context "when invalid dsc script is given" do
it "raises exception" do
configuration_document = "invalid-config"
- shellout_flags = { cwd: nil, environment: nil, timeout: nil }
- expect { lcm.send(:run_configuration_cmdlet, configuration_document, true, shellout_flags) }.to raise_error(Chef::Exceptions::PowershellCmdletException)
+ expect { lcm.send(:run_configuration_cmdlet, configuration_document, true) }.to raise_error(Chef::PowerShell::CommandFailed)
end
end
end
diff --git a/spec/unit/util/powershell/cmdlet_spec.rb b/spec/unit/util/powershell/cmdlet_spec.rb
deleted file mode 100644
index 4dc6e2b85c..0000000000
--- a/spec/unit/util/powershell/cmdlet_spec.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-# Author:: Jay Mundrawala <jdm@chef.io>
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "chef"
-require "chef/util/powershell/cmdlet"
-
-describe Chef::Util::Powershell::Cmdlet do
- before (:all) do
- @node = Chef::Node.new
- @cmdlet = Chef::Util::Powershell::Cmdlet.new(@node, "Some-Commandlet")
- end
-
- describe "#validate_switch_name!" do
- it "should not raise an error if a name contains all upper case letters" do
- @cmdlet.send(:validate_switch_name!, "HELLO")
- end
-
- it "should not raise an error if the name contains all lower case letters" do
- @cmdlet.send(:validate_switch_name!, "hello")
- end
-
- it "should not raise an error if no special characters are used except _" do
- @cmdlet.send(:validate_switch_name!, "hello_world")
- end
-
- %w{! @ # $ % ^ & * & * ( ) - = + \{ \} . ? < > \\ /}.each do |sym|
- it "raises an Argument error if it configuration name contains #{sym}" do
- expect do
- @cmdlet.send(:validate_switch_name!, "Hello#{sym}")
- end.to raise_error(ArgumentError)
- end
- end
- end
-
- describe "#escape_parameter_value" do
- # Is this list really complete?
- %w{` " # '}.each do |c|
- it "escapse #{c}" do
- expect(@cmdlet.send(:escape_parameter_value, "stuff #{c}")).to eql("stuff `#{c}")
- end
- end
-
- it "does not do anything to a string without special characters" do
- expect(@cmdlet.send(:escape_parameter_value, "stuff")).to eql("stuff")
- end
- end
-
- describe "#escape_string_parameter_value" do
- it "surrounds a string with ''" do
- expect(@cmdlet.send(:escape_string_parameter_value, "stuff")).to eql("'stuff'")
- end
- end
-
- describe "#command_switches_string" do
- it "raises an ArgumentError if the key is not a symbol" do
- expect do
- @cmdlet.send(:command_switches_string, { "foo" => "bar" })
- end.to raise_error(ArgumentError)
- end
-
- it "does not allow invalid switch names" do
- expect do
- @cmdlet.send(:command_switches_string, { foo!: "bar" })
- end.to raise_error(ArgumentError)
- end
-
- it "ignores switches with a false value" do
- expect(@cmdlet.send(:command_switches_string, { foo: false })).to eql("")
- end
-
- it "should correctly handle a value type of string" do
- expect(@cmdlet.send(:command_switches_string, { foo: "bar" })).to eql("-foo 'bar'")
- end
-
- it "should correctly handle a value type of string even when it is 0 length" do
- expect(@cmdlet.send(:command_switches_string, { foo: "" })).to eql("-foo ''")
- end
-
- it "should not quote integers" do
- expect(@cmdlet.send(:command_switches_string, { foo: 1 })).to eql("-foo 1")
- end
-
- it "should not quote floats" do
- expect(@cmdlet.send(:command_switches_string, { foo: 1.0 })).to eql("-foo 1.0")
- end
-
- it "has just the switch when the value is true" do
- expect(@cmdlet.send(:command_switches_string, { foo: true })).to eql("-foo")
- end
- end
-end
diff --git a/tasks/announce.rb b/tasks/announce.rb
deleted file mode 100644
index f3e6fa6212..0000000000
--- a/tasks/announce.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "date"
-require "erb"
-
-class ReleaseAnnouncement
- include ERB::Util
- attr_accessor :type, :version, :maj_minor, :date, :release_notes
-
- def initialize(version, date, type)
- @version = version
- @maj_minor = version.split(".")[0..1].join(".")
- @date = Date.parse(date) unless date.nil?
- @release_notes = release_notes_from_file
- @type = type
- end
-
- def render
- puts "-" * 30
- puts ERB.new(template_for(@type)).result(binding)
- puts "-" * 30
- end
-
- def template_for(type)
- File.read("tasks/templates/#{type}.md.erb")
- end
-
- def release_notes_from_file
- File.read("RELEASE_NOTES.md").match(/^# Chef Infra Client Release Notes #{@maj_minor}:\n\n(.*)/m)[1]
- end
-end
-
-desc "Generate the Release Announcement (version: X.Y.Z)"
-task :announce_release, :version do |t, args|
- ReleaseAnnouncement.new(args[:version], nil, "release").render
-end
diff --git a/tasks/bin/run_external_test b/tasks/bin/run_external_test
index 16f21d8e37..e4d984e9ee 100755
--- a/tasks/bin/run_external_test
+++ b/tasks/bin/run_external_test
@@ -6,7 +6,7 @@
# of the chef / ohai repos. It let's us know if we need to update downstream
# gems or fix regressions in chef *before* we release.
-$:.unshift(File.expand_path("../../lib", File.dirname(__FILE__)))
+$:.unshift(File.expand_path("../../lib", __dir__))
require "tmpdir"
require "bundler"
diff --git a/tasks/docs.rb b/tasks/docs.rb
index 2327a928c7..b815988b8b 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -1,3 +1,5 @@
+RESOURCES_TO_SKIP = ["whyrun_safe_ruby_block", "l_w_r_p_base", "user_resource_abstract_base_class", "linux_user", "pw_user", "aix_user", "dscl_user", "solaris_user", "windows_user", "mac_user", ""].freeze
+
namespace :docs_site do
desc "Generate resource documentation pages in a docs_site directory"
@@ -5,7 +7,7 @@ namespace :docs_site do
task :resources do
Encoding.default_external = Encoding::UTF_8
- $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "lib")))
+ $:.unshift(File.expand_path(File.join(__dir__, "lib")))
require "chef/resource_inspector"
require "fileutils"
@@ -112,17 +114,6 @@ namespace :docs_site do
fixed_arr.compact.join(", ")
end
- # build the menu entry for this resource
- def build_menu_item(name)
- {
- "infra" => {
- "title" => name,
- "identifier" => "chef_infra/cookbook_reference/resources/#{name} #{name}",
- "parent" => "chef_infra/cookbook_reference/resources",
- },
- }
- end
-
# print out the human readable form of the default
def friendly_default_value(property)
return "The resource block's name" if property["name_property"]
@@ -157,7 +148,7 @@ namespace :docs_site do
values = {}
values["property"] = property["name"]
values["ruby_type"] = friendly_types_list(property["is"])
- values["required"] = property["required"]
+ values["required"] = !!property["required"] # right now we just want a boolean value here since the docs doesn't know what to do with an array of actions
values["default_value"] = default_val unless default_val.nil?
values["new_in"] = property["introduced"] unless property["introduced"].nil?
values["allowed_values"] = property["equal_to"].join(", ") unless property["equal_to"].empty?
@@ -166,11 +157,11 @@ namespace :docs_site do
end
end
- def special_properties(name, data)
+ def special_properties(name)
properties = {}
# these package properties support passing arrays for the package name
- properties["common_resource_functionality_multiple_packages"] = true if %w{yum_package apt_package zypper_package homebrew_package dnf_package pacman_package homebrew_package}.include?(name)
+ properties["multi_package_resource"] = true if %w{snap_package dpkg_package yum_package apt_package zypper_package homebrew_package dnf_package pacman_package homebrew_package}.include?(name)
properties["common_resource_functionality_resources_common_windows_security"] = true if name == "remote_directory"
@@ -186,17 +177,9 @@ namespace :docs_site do
properties["nameless_build_essential"] = true if name == "build_essential"
- properties["properties_multiple_packages"] = true if %w{dnf_package package zypper_package}.include?(name)
-
properties["properties_resources_common_windows_security"] = true if %w{cookbook_file file template remote_file directory}.include?(name)
- properties["properties_shortcode"] =
- case name
- when "ohai"
- "resource_ohai_properties.md"
- when "log"
- "resource_log_properties.md"
- end
+ properties["properties_shortcode"] = "resource_log_properties.md" if name == "log"
properties["ps_credential_helper"] = true if name == "dsc_script"
@@ -230,9 +213,6 @@ namespace :docs_site do
properties["unit_file_verification"] = true if name == "systemd_unit"
- # these packages all provide 'package' depending on OS and we want to inject a warning / note that you can just use 'package' instead
- properties["notes_resource_based_on_package" ] = true if %w{apt_package bff_package dnf_package homebrew_package ips_package openbsd_package pacman_package portage_package smartos_package solaris_package windows_package yum_package zypper_package}.include?(name)
-
properties
end
@@ -240,7 +220,7 @@ namespace :docs_site do
# using the markers "Note:" for "note" sections and "Warning:" for "warning" sections.
# TODO: has the limitation that the plain description section is assumed to come first,
# and is followed by one or more "note"s or "warning"s sections.
- def build_description(text)
+ def build_description(name, text)
return [{ "markdown" => nil }] if text.nil?
description_pattern = /(Note:|Warning:)?((?:(?!Note:|Warning:).)*)/m
@@ -265,6 +245,9 @@ namespace :docs_site do
end
end
+ # if we're on a package resource, depending on the OS we want to inject a warning / note that you can just use 'package' instead
+ description << { "notes_resource_based_on_package" => true } if %w{apt_package bff_package dnf_package homebrew_package ips_package openbsd_package pacman_package portage_package smartos_package windows_package yum_package zypper_package pacman_package freebsd_package}.include?(name)
+
description
end
@@ -278,13 +261,10 @@ namespace :docs_site do
r["resource_reference"] = true
# These properties are set to special values for only a few resources.
- r.merge!(special_properties(name, data))
+ r.merge!(special_properties(name))
- r["title"] = "#{name} resource"
r["resource"] = name
- r["aliases"] = ["/resource_#{name}.html"]
- r["menu"] = build_menu_item(name)
- r["resource_description_list"] = build_description(data["description"])
+ r["resource_description_list"] = build_description(name, data["description"])
r["resource_new_in"] = data["introduced"] unless data["introduced"].nil?
r["syntax_full_code_block"] = generate_resource_block(name, properties, data["default_action"])
r["syntax_properties_list"] = nil
@@ -297,11 +277,11 @@ namespace :docs_site do
end
FileUtils.mkdir_p "docs_site"
- resources = Chef::JSONCompat.parse(ResourceInspector.inspect)
+ resources = Chef::JSONCompat.parse(Chef::ResourceInspector.inspect)
resources.each do |resource, data|
# skip some resources we don't directly document
- next if ["whyrun_safe_ruby_block", "l_w_r_p_base", "user_resource_abstract_base_class", "linux_user", "pw_user", "aix_user", "dscl_user", "solaris_user", "windows_user", "mac_user", ""].include?(resource)
+ next if RESOURCES_TO_SKIP.include?(resource)
next if ENV["DEBUG"] && !(resource == ENV["DEBUG"])
@@ -316,10 +296,7 @@ namespace :docs_site do
pp resource_data
else
puts "Writing out #{resource}."
- FileUtils.mkdir_p "docs_site/#{resource}"
- # write out the yaml contents of the hash and append a --- since this is actually a yaml
- # block in the middle of a markdown page and the block needs an ending
- File.open("docs_site/#{resource}/_index.md", "w") { |f| f.write(resource_data.to_yaml + "---") }
+ File.open("docs_site/#{resource}.yaml", "w") { |f| f.write(YAML.dump(resource_data)) }
end
end
end
diff --git a/tasks/rspec.rb b/tasks/rspec.rb
index 647efd647a..929e0f91b0 100644
--- a/tasks/rspec.rb
+++ b/tasks/rspec.rb
@@ -20,12 +20,10 @@
require "rubygems"
require "rake"
-CHEF_ROOT = File.join(File.dirname(__FILE__), "..")
-
begin
require "rspec/core/rake_task"
- desc "Run specs for Chef's Components"
+ desc "Run specs for Chef's Gem Components"
task :component_specs do
%w{chef-utils chef-config}.each do |gem|
Dir.chdir(gem) do
diff --git a/tasks/templates/release.md.erb b/tasks/templates/release.md.erb
deleted file mode 100644
index 366ae2b0a6..0000000000
--- a/tasks/templates/release.md.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-Ohai Chefs!
-
-We're happy to announce the release of Chef v<%= @maj_minor %>!
-
-# Release Highlights
-
-<%= @release_notes %>
-
-Please see the [CHANGELOG](https://github.com/chef/chef/blob/master/CHANGELOG.md) for the complete list of changes.
-
-# Get the Build
-As always, you can download binaries directly from [downloads.chef.io](https://downloads.chef.io/chef/<%= @version %>) or by using the `mixlib-install` command line utility:
-
-```shell
-$ mixlib-install download chef -v <%= @version %>
-```
-
-Alternatively, you can install Chef using one of the following command options:
-
-```shell
-# In Shell
-$ curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef -v <%= @version %>
-
-# In Windows Powershell
-. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project chef -version <%= @version %>
-```
-
-If you want to give this version a spin in Test Kitchen, create or add the following to your `kitchen.yml` file:
-
-```yaml
-provisioner:
- product_name: chef
- product_version: <%= @version %>
-```