Skip to content

Commit

Permalink
Merge pull request chef#3127 from chef/jdm/dsc-changelog
Browse files Browse the repository at this point in the history
Jdm/dsc changelog
  • Loading branch information
jaym committed Mar 24, 2015
2 parents cf429bd + 393aaad commit d45ee98
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
72 changes: 72 additions & 0 deletions DOC_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit d45ee98

Please sign in to comment.