diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-23 17:07:56 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-23 17:07:56 -0700 |
commit | d45ee988bc5550a912a03a8e05aa3a8ffc115de6 (patch) | |
tree | 6454e8c9f7fe7583be13ab6abfbaa3c94a7df5e3 | |
parent | cf429bd514ce235b27cf845e02a3fc2f9a15c957 (diff) | |
parent | 393aaad9ea5618ccbcf99245f0da5201ac728032 (diff) | |
download | chef-d45ee988bc5550a912a03a8e05aa3a8ffc115de6.tar.gz |
Merge pull request #3127 from chef/jdm/dsc-changelog
Jdm/dsc changelog
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | DOC_CHANGES.md | 72 |
2 files changed, 73 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 609cf9825f..cd1d222d46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * migrate macosx, windows, openbsd, and netbsd resources to dynamic resolution * migrate cron and mdadm resources to dynamic resolution * [Issue 3096](https://github.com/chef/chef/issues/3096) Fix OpenBSD package provider installation issues +* New `dsc_resource` resource to invoke Powershell DSC resources ## 12.1.2 * [Issue 3022](https://github.com/chef/chef/issues/3022): Homebrew Cask install fails diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md index 41d70fac61..ceac435273 100644 --- a/DOC_CHANGES.md +++ b/DOC_CHANGES.md @@ -11,3 +11,75 @@ Description of the required change. `knife ssh` now has an --exit-on-error option that will cause it to fail immediately in the face of an SSH connection error. The default behavior is move on to the next node. + +### DSC Resource + +The `dsc_resource` resource for Windows systems that allows cookbook authors to invoke [PowerShell Desired +State Configuration](http://technet.microsoft.com/en-us/library/dn249912.aspx) resources in Chef DSL. + +#### Prerequisites + +* **Windows Management Framework 5** February Preview +* **Local Configuration Manager** must be set to have a `RefreshMode` of `Disabled` + +#### Syntax + +```ruby +dsc_resource "description" do + resource "resource_name" + property :property_name, property_value + ... + property :property_name, property_value +end +``` + +#### Attributes + +- `resource`: The friendly name of the DSC resource + +- `property`: `:property_name`, `property_value` pair for each property that must be set for the DSC resource. +`property_name` must be of the `Symbol`. The following types are supported for `property_value`, along with +their conversion into Powershell: + +| Ruby Type | Powershell Type | +|-------------------------------------|-----------------| +| Fixnum | Integer | +| Float | Double | +| FalseClass | bool($false) | +| TrueClass | bool($true) | +| Chef::Util::Powershell:PSCredential | PSCredential | +| Hash | Hashtable | +| Array | Object[] | + +- `module_name` is the name of the module that the DSC resource comes from. If it is not provided, it will + be inferred. + +#### Actions + +|Action|Description| +|------|------------------------| +|`:run`| Invoke the DSC resource| + +#### Example + +```ruby +dsc_resource "demogroupremove" do + resource :group + property :groupname, 'demo1' + property :ensure, 'present' +end + +dsc_resource "useradd" do + resource :user + property :username, "Foobar1" + property :fullname, "Foobar1" + property :password, ps_credential("P@assword!") + property :ensure, 'present' +end + +dsc_resource "AddFoobar1ToUsers" do + resource :Group + property :GroupName, "demo1" + property :MembersToInclude, ["Foobar1"] +end +``` |