|
1 | 1 | # |
2 | 2 | # Cookbook Name:: fourthcoffee |
3 | | -# Recipe:: default |
| 3 | +# Recipe:: _dsc |
4 | 4 | # |
5 | 5 | # Copyright 2014, Chef Software, Inc. |
6 | 6 | # |
|
18 | 18 | # |
19 | 19 |
|
20 | 20 | # |
21 | | -# Use the WindowsFeature DSC resource to install Web-Server and Web-Asp-Net45 |
| 21 | +# Use the 'dsc_resource' resource (requires WMF 5.0+) |
22 | 22 | # |
23 | 23 |
|
24 | | -dsc_script 'Web-Server' do |
25 | | - code <<-EOH |
26 | | - WindowsFeature InstallWebServer |
27 | | - { |
28 | | - Name = "Web-Server" |
29 | | - Ensure = "Present" |
30 | | - } |
31 | | - EOH |
| 24 | +dsc_resource 'webserver' do |
| 25 | + resource :windowsfeature |
| 26 | + property :name, 'Web-Server' |
| 27 | + property :ensure, 'Present' |
32 | 28 | end |
33 | 29 |
|
34 | | -dsc_script 'Web-Asp-Net45' do |
35 | | - code <<-EOH |
36 | | - WindowsFeature InstallDotNet45 |
37 | | - { |
38 | | - Name = "Web-Asp-Net45" |
39 | | - Ensure = "Present" |
40 | | - } |
41 | | - EOH |
| 30 | +dsc_resource 'dotnet45' do |
| 31 | + resource :windowsfeature |
| 32 | + property :name, 'Web-Asp-Net45' |
| 33 | + property :ensure, 'Present' |
42 | 34 | end |
43 | 35 |
|
44 | | -dsc_script 'Web-Mgmt-Console' do |
45 | | - code <<-EOH |
46 | | - WindowsFeature InstallIISConsole |
47 | | - { |
48 | | - Name = "Web-Mgmt-Console" |
49 | | - Ensure = "Present" |
50 | | - } |
51 | | - EOH |
| 36 | +dsc_resource 'webmgmtconsole' do |
| 37 | + resource :windowsfeature |
| 38 | + property :name, 'Web-Mgmt-Console' |
| 39 | + property :ensure, 'Present' |
52 | 40 | end |
53 | 41 |
|
54 | | -# You can also use dsc_resource (requires PS5) |
| 42 | +# |
| 43 | +# You can also use dsc_script (requires WMF 4.0+) |
| 44 | +# |
55 | 45 |
|
56 | | -# dsc_resource 'webserver' do |
57 | | -# resource :windowsfeature |
58 | | -# property :name, 'Web-Server' |
59 | | -# property :ensure, 'Present' |
| 46 | +# dsc_script 'Web-Server' do |
| 47 | +# code <<-EOH |
| 48 | +# WindowsFeature InstallWebServer |
| 49 | +# { |
| 50 | +# Name = "Web-Server" |
| 51 | +# Ensure = "Present" |
| 52 | +# } |
| 53 | +# EOH |
60 | 54 | # end |
61 | | - |
62 | | -# dsc_resource 'dotnet45' do |
63 | | -# resource :windowsfeature |
64 | | -# property :name, 'Web-Asp-Net45' |
65 | | -# property :ensure, 'Present' |
| 55 | +# |
| 56 | +# dsc_script 'Web-Asp-Net45' do |
| 57 | +# code <<-EOH |
| 58 | +# WindowsFeature InstallDotNet45 |
| 59 | +# { |
| 60 | +# Name = "Web-Asp-Net45" |
| 61 | +# Ensure = "Present" |
| 62 | +# } |
| 63 | +# EOH |
| 64 | +# end |
| 65 | +# |
| 66 | +# dsc_script 'Web-Mgmt-Console' do |
| 67 | +# code <<-EOH |
| 68 | +# WindowsFeature InstallIISConsole |
| 69 | +# { |
| 70 | +# Name = "Web-Mgmt-Console" |
| 71 | +# Ensure = "Present" |
| 72 | +# } |
| 73 | +# EOH |
66 | 74 | # end |
0 commit comments