diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-08-13 05:28:48 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-08-25 09:04:44 -0700 |
commit | 6bd15a82bab013538826fc74a0c9dd7946e7dd7c (patch) | |
tree | 027b2d6e1a0af3a32fe29945cae0c439c08ec0a1 | |
parent | bd0cfc0b40bc0eeb04c409c54678b3429ce5b677 (diff) | |
download | chef-6bd15a82bab013538826fc74a0c9dd7946e7dd7c.tar.gz |
Add ps_credential dsl method to dsc_script
You can now do the following:
```ruby
dsc_script 'create-foo-user' do
code <<-EOH
User FooUser00
{
Ensure = "Present"
UserName = 'FooUser00'
Password = #{ps_credential('FooBarBaz1!')}
}
EOH
configuration_data <<-EOH
@{
AllNodes = @(
@{
NodeName = "localhost";
CertificateID = 'A8DB81D8059F349F7EF19104399B898F701D4167'
}
)
}
EOH
end
```
-rw-r--r-- | lib/chef/resource/dsc_script.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb index 2877f61eb4..c3602fa60e 100644 --- a/lib/chef/resource/dsc_script.rb +++ b/lib/chef/resource/dsc_script.rb @@ -17,10 +17,12 @@ # require 'chef/exceptions' +require 'chef/dsl/powershell' class Chef class Resource class DscScript < Chef::Resource + include Chef::DSL::Powershell provides :dsc_script, os: "windows" |