summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Preston <stuart@chef.io>2018-09-14 14:14:10 +0100
committerGitHub <noreply@github.com>2018-09-14 14:14:10 +0100
commitedb22e06e1a227e108998ad1528c38cecde0b3bd (patch)
tree218be5d49ee0e8f01c0ab96d7b76ed5ca2c4b274
parent78cee99b68d3d2bb8a6dbf2b161414e4a7c3a207 (diff)
parent01fb14af401dbb0fd026c21adcb20b0877779e07 (diff)
downloadchef-edb22e06e1a227e108998ad1528c38cecde0b3bd.tar.gz
Merge branch 'master' into feature/windows_ad_join
-rw-r--r--.expeditor/config.yml27
-rw-r--r--.expeditor/update_dep.sh2
-rw-r--r--CBGB.md40
-rw-r--r--CBGB.toml96
-rw-r--r--CHANGELOG.md20
-rw-r--r--Gemfile.lock18
-rw-r--r--RELEASE_NOTES.md48
-rw-r--r--Rakefile1
-rw-r--r--VERSION2
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--lib/chef/cookbook_version.rb4
-rw-r--r--lib/chef/mixin/powershell_out.rb2
-rw-r--r--lib/chef/node_map.rb14
-rw-r--r--lib/chef/provider/dsc_resource.rb4
-rw-r--r--lib/chef/provider/dsc_script.rb8
-rw-r--r--lib/chef/provider/package/powershell.rb2
-rw-r--r--lib/chef/provider/powershell_script.rb6
-rw-r--r--lib/chef/resource/apt_package.rb1
-rw-r--r--lib/chef/resource/apt_repository.rb2
-rw-r--r--lib/chef/resource/build_essential.rb76
-rw-r--r--lib/chef/resource/chef_gem.rb5
-rw-r--r--lib/chef/resource/chocolatey_package.rb3
-rw-r--r--lib/chef/resource/directory.rb8
-rw-r--r--lib/chef/resource/dmg_package.rb5
-rw-r--r--lib/chef/resource/dnf_package.rb43
-rw-r--r--lib/chef/resource/dpkg_package.rb4
-rw-r--r--lib/chef/resource/dsc_resource.rb7
-rw-r--r--lib/chef/resource/dsc_script.rb9
-rw-r--r--lib/chef/resource/execute.rb5
-rw-r--r--lib/chef/resource/git.rb8
-rw-r--r--lib/chef/resource/http_request.rb4
-rw-r--r--lib/chef/resource/locale.rb92
-rw-r--r--lib/chef/resource/macos_userdefaults.rb6
-rw-r--r--lib/chef/resource/macosx_service.rb5
-rw-r--r--lib/chef/resource/mount.rb63
-rw-r--r--lib/chef/resource/msu_package.rb17
-rw-r--r--lib/chef/resource/ohai.rb6
-rw-r--r--lib/chef/resource/osx_profile.rb21
-rw-r--r--lib/chef/resource/package.rb6
-rw-r--r--lib/chef/resource/paludis_package.rb4
-rw-r--r--lib/chef/resource/portage_package.rb3
-rw-r--r--lib/chef/resource/powershell_package.rb26
-rw-r--r--lib/chef/resource/powershell_package_source.rb2
-rw-r--r--lib/chef/resource/reboot.rb9
-rw-r--r--lib/chef/resource/route.rb2
-rw-r--r--lib/chef/resource/systemd_unit.rb3
-rw-r--r--lib/chef/resource/windows_ad_join.rb4
-rw-r--r--lib/chef/resource/windows_font.rb2
-rw-r--r--lib/chef/resource/yum_package.rb50
-rw-r--r--lib/chef/resource/yum_repository.rb2
-rw-r--r--lib/chef/resource/zypper_package.rb6
-rw-r--r--lib/chef/resource_inspector.rb1
-rw-r--r--lib/chef/resources.rb1
-rw-r--r--lib/chef/util/powershell/cmdlet.rb2
-rw-r--r--lib/chef/version.rb2
-rw-r--r--omnibus/Gemfile.lock16
-rw-r--r--spec/functional/resource/dsc_resource_spec.rb6
-rw-r--r--spec/functional/resource/powershell_script_spec.rb4
-rw-r--r--spec/functional/win32/crypto_spec.rb2
-rw-r--r--spec/unit/cookbook_version_file_specificity_spec.rb20
-rw-r--r--spec/unit/node_map_spec.rb6
-rw-r--r--spec/unit/platform/query_helpers_spec.rb8
-rw-r--r--spec/unit/provider/dsc_resource_spec.rb4
-rw-r--r--spec/unit/provider/dsc_script_spec.rb2
-rw-r--r--spec/unit/resource/dsc_resource_spec.rb2
-rw-r--r--spec/unit/resource/locale_spec.rb60
-rw-r--r--tasks/cbgb.rb84
-rw-r--r--tasks/templates/prerelease.md.erb2
68 files changed, 513 insertions, 514 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index c90235d03f..061694fb25 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -67,21 +67,20 @@ merge_actions:
- "Expeditor: Skip All"
only_if: built_in:bump_version
-# These actions are taken, in the order specified, when an Omnibus artifact is promoted
-# within Chef's internal artifact storage system.
-artifact_actions:
- promoted_to_unstable:
- - built_in:build_docker_image
- promoted_to_current:
- - built_in:tag_docker_image
- promoted_to_stable:
- - built_in:rollover_changelog
- - bash:.expeditor/update_dockerfile.sh
- - built_in:tag_docker_image
- - built_in:publish_rubygems
- - built_in:notify_chefio_slack_channels
-
subscriptions:
+ - workload: artifact_published:unstable:chef:14*
+ actions:
+ - built_in:build_docker_image
+ - workload: artifact_published:current:chef:14*
+ actions:
+ - built_in:tag_docker_image
+ - workload: artifact_published:stable:chef:14*
+ actions:
+ - built_in:rollover_changelog
+ - bash:.expeditor/update_dockerfile.sh
+ - built_in:tag_docker_image
+ - built_in:publish_rubygems
+ - built_in:notify_chefio_slack_channels
- workload: ruby_gem_published:mixlib-archive-*
actions:
- bash:.expeditor/update_dep.sh
diff --git a/.expeditor/update_dep.sh b/.expeditor/update_dep.sh
index de820c6bd9..a95ef794e9 100644
--- a/.expeditor/update_dep.sh
+++ b/.expeditor/update_dep.sh
@@ -18,7 +18,7 @@ bundle install
# it appears that the gem that triggers this script fires off this script before
# the gem is actually available via bundler on rubygems.org.
-sleep 120
+sleep 240
gem install rake
rake dependencies:update_gemfile_lock
diff --git a/CBGB.md b/CBGB.md
deleted file mode 100644
index 2ce26fc3ab..0000000000
--- a/CBGB.md
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- This is a generated file. Please do not edit directly -->
-<!-- Modify CBGB.toml file and run `rake cbgb:generate` to regenerate -->
-
-# Chef Board of Governance (CBGB)
-
- Chef was designed from the outset to have a very open structure, including open design, open contribution, and consistent use of tools across the project. Given the large numbers of contributors, users, and companies with a stake in the future of the project, Chef leadership has established an advisory board, as part of its long term commitment to open governance.
-
- The Chef Board of Governance (CBGB) shall advise the Leadership on matters related to supporting the long-term governance, structure, and roadmap of the Project.
-
-More information can be found in the [Chef Board of Governance RFC](Chef Board of Governance).
-
-# Board of Governors
-
-## Project Lead
-
-* [Adam Jacob](https://github.com/adamhjk)
-
-### Users/Contributors (4)
-
-* [Ranjib Dey](https://github.com/ranjib)
-* [Doug Ireton](https://github.com/dougireton)
-* [Noah Kantrowitz](https://github.com/coderanger)
-* [Charity Majors](https://github.com/charity)
-
-
-### Corporate Contributors (4)
-
-* Etsy - Katherine Daniels
-* Facebook - Phil Dibowitz
-* Nordstrom - Mark Ayers
-* PagerDuty - Evan Gilman
-
-
-### Lieutenants (3)
-
-* [Jon Cowie](https://github.com/jonlives)
-* [Joshua Timberman](https://github.com/jtimberman)
-* [Seth Vargo](https://github.com/sethvargo)
-
-
diff --git a/CBGB.toml b/CBGB.toml
deleted file mode 100644
index 07e9c9a25a..0000000000
--- a/CBGB.toml
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# This file is structured to be consumed by both humans and computers.
-# It is a TOML document containing Markdown
-#
-[Preamble]
- title = "Chef Board of Governance (CBGB)"
- text = """
- Chef was designed from the outset to have a very open structure, including open design, open contribution, and consistent use of tools across the project. Given the large numbers of contributors, users, and companies with a stake in the future of the project, Chef leadership has established an advisory board, as part of its long term commitment to open governance.
-
- The Chef Board of Governance (CBGB) shall advise the Leadership on matters related to supporting the long-term governance, structure, and roadmap of the Project.
-
-More information can be found in the [Chef Board of Governance RFC](Chef Board of Governance).
-"""
-
-[Org]
- [Org.Lead]
- title = "Project Lead"
- person = "adamhjk"
-
- [Org.Contributors]
- title = "Users/Contributors (4)"
- governers = [
- "ranjibdey",
- "dougireton",
- "coderanger",
- "charitymajors"
- ]
-
- [Org.Corporate-Contributors]
- title = "Corporate Contributors (4)"
- governers = [
- "etsy",
- "facebook",
- "nordstrom",
- "pagerduty"
- ]
-
- [Org.Lieutenants]
- title = "Lieutenants (3)"
- governers = [
- "jonlives",
- "jtimberman",
- "sethvargo"
- ]
-
-[people]
- [people.adamhjk]
- Name = "Adam Jacob"
- GitHub = "adamhjk"
- IRC = "holoway"
-
- [people.jonlives]
- Name = "Jon Cowie"
- GitHub = "jonlives"
- IRC = "jonlives"
-
- [people.coderanger]
- Name = "Noah Kantrowitz"
- GitHub = "coderanger"
-
- [people.jtimberman]
- Name = "Joshua Timberman"
- GitHub = "jtimberman"
-
- [people.ranjibdey]
- Name = "Ranjib Dey"
- GitHub = "ranjib"
-
- [people.sethvargo]
- Name = "Seth Vargo"
- GitHub = "sethvargo"
-
- [people.dougireton]
- Name = "Doug Ireton"
- GitHub = "dougireton"
-
- [people.charitymajors]
- Name = "Charity Majors"
- GitHub = "charity"
-
-[corporations]
- [corporations.etsy]
- Name = "Etsy"
- Person = "Katherine Daniels"
-
- [corporations.facebook]
- Name = "Facebook"
- Person = "Phil Dibowitz"
-
- [corporations.nordstrom]
- Name = "Nordstrom"
- Person = "Mark Ayers"
-
- [corporations.pagerduty]
- Name = "PagerDuty"
- Person = "Evan Gilman"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6db6d9ec9c..c874e218b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,15 +1,29 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
-<!-- latest_release 14.4.63 -->
-## [v14.4.63](https://github.com/chef/chef/tree/v14.4.63) (2018-09-01)
+<!-- latest_release 14.5.13 -->
+## [v14.5.13](https://github.com/chef/chef/tree/v14.5.13) (2018-09-14)
#### Merged Pull Requests
-- Update property descriptions and remove extra nil types [#7604](https://github.com/chef/chef/pull/7604) ([tas50](https://github.com/tas50))
+- windows_ad_join resource - add newname property [#7637](https://github.com/chef/chef/pull/7637) ([derekgroh](https://github.com/derekgroh))
<!-- latest_release -->
<!-- release_rollup since=14.4.56 -->
### Changes since 14.4.56 release
#### Merged Pull Requests
+- windows_ad_join resource - add newname property [#7637](https://github.com/chef/chef/pull/7637) ([derekgroh](https://github.com/derekgroh)) <!-- 14.5.13 -->
+- Add locale resource more managing the system&#39;s locale [#7633](https://github.com/chef/chef/pull/7633) ([vincentaubert](https://github.com/vincentaubert)) <!-- 14.5.12 -->
+- paludis_package: Make sure timeout property is an Integer [#7625](https://github.com/chef/chef/pull/7625) ([tas50](https://github.com/tas50)) <!-- 14.5.11 -->
+- Update expeditor config to use subscriptions [#7632](https://github.com/chef/chef/pull/7632) ([tas50](https://github.com/tas50)) <!-- 14.5.10 -->
+- Fix remote_directory does not obey removal of file specificity [#7551](https://github.com/chef/chef/pull/7551) ([thechile](https://github.com/thechile)) <!-- 14.5.9 -->
+- Add required properties to the resource inspector output [#7631](https://github.com/chef/chef/pull/7631) ([tas50](https://github.com/tas50)) <!-- 14.5.8 -->
+- Properly capitalize PowerShell in descriptions and errors [#7630](https://github.com/chef/chef/pull/7630) ([tas50](https://github.com/tas50)) <!-- 14.5.7 -->
+- Add introduced versions for properties and more descriptions [#7627](https://github.com/chef/chef/pull/7627) ([tas50](https://github.com/tas50)) <!-- 14.5.6 -->
+- Remove unnecessary declare_resource usage in build_essential [#7624](https://github.com/chef/chef/pull/7624) ([tas50](https://github.com/tas50)) <!-- 14.5.5 -->
+- Add additional resource descriptions [#7623](https://github.com/chef/chef/pull/7623) ([tas50](https://github.com/tas50)) <!-- 14.5.4 -->
+- Remove the CBGB [#7619](https://github.com/chef/chef/pull/7619) ([nathenharvey](https://github.com/nathenharvey)) <!-- 14.5.3 -->
+- Update rubyzip to 1.2.2 [#7618](https://github.com/chef/chef/pull/7618) ([tas50](https://github.com/tas50)) <!-- 14.5.2 -->
+- Shorten the resource collision deprecation message [#7601](https://github.com/chef/chef/pull/7601) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 14.5.1 -->
+- Update inspec-core to 2.2.78 [#7606](https://github.com/chef/chef/pull/7606) ([tas50](https://github.com/tas50)) <!-- 14.5.0 -->
- Update property descriptions and remove extra nil types [#7604](https://github.com/chef/chef/pull/7604) ([tas50](https://github.com/tas50)) <!-- 14.4.63 -->
- Allow resource_inspector be used outside the binary [#7609](https://github.com/chef/chef/pull/7609) ([tas50](https://github.com/tas50)) <!-- 14.4.62 -->
- windows_auto_run: Avoid declare_resource where it&#39;s not needed [#7608](https://github.com/chef/chef/pull/7608) ([tas50](https://github.com/tas50)) <!-- 14.4.61 -->
diff --git a/Gemfile.lock b/Gemfile.lock
index 7dce9d4dcf..0c0690816d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -9,10 +9,10 @@ GIT
PATH
remote: .
specs:
- chef (14.4.63)
+ chef (14.5.13)
addressable
bundler (>= 1.10)
- chef-config (= 14.4.63)
+ chef-config (= 14.5.13)
chef-zero (>= 13.0)
diff-lcs (~> 1.2, >= 1.2.4)
erubis (~> 2.7)
@@ -40,10 +40,10 @@ PATH
specinfra (~> 2.10)
syslog-logger (~> 1.6)
uuidtools (~> 2.1.5)
- chef (14.4.63-universal-mingw32)
+ chef (14.5.13-universal-mingw32)
addressable
bundler (>= 1.10)
- chef-config (= 14.4.63)
+ chef-config (= 14.5.13)
chef-zero (>= 13.0)
diff-lcs (~> 1.2, >= 1.2.4)
erubis (~> 2.7)
@@ -86,7 +86,7 @@ PATH
PATH
remote: chef-config
specs:
- chef-config (14.4.63)
+ chef-config (14.5.13)
addressable
fuzzyurl
mixlib-config (>= 2.2.12, < 3.0)
@@ -149,7 +149,7 @@ GEM
highline (1.7.10)
htmlentities (4.3.4)
iniparse (1.4.4)
- inspec-core (2.2.70)
+ inspec-core (2.2.78)
addressable (~> 2.4)
faraday (>= 0.9.0)
hashie (~> 3.4)
@@ -167,7 +167,7 @@ GEM
sslshake (~> 1.2)
thor (~> 0.20)
tomlrb (~> 1.2)
- train-core (~> 1.4, >= 1.4.15)
+ train-core (~> 1.4, >= 1.4.35)
ipaddress (0.8.3)
iso8601 (0.11.0)
json (2.1.0)
@@ -202,7 +202,7 @@ GEM
net-ssh-gateway (>= 1.2.0)
net-telnet (0.2.0)
netrc (0.11.0)
- octokit (4.10.0)
+ octokit (4.11.0)
sawyer (~> 0.8.0, >= 0.5.3)
ohai (14.4.2)
chef-config (>= 12.8, < 15)
@@ -271,7 +271,7 @@ GEM
ruby-prof (0.17.0)
ruby-progressbar (1.10.0)
ruby-shadow (2.5.0)
- rubyzip (1.2.1)
+ rubyzip (1.2.2)
safe_yaml (1.0.4)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index a86370cad3..5e37f3aeb5 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -7,13 +7,13 @@ This file holds "in progress" release notes for the current release under develo
Several new commands have been added under `knife config` to help manage multiple
profiles in your `credentials` file.
-`knife config get-profile` will display the active profile.
+`knife config get-profile` displays the active profile.
-`knife config use-profile PROFILE` will set the workstation-level default
-profile. That default can still be overridden by the `--profile` command line
+`knife config use-profile PROFILE` sets the workstation-level default
+profile. You can still override this setting with the `--profile` command line
option or the `$CHEF_PROFILE` environment variable.
-`knife config list-profiles` will display all your available profiles along with
+`knife config list-profiles` displays all your available profiles along with
summary information on each.
```bash
@@ -36,53 +36,39 @@ The following new previous resources were added to Chef 14.4. Cookbooks with the
### Cron_d
-Use the cron_d resource to manage cron definitions in /etc/cron.d. This is similar to the `cron` resource, but it does not use the monolithic /etc/crontab. file.
-
-See [cron_d](https://docs.chef.io/resource_cron_d.html) resource documentation for full usage.
+Use the [cron_d](https://docs.chef.io/resource_cron_d.html) resource to manage cron definitions in /etc/cron.d. This is similar to the `cron` resource, but it does not use the monolithic `/etc/crontab`. file.
### Cron_access
-Use the cron_access resource to manage the /etc/cron.allow and /etc/cron.deny files. This resource previously shipped in the `cron` community cookbook and has fully backwards compatibility with the previous `cron_manage` definition in that cookbook.
-
-See [cron_access](https://docs.chef.io/resource_cron_access.html) resource documentation for full usage.
+Use the [cron_access](https://docs.chef.io/resource_cron_access.html) resource to manage the `/etc/cron.allow` and `/etc/cron.deny` files. This resource previously shipped in the `cron` community cookbook and has fully backwards compatibility with the previous `cron_manage` definition in that cookbook.
### openssl_x509_certificate
-Use the openssl_x509_certificate resourc to generate signed or self-signed, PEM-formatted x509 certificates. If no existing key is specified, the resource will automatically generate a passwordless key with the certificate. If a CA private key and certificate are provided, the certificate will be signed with them. This resource previously shipped in the `openssl` cookbook as `openssl_x509` and is fully backwards compatible with the legacy resource name.
+Use the [openssl_x509_certificate](https://docs.chef.io/resource_openssl_x509_certificate.html) resource to generate signed or self-signed, PEM-formatted x509 certificates. If no existing key is specified, the resource automatically generates a passwordless key with the certificate. If a CA private key and certificate are provided, the certificate will be signed with them. This resource previously shipped in the `openssl` cookbook as `openssl_x509` and is fully backwards compatible with the legacy resource name.
-See [openssl_x509_certificate](https://docs.chef.io/resource_openssl_x509_certificate.html) resource documentation for full usage.
-
-Thank you [@juju482](https://github.com/juju482) for updating this resource so it could be included here.
+Thank you [@juju482](https://github.com/juju482) for updating this resource!
### openssl_x509_request
-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.
-
-See [openssl_x509_request](https://docs.chef.io/resource_openssl_x509_request.html) resource documentation for full usage.
+Use the [openssl_x509_request](https://docs.chef.io/resource_openssl_x509_request.html) resource to generate PEM-formatted x509 certificates requests. If no existing key is specified, the resource automatically generates a passwordless key with the certificate.
Thank you [@juju482](https://github.com/juju482) for contributing this resource.
### openssl_x509_crl
-Use the openssl_x509_crl resource to generate PEM-formatted x509 certificate revocation list (CRL) files.
-
-See [openssl_x509_crl](https://docs.chef.io/resource_openssl_x509_crl.html) resource documentation for full usage.
+Use the [openssl_x509_crl](https://docs.chef.io/resource_openssl_x509_crl.html)l resource to generate PEM-formatted x509 certificate revocation list (CRL) files.
Thank you [@juju482](https://github.com/juju482) for contributing this resource.
### openssl_ec_private_key
-Use the openssl_ec_private_key resource to generate ec private key files. If a valid ec key file can be opened at the specified location, no new file will be created.
-
-See [openssl_ec_private_key](https://docs.chef.io/resource_openssl_ec_private_key.html) resource documentation for full usage.
+Use the [openssl_ec_private_key](https://docs.chef.io/resource_openssl_ec_private_key.html) resource to generate ec private key files. If a valid ec key file can be opened at the specified location, no new file will be created.
Thank you [@juju482](https://github.com/juju482) for contributing this resource.
### openssl_ec_public_key
-Use the openssl_ec_public_key resource to generate ec public key files given a private key.
-
-See [openssl_ec_public_key](https://docs.chef.io/resource_openssl_ec_public_key.html) resource documentation for full usage.
+Use the [openssl_ec_public_key](https://docs.chef.io/resource_openssl_ec_public_key.html) resource to generate ec public key files given a private key.
Thank you [@juju482](https://github.com/juju482) for contributing this resource.
@@ -94,7 +80,7 @@ The windows_package resource now supports setting the `sensitive` property to av
### sysctl
-The sysctl resource will now update the on-disk systctl.d file even if the current sysctl value matches the desired value.
+The sysctl resource will now update the on-disk `systctl.d` file even if the current sysctl value matches the desired value.
### windows_task
@@ -102,17 +88,17 @@ The windows_task resource now supports setting the task priority of the schedule
### ifconfig
-The ifconfig resource now supports setting the interface's VLAN via a new `vlan` property on RHEL platform_family and setting the interface's gateway via a new `gateway` property on RHEL/Debian platform_family.
+The ifconfig resource now supports setting the interface's VLAN via a new `vlan` property on RHEL `platform_family` and setting the interface's gateway via a new `gateway` property on RHEL/Debian `platform_family`.
Thank you [@tomdoherty](https://github.com/tomdoherty) for this contribution.
### route
-The route resource has been improved to support additional RHEL platform_family systems as well as Amazon Linux.
+The route resource now supports additional RHEL platform_family systems as well as Amazon Linux.
### systemd_unit
-The systemd_unit resource now supports specifying options multiple times in the content hash. Instead of setting the value to a string you can now set it to an array of strings.
+The [systemd_unit](https://docs.chef.io/resource_systemd_unit.html) resource now supports specifying options multiple times in the content hash. Instead of setting the value to a string you can now set it to an array of strings.
Thank you [@dbresson](https://github.com/dbresson) for this contribution.
@@ -1472,7 +1458,7 @@ It is now possible to load Solaris services recursively, by ensuring the new `op
This is the inverse of the pre-existing whitelisting functionality.
-## The guard interpreter for `powershell_script` is Powershell, again
+## The guard interpreter for `powershell_script` is PowerShell, again
When writing `not_if` or `only_if` statements, by default we now run those statements using powershell, rather than forcing the user to set `guard_interpreter` each time.
diff --git a/Rakefile b/Rakefile
index e42832c365..375f269714 100644
--- a/Rakefile
+++ b/Rakefile
@@ -19,7 +19,6 @@
require_relative "tasks/rspec"
require_relative "tasks/maintainers"
-require_relative "tasks/cbgb"
require_relative "tasks/dependencies"
require_relative "tasks/announce"
diff --git a/VERSION b/VERSION
index 20dc27e58b..d2d0c9e015 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-14.4.63 \ No newline at end of file
+14.5.13 \ No newline at end of file
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index 784cb73a5e..6957f511d5 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -21,7 +21,7 @@
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__)
- VERSION = "14.4.63".freeze
+ VERSION = "14.5.13".freeze
end
#
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index 343b037c8b..07ee501ff7 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -296,9 +296,9 @@ class Chef
# we're just going to make cookbook_files out of these and make the
# cookbook find them by filespecificity again. but it's the shortest
# path to "success" for now.
- if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]+\/#{Regexp.escape(dirname)})\/.+$/
+ if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)})\/.+$/
specificity_dirname = $1
- non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]+\/#{Regexp.escape(dirname)}\/(.+)$/, 1]
+ non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)}\/(.+)$/, 1]
# Record the specificity_dirname only if it's in the list of
# valid preferences
if filenames_by_pref[specificity_dirname]
diff --git a/lib/chef/mixin/powershell_out.rb b/lib/chef/mixin/powershell_out.rb
index 1a757074c2..f910360d36 100644
--- a/lib/chef/mixin/powershell_out.rb
+++ b/lib/chef/mixin/powershell_out.rb
@@ -86,7 +86,7 @@ class Chef
# always set the ExecutionPolicy flag
# see http://technet.microsoft.com/en-us/library/ee176961.aspx
"-ExecutionPolicy Unrestricted",
- # Powershell will hang if STDIN is redirected
+ # PowerShell will hang if STDIN is redirected
# http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected
"-InputFormat None",
]
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index a4891234f5..ac60b590b6 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -38,19 +38,13 @@
class Chef
class NodeMap
COLLISION_WARNING_14 = <<~EOH.gsub(/\s+/, " ").strip
- %{type_caps} %{key} has been loaded from a cookbook. The %{type} %{key} is now
- included in Chef and will take precedence over the existing cookbook %{type} in the
- next major release of Chef (15.0, April 2019). You may be able to remove this cookbook dependency from
- your runlist if you do not use other recipes/resources/libraries from the cookbook.
- Alternatively there may be a newer version of this cookbook without the %{key} %{type}.
+ %{type_caps} %{key} from a cookbook is overriding the %{type} from the client. Please upgrade your cookbook
+ or remove the cookbook from your run_list before the next major release of Chef.
EOH
COLLISION_WARNING_15 = <<~EOH.gsub(/\s+/, " ").strip
- %{type_caps} %{key} attempted to load from a cookbook. The %{type} %{key} is now
- included in Chef and takes precedence over the existing cookbook %{type}
- which will be ignored. You may be able to remove this cookbook dependency from
- your runlist if you do not use other recipes/resources/libraries from the cookbook.
- Alternatively there may be a newer version of this cookbook without the %{key} %{type}.
+ %{type_caps} %{key} from the client is overriding the %{type} from a cookbook. Please upgrade your cookbook
+ or remove the cookbook from your run_list.
EOH
#
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb
index 3a209a08a1..864373f902 100644
--- a/lib/chef/provider/dsc_resource.rb
+++ b/lib/chef/provider/dsc_resource.rb
@@ -48,10 +48,10 @@ class Chef
def define_resource_requirements
requirements.assert(:run) do |a|
a.assertion { supports_dsc_invoke_resource? }
- err = ["You must have Powershell version >= 5.0.10018.0 to use dsc_resource."]
+ err = ["You must have PowerShell version >= 5.0.10018.0 to use dsc_resource."]
a.failure_message Chef::Exceptions::ProviderNotFound,
err
- a.whyrun err + ["Assuming a previous resource installs Powershell 5.0.10018.0 or higher."]
+ a.whyrun err + ["Assuming a previous resource installs PowerShell 5.0.10018.0 or higher."]
a.block_action!
end
requirements.assert(:run) do |a|
diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb
index fd20f34786..4a44a9ea23 100644
--- a/lib/chef/provider/dsc_script.rb
+++ b/lib/chef/provider/dsc_script.rb
@@ -63,11 +63,11 @@ class Chef
err = [
"Could not find PowerShell DSC support on the system",
powershell_info_str,
- "Powershell 4.0 or higher was not detected on your system and is required to use the dsc_script resource.",
+ "PowerShell 4.0 or higher was not detected on your system and is required to use the dsc_script resource.",
]
a.assertion { supports_dsc? }
a.failure_message Chef::Exceptions::ProviderNotFound, err.join(" ")
- a.whyrun err + ["Assuming a previous resource installs Powershell 4.0 or higher."]
+ a.whyrun err + ["Assuming a previous resource installs PowerShell 4.0 or higher."]
a.block_action!
end
end
@@ -175,9 +175,9 @@ class Chef
def powershell_info_str
if run_context && run_context.node[:languages] && run_context.node[:languages][:powershell]
- install_info = "Powershell #{run_context.node[:languages][:powershell][:version]} was found on the system."
+ install_info = "PowerShell #{run_context.node[:languages][:powershell][:version]} was found on the system."
else
- install_info = "Powershell was not found."
+ install_info = "PowerShell was not found."
end
end
end
diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb
index a65146b1e3..9af1344138 100644
--- a/lib/chef/provider/package/powershell.rb
+++ b/lib/chef/provider/package/powershell.rb
@@ -37,7 +37,7 @@ class Chef
def define_resource_requirements
super
if powershell_out("$PSVersionTable.PSVersion.Major").stdout.strip.to_i < 5
- raise "Minimum installed Powershell Version required is 5"
+ raise "Minimum installed PowerShell Version required is 5"
end
requirements.assert(:install) do |a|
a.assertion { candidates_exist_for_all_uninstalled? }
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb
index 31521c3675..529ae409d8 100644
--- a/lib/chef/provider/powershell_script.rb
+++ b/lib/chef/provider/powershell_script.rb
@@ -129,7 +129,7 @@ EOH
"-NonInteractive",
"-NoProfile",
"-ExecutionPolicy #{execution_policy}",
- # Powershell will hang if STDIN is redirected
+ # PowerShell will hang if STDIN is redirected
# http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected
"-InputFormat None",
]
@@ -137,10 +137,10 @@ EOH
# A wrapper script is used to launch user-supplied script while
# still obtaining useful process exit codes. Unless you
- # explicitly call exit in Powershell, the powershell.exe
+ # explicitly call exit in PowerShell, the powershell.exe
# interpreter returns only 0 for success or 1 for failure. Since
# we'd like to get specific exit codes from executable tools run
- # with Powershell, we do some work using the automatic variables
+ # with PowerShell, we do some work using the automatic variables
# $? and $LASTEXITCODE to return the process exit code of the
# last process run in the script if it is the last command
# executed, otherwise 0 or 1 based on whether $? is set to true
diff --git a/lib/chef/resource/apt_package.rb b/lib/chef/resource/apt_package.rb
index 4738d0cbbe..3f4a36489d 100644
--- a/lib/chef/resource/apt_package.rb
+++ b/lib/chef/resource/apt_package.rb
@@ -31,6 +31,7 @@ class Chef
desired_state: false
property :overwrite_config_files, [TrueClass, FalseClass],
+ introduced: "14.0",
description: "Overwrite existing config files with those in the package if prompted by apt.",
default: false
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index a0d24a646b..7ff337ec7c 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -36,7 +36,7 @@ class Chef
regex: [/^[^\/]+$/],
description: "The name of the repository to configure, if it differs from the name of the resource block. The value of this setting must not contain spaces.",
validation_message: "repo_name property cannot contain a forward slash '/'",
- name_property: true
+ introduced: "14.1", name_property: true
property :uri, String,
description: "The base of the Debian distribution."
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index 7c549fb236..99722b14ed 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -29,7 +29,7 @@ class Chef
property :name, String, default: ""
property :compile_time, [TrueClass, FalseClass],
- description: "Install build essential packages at compile time.",
+ description: "Install the build essential packages at compile time.",
default: false
action :install do
@@ -38,22 +38,22 @@ class Chef
case node["platform_family"]
when "debian"
- declare_resource(:package, %w{ autoconf binutils-doc bison build-essential flex gettext ncurses-dev })
+ package %w{ autoconf binutils-doc bison build-essential flex gettext ncurses-dev }
when "amazon", "fedora", "rhel"
- declare_resource(:package, %w{ autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch })
+ package %w{ autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch }
# Ensure GCC 4 is available on older pre-6 EL
- declare_resource(:package, %w{ gcc44 gcc44-c++ }) if platform_family?("rhel") && node["platform_version"].to_i < 6
+ package %w{ gcc44 gcc44-c++ } if platform_family?("rhel") && node["platform_version"].to_i < 6
when "freebsd"
- declare_resource(:package, "devel/gmake")
- declare_resource(:package, "devel/autoconf")
- declare_resource(:package, "devel/m4")
- declare_resource(:package, "devel/gettext")
+ package "devel/gmake"
+ package "devel/autoconf"
+ package "devel/m4"
+ package "devel/gettext"
when "mac_os_x"
unless xcode_cli_installed?
# This script was graciously borrowed and modified from Tim Sutton's
# osx-vm-templates at https://github.com/timsutton/osx-vm-templates/blob/b001475df54a9808d3d56d06e71b8fa3001fff42/scripts/xcode-cli-tools.sh
- declare_resource(:execute, "install XCode Command Line tools") do
+ execute "install XCode Command Line tools" do
command <<-EOH.gsub(/^ {14}/, "")
# create the placeholder file that's checked by CLI updates' .dist code
# in Apple's SUS catalog
@@ -68,46 +68,46 @@ class Chef
end
end
when "omnios"
- declare_resource(:package, "developer/gcc48")
- declare_resource(:package, "developer/object-file")
- declare_resource(:package, "developer/linker")
- declare_resource(:package, "developer/library/lint")
- declare_resource(:package, "developer/build/gnu-make")
- declare_resource(:package, "system/header")
- declare_resource(:package, "system/library/math/header-math")
+ package "developer/gcc48"
+ package "developer/object-file"
+ package "developer/linker"
+ package "developer/library/lint"
+ package "developer/build/gnu-make"
+ package "system/header"
+ package "system/library/math/header-math"
# Per OmniOS documentation, the gcc bin dir isn't in the default
# $PATH, so add it to the running process environment
# http://omnios.omniti.com/wiki.php/DevEnv
ENV["PATH"] = "#{ENV['PATH']}:/opt/gcc-4.7.2/bin"
when "solaris2"
- declare_resource(:package, "autoconf")
- declare_resource(:package, "automake")
- declare_resource(:package, "bison")
- declare_resource(:package, "gnu-coreutils")
- declare_resource(:package, "flex")
- declare_resource(:package, "gcc") do
+ package "autoconf"
+ package "automake"
+ package "bison"
+ package "gnu-coreutils"
+ package "flex"
+ package "gcc" do
# lock because we don't use 5 yet
version "4.8.2"
end
- declare_resource(:package, "gcc-3")
- declare_resource(:package, "gnu-grep")
- declare_resource(:package, "gnu-make")
- declare_resource(:package, "gnu-patch")
- declare_resource(:package, "gnu-tar")
- declare_resource(:package, "make")
- declare_resource(:package, "pkg-config")
- declare_resource(:package, "ucb")
+ package "gcc-3"
+ package "gnu-grep"
+ package "gnu-make"
+ package "gnu-patch"
+ package "gnu-tar"
+ package "make"
+ package "pkg-config"
+ package "ucb"
when "smartos"
- declare_resource(:package, "autoconf")
- declare_resource(:package, "binutils")
- declare_resource(:package, "build-essential")
- declare_resource(:package, "gcc47")
- declare_resource(:package, "gmake")
- declare_resource(:package, "pkg-config")
+ package "autoconf"
+ package "binutils"
+ package "build-essential"
+ package "gcc47"
+ package "gmake"
+ package "pkg-config"
when "suse"
- declare_resource(:package, %w{ autoconf bison flex gcc gcc-c++ kernel-default-devel make m4 })
- declare_resource(:package, %w{ gcc48 gcc48-c++ }) if node["platform_version"].to_i < 12
+ package %w{ autoconf bison flex gcc gcc-c++ kernel-default-devel make m4 }
+ package %w{ gcc48 gcc48-c++ } if node["platform_version"].to_i < 12
else
Chef::Log.warn <<-EOH
The build_essential resource does not currently support the '#{node['platform_family']}'
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index 3304690901..0a1b2ef736 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -37,10 +37,13 @@ class Chef
resource_name :chef_gem
property :gem_binary, default: "#{RbConfig::CONFIG['bindir']}/gem",
+ description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by the chef-client will be installed.",
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" },
}
- property :compile_time, [TrueClass, FalseClass], default: false, desired_state: false
+ property :compile_time, [TrueClass, FalseClass],
+ description: "Controls the phase during which a gem is installed on a node. Set to 'true' to install a gem while the resource collection is being built (the 'compile phase'). Set to 'false' to install a gem while the chef-client is configuring the node (the 'converge phase').",
+ default: false, desired_state: false
# force the resource to compile time if the compile time property has been set
def after_created
diff --git a/lib/chef/resource/chocolatey_package.rb b/lib/chef/resource/chocolatey_package.rb
index 0aa8a41613..c7d5a8a680 100644
--- a/lib/chef/resource/chocolatey_package.rb
+++ b/lib/chef/resource/chocolatey_package.rb
@@ -43,7 +43,8 @@ class Chef
property :returns, [Integer, Array],
description: "The exit code(s) returned a chocolatey package that indicate success.",
- default: [ 0 ], desired_state: false
+ default: [ 0 ], desired_state: false,
+ introduced: "12.18"
end
end
end
diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb
index 1f18a4b951..c585985291 100644
--- a/lib/chef/resource/directory.rb
+++ b/lib/chef/resource/directory.rb
@@ -40,8 +40,12 @@ class Chef
default_action :create
allowed_actions :create, :delete
- property :path, String, name_property: true, identity: true
- property :recursive, [ TrueClass, FalseClass ], default: false
+ property :path, String, name_property: true, identity: true,
+ description: "The path to the directory. Using a fully qualified path is recommended, but is not always required."
+
+ property :recursive, [ TrueClass, FalseClass ],
+ description: "Create or delete parent directories recursively. For the owner, group, and mode properties, the value of this attribute applies only to the leaf directory.",
+ default: false
end
end
end
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index af0bc341b4..7442a8f455 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -23,10 +23,7 @@ class Chef
resource_name :dmg_package
provides(:dmg_package) { true }
- description "Use the dmg_package resource to install a dmg 'package'. The resource will retrieve the"\
- " dmg file from a remote URL, mount it using OS X's hdidutil, copy the application (.app directory)"\
- " to the specified destination (/Applications), and detach the image using hdiutil. The dmg file"\
- " will be stored in the Chef::Config[:file_cache_path]."
+ description "Use the dmg_package resource to install a dmg 'package'. The resource will retrieve the dmg file from a remote URL, mount it using OS X's hdidutil, copy the application (.app directory) to the specified destination (/Applications), and detach the image using hdiutil. The dmg file will be stored in the Chef::Config[:file_cache_path]."
introduced "14.0"
property :app, String,
diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb
index 13bdc5065e..3b40a6dffb 100644
--- a/lib/chef/resource/dnf_package.rb
+++ b/lib/chef/resource/dnf_package.rb
@@ -40,36 +40,33 @@ class Chef
provides :dnf_package
- description "Use the dnf_package resource to install, upgrade, and remove packages"\
- " with DNF for Fedora platforms. The dnf_package resource is able to"\
- " resolve provides data for packages much like DNF can do when it is"\
- " run from the command line. This allows a variety of options for"\
- " installing packages, like minimum versions, virtual provides,"\
- " and library names."
+ description "Use the dnf_package resource to install, upgrade, and remove packages with DNF for Fedora platforms. The dnf_package resource is able to resolve provides data for packages much like DNF can do when it is run from the command line. This allows a variety of options for installing packages, like minimum versions, virtual provides and library names."
introduced "12.18"
allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock, :flush_cache
# Install a specific arch
- property :arch, [String, Array], coerce: proc { |x| [x].flatten }
+ property :arch, [String, Array],
+ description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.",
+ coerce: proc { |x| [x].flatten }
# Flush the in-memory available/installed cache, this does not flush the dnf caches on disk
- property :flush_cache,
- Hash,
- default: { before: false, after: false },
- coerce: proc { |v|
- if v.is_a?(Hash)
- v
- elsif v.is_a?(Array)
- v.each_with_object({}) { |arg, obj| obj[arg] = true }
- elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
- { before: v, after: v }
- elsif v == :before
- { before: true, after: false }
- elsif v == :after
- { after: true, before: false }
- end
- }
+ 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-client creates a copy of the local cache, and then stores it in-memory during the chef-client run. The in-memory cache allows packages to be installed during the chef-client run without the need to continue synchronizing the remote metadata to the local cache while the chef-client run is in-progress.",
+ default: { before: false, after: false },
+ coerce: proc { |v|
+ if v.is_a?(Hash)
+ v
+ elsif v.is_a?(Array)
+ v.each_with_object({}) { |arg, obj| obj[arg] = true }
+ elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
+ { before: v, after: v }
+ elsif v == :before
+ { before: true, after: false }
+ elsif v == :after
+ { after: true, before: false }
+ end
+ }
def allow_downgrade(arg = nil)
if !arg.nil?
diff --git a/lib/chef/resource/dpkg_package.rb b/lib/chef/resource/dpkg_package.rb
index e60764ba8d..742b291508 100644
--- a/lib/chef/resource/dpkg_package.rb
+++ b/lib/chef/resource/dpkg_package.rb
@@ -24,9 +24,7 @@ class Chef
resource_name :dpkg_package
provides :dpkg_package
- description "Use the dpkg_package resource to manage packages for the dpkg platform."\
- " When a package is installed from a local file, it must be added to the"\
- " node using the remote_file or cookbook_file resources."
+ description "Use the dpkg_package resource to manage packages for the dpkg platform. When a package is installed from a local file, it must be added to the node using the remote_file or cookbook_file resources."
property :source, [ String, Array, nil ],
description: "The path to a package in the local file system."
diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb
index 8381698dc1..06c4103bc3 100644
--- a/lib/chef/resource/dsc_resource.rb
+++ b/lib/chef/resource/dsc_resource.rb
@@ -23,10 +23,7 @@ class Chef
resource_name :dsc_resource
provides :dsc_resource
- description "The dsc_resource resource allows any DSC resource to be used in a"\
- " Chef recipe, as well as any custom resources that have been added"\
- " to your Windows PowerShell environment. Microsoft frequently adds"\
- " new resources to the DSC resource collection."
+ description "The dsc_resource resource allows any DSC resource to be used in a Chef recipe, as well as any custom resources that have been added to your Windows PowerShell environment. Microsoft frequently adds new resources to the DSC resource collection."
introduced "12.2"
# This class will check if the object responds to
@@ -76,7 +73,7 @@ class Chef
property :module_version, String,
introduced: "12.21",
- description: "The version number of the module to use. Powershell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name."
+ description: "The version number of the module to use. PowerShell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name."
def property(property_name, value = nil)
if not property_name.is_a?(Symbol)
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index e941e4e918..d98c74ccc3 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -28,14 +28,7 @@ class Chef
resource_name :dsc_script
provides :dsc_script
- description "Many DSC resources are comparable to built-in Chef resources. For"\
- " example, both DSC and Chef 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, 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 recipe."
+ description "Many DSC resources are comparable to built-in Chef resources. For example, both DSC and Chef 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, 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 recipe."
default_action :run
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 93f8063d5d..1becbf50a7 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -98,9 +98,12 @@ class Chef
description: "Windows only: The password of the user specified by the user property. 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."
# lazy used to set default value of sensitive to true if password is set
- property :sensitive, [ TrueClass, FalseClass ], default: lazy { |r| r.password ? true : false }
+ property :sensitive, [ TrueClass, FalseClass ],
+ description: "Ensure that sensitive resource data is not logged by the chef-client.",
+ default: lazy { |r| r.password ? true : false }
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 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"
def self.set_guard_inherited_attributes(*inherited_attributes)
diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb
index 7e756db78f..d0a78adc0e 100644
--- a/lib/chef/resource/git.rb
+++ b/lib/chef/resource/git.rb
@@ -21,11 +21,11 @@ require "chef/resource/scm"
class Chef
class Resource
class Git < Chef::Resource::Scm
- 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."
+ 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."
- property :additional_remotes, Hash, default: lazy { Hash.new }
+ property :additional_remotes, Hash,
+ description: "A Hash of additional remotes that are added to the git repository configuration.",
+ default: lazy { Hash.new }
alias :branch :revision
alias :reference :revision
diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb
index 6e92fb821c..455d032819 100644
--- a/lib/chef/resource/http_request.rb
+++ b/lib/chef/resource/http_request.rb
@@ -25,9 +25,7 @@ class Chef
resource_name :http_request
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/locale.rb b/lib/chef/resource/locale.rb
new file mode 100644
index 0000000000..01a4577c43
--- /dev/null
+++ b/lib/chef/resource/locale.rb
@@ -0,0 +1,92 @@
+#
+# Copyright:: 2011-2016, Heavy Water Software Inc.
+# Copyright:: 2016-2018, 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 slanguage governing permissions and
+# limitations under the License.
+#
+
+require "chef/resource"
+
+class Chef
+ class Resource
+ class Locale < Chef::Resource
+ preview_resource true
+ resource_name :locale
+
+ description "Use the locale resource to set the system's locale"
+ introduced "14.5"
+
+ property :lang, String,
+ default: "en_US.utf8",
+ description: "Sets the default system language."
+ property :lc_all, String,
+ default: "en_US.utf8",
+ description: "Sets the fallback system language."
+
+ action :update do
+ description "Updates the system locale"
+ if node["init_package"] == "systemd"
+ # on systemd settings LC_ALL is (correctly) reserved only for testing and cannot be set globally
+ execute "localectl set-locale LANG=#{new_resource.lang}" do
+ # RHEL uses /etc/locale.conf
+ not_if { up_to_date?("/etc/locale.conf", new_resource.lang) } if ::File.exist?("/etc/locale.conf")
+ # Ubuntu 16.04 still uses /etc/default/locale
+ not_if { up_to_date?("/etc/default/locale", new_resource.lang) } if ::File.exist?("/etc/default/locale")
+ end
+ elsif ::File.exist?("/etc/sysconfig/i18n")
+ locale_file_path = "/etc/sysconfig/i18n"
+
+ updated = up_to_date?(locale_file_path, new_resource.lang, new_resource.lc_all)
+
+ file locale_file_path do
+ content lazy {
+ locale = IO.read(locale_file_path)
+ variables = Hash[locale.lines.map { |line| line.strip.split("=") }]
+ variables["LANG"] = new_resource.lang
+ variables["LC_ALL"] =
+ variables.map { |pairs| pairs.join("=") }.join("\n") + "\n"
+ }
+ not_if { updated }
+ end
+
+ execute "reload root's lang profile script" do
+ command "source source /etc/sysconfig/i18n; source /etc/profile.d/lang.sh"
+ not_if { updated }
+ end
+ elsif ::File.exist?("/usr/sbin/update-locale")
+ execute "Generate locales" do
+ command "locale-gen"
+ not_if { up_to_date?("/etc/default/locale", new_resource.lang, new_resource.lc_all) }
+ end
+
+ execute "Update locale" do
+ command "update-locale LANG=#{new_resource.lang} LC_ALL=#{new_resource.lc_all}"
+ not_if { up_to_date?("/etc/default/locale", new_resource.lang, new_resource.lc_all) }
+ end
+ else
+ raise "#{node["platform"]} platform not supported by the chef locale resource."
+ end
+ end
+
+ action_class do
+ def up_to_date?(file_path, lang, lc_all = nil)
+ locale = IO.read(file_path)
+ locale.include?("LANG=#{lang}") &&
+ (node["init_package"] == "systemd" || lc_all.nil? || locale.include?("LC_ALL=#{lc_all}"))
+ rescue
+ false
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb
index 3cf44eb161..f2ad5a0213 100644
--- a/lib/chef/resource/macos_userdefaults.rb
+++ b/lib/chef/resource/macos_userdefaults.rb
@@ -25,9 +25,7 @@ class Chef
provides(:mac_os_x_userdefaults) { true }
provides(:macos_userdefaults) { true }
- description "Use the macos_userdefaults resource to manage the macOS user defaults system. The properties"\
- " of this resource are passed to the defaults command, and the parameters follow the convention"\
- " of that command. See the defaults(1) man page for details on how the tool works."
+ description "Use the macos_userdefaults resource to manage the macOS user defaults system. The properties of this resource are passed to the defaults command, and the parameters follow the convention of that command. See the defaults(1) man page for details on how the tool works."
introduced "14.0"
property :domain, String,
@@ -57,8 +55,8 @@ class Chef
default: false,
desired_state: false
+ # @todo this should get refactored away: https://github.com/chef/chef/issues/7622
property :is_set, [TrueClass, FalseClass],
- description: "",
default: false,
desired_state: false
diff --git a/lib/chef/resource/macosx_service.rb b/lib/chef/resource/macosx_service.rb
index 8fa8fd7a36..deff6e1927 100644
--- a/lib/chef/resource/macosx_service.rb
+++ b/lib/chef/resource/macosx_service.rb
@@ -31,9 +31,8 @@ class Chef
state_attrs :enabled, :running
- # This will enable user to pass a plist in the case
- # that the filename and label for the service dont match
- property :plist, String
+ property :plist, String,
+ description: "A plist to use in the case where the filename and label for the service do not match."
property :session_type, String
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb
index dffb96cb53..68ecee2335 100644
--- a/lib/chef/resource/mount.rb
+++ b/lib/chef/resource/mount.rb
@@ -29,32 +29,59 @@ class Chef
# this is a poor API please do not re-use this pattern
property :supports, Hash,
- default: lazy { { remount: false } },
- coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x }
+ description: "Specify a Hash of supported mount features.",
+ default: lazy { { remount: false } },
+ coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x }
- property :password, String, sensitive: true
+ property :password, String,
+ description: "Windows only:. Use to specify the password for username.",
+ sensitive: true
- property :mount_point, String, name_property: true
- property :device, String, identity: true
+ property :mount_point, String, name_property: true,
+ 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,
+ description: "Required for :umount and :remount actions (for the purpose of checking the mount command output for presence). The special block device or remote node, a label, or a uuid to be mounted."
property :device_type, [String, Symbol],
- coerce: proc { |arg| arg.kind_of?(String) ? arg.to_sym : arg },
- default: :device,
- equal_to: RUBY_PLATFORM =~ /solaris/i ? %i{ device } : %i{ device label uuid }
+ description: "The type of device: :device, :label, or :uuid",
+ coerce: proc { |arg| arg.kind_of?(String) ? arg.to_sym : arg },
+ default: :device,
+ equal_to: RUBY_PLATFORM =~ /solaris/i ? %i{ device } : %i{ device label uuid }
+
+ # @todo this should get refactored away: https://github.com/chef/chef/issues/7621
+ property :mounted, [TrueClass, FalseClass], default: false
- property :fsck_device, String, default: "-"
- property :fstype, [String, nil], default: "auto"
+ property :fsck_device, String,
+ description: "Solaris only: The fsck device.",
+ default: "-"
+
+ property :fstype, [String, nil],
+ description: "The file system type (fstype) of the device.",
+ default: "auto"
property :options, [Array, String, nil],
- coerce: proc { |arg| arg.kind_of?(String) ? arg.split(",") : arg },
- default: %w{defaults}
+ description: "An array or comma separated list of options for the mount.",
+ coerce: proc { |arg| arg.kind_of?(String) ? arg.split(",") : arg },
+ default: %w{defaults}
- property :dump, [Integer, FalseClass], default: 0
- property :pass, [Integer, FalseClass], default: 2
- property :mounted, [TrueClass, FalseClass], default: false
- property :enabled, [TrueClass, FalseClass], default: false
- property :username, String
- property :domain, String
+ property :dump, [Integer, FalseClass],
+ description: "The dump frequency (in days) used while creating a file systems table (fstab) entry.",
+ default: 0
+
+ property :pass, [Integer, FalseClass],
+ description: "The pass number used by the file system check (fsck) command while creating a file systems table (fstab) entry.",
+ default: 2
+
+ property :enabled, [TrueClass, FalseClass],
+ description: "Use to specify if a mounted file system is enabled.",
+ default: false
+
+ property :username, String,
+ 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."
private
diff --git a/lib/chef/resource/msu_package.rb b/lib/chef/resource/msu_package.rb
index 85ab170ee0..9fd39491c9 100644
--- a/lib/chef/resource/msu_package.rb
+++ b/lib/chef/resource/msu_package.rb
@@ -34,13 +34,16 @@ class Chef
default_action :install
property :source, String,
- coerce: (proc do |s|
- unless s.nil?
- uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false)
- end
- end),
- default: lazy { |r| r.package_name }
- property :checksum, String, desired_state: false
+ description: "The local file path or URL for the MSU package.",
+ coerce: (proc do |s|
+ unless s.nil?
+ uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false)
+ end
+ end),
+ default: lazy { |r| r.package_name }
+
+ property :checksum, String, desired_state: false,
+ description: "SHA-256 digest used to verify the checksum of the downloaded MSU package."
end
end
end
diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb
index b286412434..6cd60de9f4 100644
--- a/lib/chef/resource/ohai.rb
+++ b/lib/chef/resource/ohai.rb
@@ -25,11 +25,9 @@ class Chef
resource_name :ohai
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-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 chef-client run."
- property :ohai_name, name_property: true
+ property :ohai_name, name_property: true, introduced: "12.17"
property :plugin, String
default_action :reload
diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb
index 612ff637e4..90166cc338 100644
--- a/lib/chef/resource/osx_profile.rb
+++ b/lib/chef/resource/osx_profile.rb
@@ -25,19 +25,24 @@ 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"
default_action :install
allowed_actions :install, :remove
- property :profile_name, String, name_property: true, identity: true
- property :profile, [ String, Hash ]
- property :identifier, String
- property :path, String
+ property :profile_name, String,
+ description: "Use to specify the name of the profile, if different from the name of the resource block.",
+ name_property: true, identity: true
+
+ property :profile, [ String, Hash ],
+ 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."
+
+ property :path, String,
+ description: "The path to write the profile to disk before loading it."
end
end
end
diff --git a/lib/chef/resource/package.rb b/lib/chef/resource/package.rb
index bbad5f7696..8954478ee3 100644
--- a/lib/chef/resource/package.rb
+++ b/lib/chef/resource/package.rb
@@ -53,12 +53,12 @@ class Chef
coerce: proc { |x| x.is_a?(String) ? x.shellsplit : x }
property :response_file, String,
- description: "",
+ description: "The direct path to the file used to pre-seed a package.",
desired_state: false
property :response_file_variables, Hash,
- description: "",
- default: lazy { {} }, desired_state: false
+ description: "A Hash of response file variables in the form of {'VARIABLE' => 'VALUE'}.",
+ default: lazy { Hash.new }, desired_state: false
property :source, String,
description: "The direct path to a the package on the host.",
diff --git a/lib/chef/resource/paludis_package.rb b/lib/chef/resource/paludis_package.rb
index 722163254f..f7f9187826 100644
--- a/lib/chef/resource/paludis_package.rb
+++ b/lib/chef/resource/paludis_package.rb
@@ -30,7 +30,9 @@ class Chef
allowed_actions :install, :remove, :upgrade
- property :timeout, default: 3600
+ property :timeout, Integer,
+ description: "The amount of time (in seconds) to wait before timing out.",
+ default: 3600
end
end
end
diff --git a/lib/chef/resource/portage_package.rb b/lib/chef/resource/portage_package.rb
index 43b0cfc74d..5e954581c7 100644
--- a/lib/chef/resource/portage_package.rb
+++ b/lib/chef/resource/portage_package.rb
@@ -26,7 +26,8 @@ class Chef
description "Use the portage_package resource to manage packages for the Gentoo platform."
- property :timeout, default: 3600
+ property :timeout, default: 3600,
+ description: "The amount of time (in seconds) to wait before timing out."
end
end
end
diff --git a/lib/chef/resource/powershell_package.rb b/lib/chef/resource/powershell_package.rb
index ba5a03ef8b..91e300584f 100644
--- a/lib/chef/resource/powershell_package.rb
+++ b/lib/chef/resource/powershell_package.rb
@@ -26,19 +26,27 @@ class Chef
resource_name :powershell_package
provides :powershell_package
- description "Use the powershell_package resource to install and manage packages via"\
- " the Powershell Package Manager for the Microsoft Windows platform. The"\
- " powershell_package resource requires administrative access, and a source"\
- " must be configured in the Powershell Package Manager via the Register-PackageSource command"
+ description "Use the powershell_package resource to install and manage packages via the PowerShell Package Manager for the Microsoft Windows platform. The powershell_package resource requires administrative access, and a source must be configured in the PowerShell Package Manager via the Register-PackageSource command"
introduced "12.16"
allowed_actions :install, :remove
- property :package_name, [String, Array], coerce: proc { |x| [x].flatten }
- property :version, [String, Array], coerce: proc { |x| [x].flatten }
- property :source, [String]
- property :skip_publisher_check, [true, false], default: false, introduced: "14.3",
- description: "Skip validating module author."
+ property :package_name, [String, Array],
+ description: "The name of the package. Default value: the name of the resource block.",
+ coerce: proc { |x| [x].flatten }
+
+ property :version, [String, Array],
+ description: "The version of a package to be installed or upgraded.",
+ coerce: proc { |x| [x].flatten }
+
+ property :source, String,
+ description: "Specify the source of the package.",
+ introduced: "14.0"
+
+ property :skip_publisher_check, [true, false],
+ description: "Skip validating module author.",
+ default: false, introduced: "14.3"
+
end
end
end
diff --git a/lib/chef/resource/powershell_package_source.rb b/lib/chef/resource/powershell_package_source.rb
index 1ed3b895a1..b3bad41f65 100644
--- a/lib/chef/resource/powershell_package_source.rb
+++ b/lib/chef/resource/powershell_package_source.rb
@@ -24,7 +24,7 @@ class Chef
preview_resource true
resource_name "powershell_package_source"
- description "Use the powershell_package_source resource to register a powershell package repository."
+ description "Use the powershell_package_source resource to register a PowerShell package repository."
introduced "14.3"
property :source_name, String,
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index bc649bee09..b9f748978f 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -34,8 +34,13 @@ class Chef
allowed_actions :request_reboot, :reboot_now, :cancel
default_action :nothing # make sure people are quite clear what they want
- property :reason, String, default: "Reboot by Chef"
- property :delay_mins, Integer, default: 0
+ property :reason, String,
+ description: "A string that describes the reboot action.",
+ default: "Reboot by Chef"
+
+ property :delay_mins, Integer,
+ description: "The amount of time (in minutes) to delay a reboot request.",
+ default: 0
end
end
end
diff --git a/lib/chef/resource/route.rb b/lib/chef/resource/route.rb
index b64dcf26c6..8c14394ace 100644
--- a/lib/chef/resource/route.rb
+++ b/lib/chef/resource/route.rb
@@ -28,7 +28,7 @@ class Chef
description "Use the route resource to manage the system routing table in a Linux environment."
property :target, String, identity: true, name_property: true
- property :comment, [String, nil]
+ property :comment, [String, nil], introduced: "14.0"
property :metric, [Integer, nil]
property :netmask, [String, nil]
property :gateway, [String, nil]
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb
index a4c3c3f180..fe4d88ccd2 100644
--- a/lib/chef/resource/systemd_unit.rb
+++ b/lib/chef/resource/systemd_unit.rb
@@ -52,7 +52,8 @@ class Chef
default: true, desired_state: false
property :unit_name, String, desired_state: false,
identity: true,
- name_property: true
+ name_property: true,
+ introduced: "13.7"
def to_ini
case content
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb
index d2848c71cd..8d864840d3 100644
--- a/lib/chef/resource/windows_ad_join.rb
+++ b/lib/chef/resource/windows_ad_join.rb
@@ -52,6 +52,9 @@ class Chef
description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the Chef run completes, or never. Note that a reboot is necessary for changes to take effect.",
default: :immediate
+ property :new_name, String,
+ description: "Specifies a new name for the computer in the new domain."
+
# define this again so we can default it to true. Otherwise failures print the password
property :sensitive, [TrueClass, FalseClass],
default: true
@@ -64,6 +67,7 @@ class Chef
cmd << "$credential = New-Object System.Management.Automation.PSCredential (\"#{new_resource.domain_user}\",$pswd);"
cmd << "Add-Computer -DomainName #{new_resource.domain_name} -Credential $credential"
cmd << " -OUPath \"#{new_resource.ou_path}\"" if new_resource.ou_path
+ cmd << " -NewName \"#{new_resource.new_name}\"" if new_resource.new_name
cmd << " -Force"
converge_by("join Active Directory domain #{new_resource.domain_name}") do
diff --git a/lib/chef/resource/windows_font.rb b/lib/chef/resource/windows_font.rb
index 2f61876e9a..4c895321c0 100644
--- a/lib/chef/resource/windows_font.rb
+++ b/lib/chef/resource/windows_font.rb
@@ -29,7 +29,7 @@ class Chef
introduced "14.0"
property :font_name, String,
- description: "The file name of the font file name to install if different than the resource name.",
+ description: "The name of the font file to install, if it differs from the resource name.",
name_property: true
property :source, String,
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index 905cacc477..f0ea7dbf50 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -38,28 +38,38 @@ class Chef
# its own arguments as unintended side-effects (and why functional languages that don't allow modifcations
# of variables eliminate entire classes of bugs).
# </lecture>
- property :package_name, [ String, Array ], identity: true, coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
- property :version, [ String, Array ], coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
- property :arch, [ String, Array ], coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
+ property :package_name, [ String, Array ],
+ description: "One of the following: the name of a package, the name of a package and its architecture, the name of a dependency.",
+ identity: true, coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
- property :flush_cache,
- Hash,
- default: { before: false, after: false },
- coerce: proc { |v|
- if v.is_a?(Hash)
- v
- elsif v.is_a?(Array)
- v.each_with_object({}) { |arg, obj| obj[arg] = true }
- elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
- { before: v, after: v }
- elsif v == :before
- { before: true, after: false }
- elsif v == :after
- { after: true, before: false }
- end
- }
+ property :version, [ String, Array ],
+ description: "The version of a package to be installed or upgraded. This property is ignored when using the ':upgrade' action.",
+ coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
- property :allow_downgrade, [ true, false ], default: false
+ property :arch, [ String, Array ],
+ description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.",
+ 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-client creates a copy of the local cache, and then stores it in-memory during the chef-client run. The in-memory cache allows packages to be installed during the chef-client run without the need to continue synchronizing the remote metadata to the local cache while the chef-client run is in-progress.",
+ default: { before: false, after: false },
+ coerce: proc { |v|
+ if v.is_a?(Hash)
+ v
+ elsif v.is_a?(Array)
+ v.each_with_object({}) { |arg, obj| obj[arg] = true }
+ elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
+ { before: v, after: v }
+ elsif v == :before
+ { before: true, after: false }
+ elsif v == :after
+ { after: true, before: false }
+ end
+ }
+
+ property :allow_downgrade, [ true, false ],
+ description: "Downgrade a package to satisfy requested version requirements.",
+ default: false
property :yum_binary, String
end
diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb
index ba7fb53ad1..df3bfb6454 100644
--- a/lib/chef/resource/yum_repository.rb
+++ b/lib/chef/resource/yum_repository.rb
@@ -143,7 +143,7 @@ class Chef
name_property: true
property :skip_if_unavailable, [TrueClass, FalseClass],
- description: ""
+ description: "Allow yum to continue if this repository cannot be contacted for any reason."
property :source, String,
description: "Use a custom template source instead of the default one."
diff --git a/lib/chef/resource/zypper_package.rb b/lib/chef/resource/zypper_package.rb
index b04668472f..6caa14c1a3 100644
--- a/lib/chef/resource/zypper_package.rb
+++ b/lib/chef/resource/zypper_package.rb
@@ -28,12 +28,12 @@ class Chef
description "Use the zypper_package resource to install, upgrade, and remove packages with Zypper for the SUSE Enterprise and OpenSUSE platforms."
property :gpg_check, [ TrueClass, FalseClass ],
- description: "Verify the package's GPG signature",
+ description: "Verify the package's GPG signature. Can also be controlled site-wide using the ``zypper_check_gpg`` config option.",
default: lazy { Chef::Config[:zypper_check_gpg] }
property :allow_downgrade, [ TrueClass, FalseClass ],
- description: "",
- default: false
+ description: "Allow downgrading a package to satisfy requested version requirements.",
+ default: false, introduced: "13.6"
end
end
end
diff --git a/lib/chef/resource_inspector.rb b/lib/chef/resource_inspector.rb
index 1559932940..7363aad2a6 100644
--- a/lib/chef/resource_inspector.rb
+++ b/lib/chef/resource_inspector.rb
@@ -56,6 +56,7 @@ module ResourceInspector
acc << { name: n, description: opts[:description],
introduced: opts[:introduced], is: opts[:is],
deprecated: opts[:deprecated] || false,
+ required: opts[:required] || false,
default: get_default(opts[:default]),
name_property: opts[:name_property] || false }
end
diff --git a/lib/chef/resources.rb b/lib/chef/resources.rb
index 43dc8c9e75..d99aeed3ad 100644
--- a/lib/chef/resources.rb
+++ b/lib/chef/resources.rb
@@ -57,6 +57,7 @@ require "chef/resource/kernel_module"
require "chef/resource/ksh"
require "chef/resource/launchd"
require "chef/resource/link"
+require "chef/resource/locale"
require "chef/resource/log"
require "chef/resource/macports_package"
require "chef/resource/macos_userdefaults"
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
index 6b9ba7c208..480cc61572 100644
--- a/lib/chef/util/powershell/cmdlet.rb
+++ b/lib/chef/util/powershell/cmdlet.rb
@@ -90,7 +90,7 @@ class Chef
result = run(switches, execution_options, arguments)
if ! result.succeeded?
- raise Chef::Exceptions::PowershellCmdletException, "Powershell Cmdlet failed: #{result.stderr}"
+ raise Chef::Exceptions::PowershellCmdletException, "PowerShell Cmdlet failed: #{result.stderr}"
end
result
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index 6357f35abc..482d3d85ac 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require "chef/version_string"
class Chef
CHEF_ROOT = File.expand_path("../..", __FILE__)
- VERSION = Chef::VersionString.new("14.4.63")
+ VERSION = Chef::VersionString.new("14.5.13")
end
#
diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock
index 2317c6f8a5..3e08fd96da 100644
--- a/omnibus/Gemfile.lock
+++ b/omnibus/Gemfile.lock
@@ -31,13 +31,13 @@ GEM
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
awesome_print (1.8.0)
- aws-sdk (2.11.118)
- aws-sdk-resources (= 2.11.118)
- aws-sdk-core (2.11.118)
+ aws-sdk (2.11.124)
+ aws-sdk-resources (= 2.11.124)
+ aws-sdk-core (2.11.124)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
- aws-sdk-resources (2.11.118)
- aws-sdk-core (= 2.11.118)
+ aws-sdk-resources (2.11.124)
+ aws-sdk-core (= 2.11.124)
aws-sigv4 (1.0.3)
berkshelf (7.0.6)
chef (>= 13.6.52)
@@ -215,7 +215,7 @@ GEM
net-ssh-gateway (>= 1.2.0)
net-telnet (0.2.0)
nori (2.6.0)
- octokit (4.10.0)
+ octokit (4.11.0)
sawyer (~> 0.8.0, >= 0.5.3)
ohai (14.4.2)
chef-config (>= 12.8, < 15)
@@ -271,7 +271,7 @@ GEM
rspec-core (>= 2, < 4, != 2.12.0)
ruby-progressbar (1.10.0)
rubyntlm (0.6.2)
- rubyzip (1.2.1)
+ rubyzip (1.2.2)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
@@ -343,7 +343,7 @@ GEM
winrm-elevated (1.1.0)
winrm (~> 2.0)
winrm-fs (~> 1.0)
- winrm-fs (1.2.1)
+ winrm-fs (1.3.0)
erubis (~> 2.7)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
diff --git a/spec/functional/resource/dsc_resource_spec.rb b/spec/functional/resource/dsc_resource_spec.rb
index bb3cf2157d..3491bb6bbe 100644
--- a/spec/functional/resource/dsc_resource_spec.rb
+++ b/spec/functional/resource/dsc_resource_spec.rb
@@ -33,11 +33,11 @@ describe Chef::Resource::DscResource, :windows_powershell_dsc_only do
Chef::Resource::DscResource.new("dsc_resource_test", run_context)
end
- context "when Powershell does not support Invoke-DscResource"
- context "when Powershell supports Invoke-DscResource" do
+ context "when PowerShell does not support Invoke-DscResource"
+ context "when PowerShell supports Invoke-DscResource" do
before do
if !Chef::Platform.supports_dsc_invoke_resource?(node)
- skip "Requires Powershell >= 5.0.10018.0"
+ skip "Requires PowerShell >= 5.0.10018.0"
elsif !Chef::Platform.supports_refresh_mode_enabled?(node) && !Chef::Platform.dsc_refresh_mode_disabled?(node)
skip "Requires LCM RefreshMode is Disabled"
end
diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb
index cc1bd8fd1c..e4c96976d9 100644
--- a/spec/functional/resource/powershell_script_spec.rb
+++ b/spec/functional/resource/powershell_script_spec.rb
@@ -42,7 +42,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
let(:valid_powershell_interpreter_flag) { "-Sta" }
let!(:resource) do
- r = Chef::Resource::WindowsScript::PowershellScript.new("Powershell resource functional test", @run_context)
+ r = Chef::Resource::WindowsScript::PowershellScript.new("PowerShell resource functional test", @run_context)
r.code(successful_executable_script_content)
r
end
@@ -154,7 +154,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
# This somewhat ambiguous case, two failures of different types,
# seems to violate the principle of returning the status of the
# last line executed -- in this case, we return the status of the
- # second to last line. This happens because Powershell gives no
+ # second to last line. This happens because PowerShell gives no
# way for us to determine whether the last operation was a cmdlet
# or Windows process. Because the latter gives more specific
# errors than 0 or 1, we return that instead, which is acceptable
diff --git a/spec/functional/win32/crypto_spec.rb b/spec/functional/win32/crypto_spec.rb
index 5fcbca02b6..70d3f42cfb 100644
--- a/spec/functional/win32/crypto_spec.rb
+++ b/spec/functional/win32/crypto_spec.rb
@@ -36,7 +36,7 @@ describe "Chef::ReservedNames::Win32::Crypto", :windows_only do
it "can be decrypted by powershell" do
encrypted = Chef::ReservedNames::Win32::Crypto.encrypt(plaintext)
- resource = Chef::Resource::WindowsScript::PowershellScript.new("Powershell resource functional test", @run_context)
+ resource = Chef::Resource::WindowsScript::PowershellScript.new("PowerShell resource functional test", @run_context)
resource.code <<~EOF
$encrypted = '#{encrypted}' | ConvertTo-SecureString
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($encrypted)
diff --git a/spec/unit/cookbook_version_file_specificity_spec.rb b/spec/unit/cookbook_version_file_specificity_spec.rb
index b7d5a9b288..d5ecbe4d62 100644
--- a/spec/unit/cookbook_version_file_specificity_spec.rb
+++ b/spec/unit/cookbook_version_file_specificity_spec.rb
@@ -95,6 +95,13 @@ describe Chef::CookbookVersion, "file specificity" do
# directory adirectory
{
name: "files/anotherfile1.rb",
+ path: "files/root_directory/anotherfile1.rb.root",
+ checksum: "csum-root-directory",
+ specificity: "root_directory",
+ },
+
+ {
+ name: "files/anotherfile1.rb",
path: "files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
full_path: "/cookbook-folder/files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
checksum: "csum-host-1",
@@ -483,6 +490,19 @@ describe Chef::CookbookVersion, "file specificity" do
## Globbing the relative paths out of the manifest records ##
describe "when globbing for relative file paths based on filespecificity" do
+ it "should return a list of relative paths based on priority preference: root directory" do
+ node = Chef::Node.new
+ node.automatic_attrs[:platform] = "ubuntu"
+ node.automatic_attrs[:platform_version] = "9.10"
+ node.automatic_attrs[:fqdn] = "examplehost.example.org"
+
+ filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "root_directory")
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(1)
+
+ expect(filenames.sort).to eq(["anotherfile1.rb.root"])
+ end
+
it "should return a list of relative paths based on priority preference: host" do
node = Chef::Node.new
node.automatic_attrs[:platform] = "ubuntu"
diff --git a/spec/unit/node_map_spec.rb b/spec/unit/node_map_spec.rb
index df70ad380a..9c161f3893 100644
--- a/spec/unit/node_map_spec.rb
+++ b/spec/unit/node_map_spec.rb
@@ -223,7 +223,7 @@ describe Chef::NodeMap do
context "while locked" do
# Uncomment the commented `expect`s in 15.0.
it "rejects setting the same key twice" do
- expect(Chef).to receive(:deprecated).with(:map_collision, /resource foo/)
+ expect(Chef).to receive(:deprecated).with(:map_collision, /Resource foo/)
node_map.set(:foo, FooResource)
node_map.lock!
node_map.set(:foo, BarResource)
@@ -247,7 +247,7 @@ describe Chef::NodeMap do
end
it "rejects setting the same key twice when the first has allow_cookbook_override with a past version" do
- expect(Chef).to receive(:deprecated).with(:map_collision, /resource foo/)
+ expect(Chef).to receive(:deprecated).with(:map_collision, /Resource foo/)
node_map.set(:foo, FooResource, allow_cookbook_override: "< 1")
node_map.lock!
node_map.set(:foo, BarResource)
@@ -263,7 +263,7 @@ describe Chef::NodeMap do
end
it "rejects setting the same key twice for a provider" do
- expect(Chef).to receive(:deprecated).with(:map_collision, /provider foo/)
+ expect(Chef).to receive(:deprecated).with(:map_collision, /Provider foo/)
node_map.set(:foo, FooProvider)
node_map.lock!
node_map.set(:foo, BarProvider)
diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb
index 82ed4de9c6..22bfd150ee 100644
--- a/spec/unit/platform/query_helpers_spec.rb
+++ b/spec/unit/platform/query_helpers_spec.rb
@@ -139,13 +139,13 @@ describe "Chef::Platform#supports_msi?" do
end
describe "Chef::Platform#supports_dsc?" do
- it "returns false if powershell is not present" do
+ it "returns false if PowerShell is not present" do
node = Chef::Node.new
expect(Chef::Platform.supports_dsc?(node)).to be_falsey
end
["1.0", "2.0", "3.0"].each do |version|
- it "returns false for Powershell #{version}" do
+ it "returns false for PowerShell #{version}" do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = version
expect(Chef::Platform.supports_dsc?(node)).to be_falsey
@@ -153,7 +153,7 @@ describe "Chef::Platform#supports_dsc?" do
end
["4.0", "5.0"].each do |version|
- it "returns true for Powershell #{version}" do
+ it "returns true for PowerShell #{version}" do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = version
expect(Chef::Platform.supports_dsc?(node)).to be_truthy
@@ -168,7 +168,7 @@ describe "Chef::Platform#supports_dsc_invoke_resource?" do
end
["1.0", "2.0", "3.0", "4.0", "5.0.10017.9"].each do |version|
- it "returns false for Powershell #{version}" do
+ it "returns false for PowerShell #{version}" do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = version
expect(Chef::Platform.supports_dsc_invoke_resource?(node)).to be_falsey
diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb
index 411dc50cc9..82ee5a40b3 100644
--- a/spec/unit/provider/dsc_resource_spec.rb
+++ b/spec/unit/provider/dsc_resource_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Provider::DscResource do
Chef::Provider::DscResource.new(resource, run_context)
end
- context "when Powershell does not support Invoke-DscResource" do
+ context "when PowerShell does not support Invoke-DscResource" do
let (:node) do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = "4.0"
@@ -40,7 +40,7 @@ describe Chef::Provider::DscResource do
end
end
- context "when Powershell supports Invoke-DscResource" do
+ context "when PowerShell supports Invoke-DscResource" do
context "when RefreshMode is not set to Disabled" do
context "and the WMF 5 is a preview release" do
diff --git a/spec/unit/provider/dsc_script_spec.rb b/spec/unit/provider/dsc_script_spec.rb
index 5f091b8813..c880683a0f 100644
--- a/spec/unit/provider/dsc_script_spec.rb
+++ b/spec/unit/provider/dsc_script_spec.rb
@@ -162,7 +162,7 @@ describe Chef::Provider::DscScript do
end
end
- it "raises an exception if Powershell is not present" do
+ it "raises an exception if PowerShell is not present" do
expect do
provider.run_action(:run)
end.to raise_error(Chef::Exceptions::ProviderNotFound)
diff --git a/spec/unit/resource/dsc_resource_spec.rb b/spec/unit/resource/dsc_resource_spec.rb
index 22c42aa441..04e1305163 100644
--- a/spec/unit/resource/dsc_resource_spec.rb
+++ b/spec/unit/resource/dsc_resource_spec.rb
@@ -93,7 +93,7 @@ describe Chef::Resource::DscResource do
end
end
- context "Powershell DSL methods" do
+ context "PowerShell DSL methods" do
it "responds to :ps_credential" do
expect(dsc_test_resource.respond_to?(:ps_credential)).to be true
end
diff --git a/spec/unit/resource/locale_spec.rb b/spec/unit/resource/locale_spec.rb
new file mode 100644
index 0000000000..7e1292d211
--- /dev/null
+++ b/spec/unit/resource/locale_spec.rb
@@ -0,0 +1,60 @@
+#
+# Author:: Vincent AUBERT (<vincentaubert88@gmail.com>)
+# Copyright:: Copyright 2008-2018, 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::Locale do
+
+ let(:resource) { Chef::Resource::Locale.new("fakey_fakerton") }
+
+ it "has a name of locale" do
+ expect(resource.resource_name).to eq(:locale)
+ end
+
+ it "the lang property is equal to en_US.utf8" do
+ expect(resource.lang).to eql("en_US.utf8")
+ end
+
+ it "the lc_all property is equal to en_US.utf8" do
+ expect(resource.lc_all).to eql("en_US.utf8")
+ end
+
+ it "sets the default action as :update" do
+ expect(resource.action).to eql([:update])
+ end
+
+ it "supports :update action" do
+ expect { resource.action :update }.not_to raise_error
+ end
+
+ describe "when the language is not the default one" do
+ let(:resource) { Chef::Resource::Locale.new("fakey_fakerton") }
+ before do
+ resource.lang("fr_FR.utf8")
+ resource.lc_all("fr_FR.utf8")
+ end
+
+ it "the lang property is equal to fr_FR.utf8" do
+ expect(resource.lang).to eql("fr_FR.utf8")
+ end
+
+ it "the lc_all property is equal to fr_FR.utf8" do
+ expect(resource.lc_all).to eql("fr_FR.utf8")
+ end
+ end
+end
diff --git a/tasks/cbgb.rb b/tasks/cbgb.rb
deleted file mode 100644
index 9621f160c3..0000000000
--- a/tasks/cbgb.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Author:: Thom May (tmay@chef.io)
-# Author:: Nathen Harvey (nharvey@chef.io)
-# Copyright:: Copyright 2015-2016, 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 "rake"
-
-CBGB_SOURCE = File.join(File.dirname(__FILE__), "..", "CBGB.toml")
-CBGB_TARGET = File.join(File.dirname(__FILE__), "..", "CBGB.md")
-
-begin
- require "tomlrb"
-
- task default: :generate
-
- namespace :cbgb do
- desc "Generate MarkDown version of CBGB file"
- task :generate do
- cbgb = Tomlrb.load_file CBGB_SOURCE
- out = "<!-- This is a generated file. Please do not edit directly -->\n"
- out << "<!-- Modify CBGB.toml file and run `rake cbgb:generate` to regenerate -->\n\n"
- out << "# " + cbgb["Preamble"]["title"] + "\n\n"
- out << cbgb["Preamble"]["text"] + "\n"
- out << "# Board of Governors\n\n"
- out << "## " + cbgb["Org"]["Lead"]["title"] + "\n\n"
- out << person(cbgb["people"], cbgb["Org"]["Lead"]["person"]) + "\n\n"
- out << "### " + cbgb["Org"]["Contributors"]["title"] + "\n\n"
- out << cbgb(cbgb["people"], cbgb["Org"]["Contributors"]["governers"]) + "\n\n"
- out << "### " + cbgb["Org"]["Corporate-Contributors"]["title"] + "\n\n"
- out << cbgb(cbgb["corporations"], cbgb["Org"]["Corporate-Contributors"]["governers"]) + "\n\n"
- out << "### " + cbgb["Org"]["Lieutenants"]["title"] + "\n\n"
- out << cbgb(cbgb["people"], cbgb["Org"]["Lieutenants"]["governers"]) + "\n\n"
- File.open(CBGB_TARGET, "w") do |fn|
- fn.write out
- end
- end
- end
-
- def components(list, cmp)
- out = ""
- cmp.each_value do |v|
- out << "\n#### #{v['title'].gsub('#', '\\#')}\n"
- out << cbgb(list, v["cbgb"])
- end
- out
- end
-
- def cbgb(list, people)
- o = ""
- people.each do |p|
- o << person(list, p) + "\n"
- end
- o
- end
-
- def person(list, person)
- if list[person].key?("GitHub")
- out = "* [#{list[person]["Name"]}](https://github.com/#{list[person]["GitHub"]})"
- else
- out = "* #{list[person]["Name"]}"
- end
- if list[person].key?("Person")
- out << " - #{list[person]["Person"]}"
- end
- out
- end
-
-rescue LoadError
- STDERR.puts "\n*** TomlRb not available.\n\n"
-end
diff --git a/tasks/templates/prerelease.md.erb b/tasks/templates/prerelease.md.erb
index 6d45d25ab8..cab7f11fff 100644
--- a/tasks/templates/prerelease.md.erb
+++ b/tasks/templates/prerelease.md.erb
@@ -21,7 +21,7 @@ Alternatively, you can install Chef using one of the following command options:
# In Shell
$ curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef -v <%= @version %> -c current
-# In Windows Powershell
+# In Windows PowerShell
. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project chef -version <%= @version %> -channel current
```