-
-
Save solvip/c07e032ff7858aa53932 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_recipe "windows" | |
# Match for Windows 2012 | |
if node["platform"] == "windows" and node["os_version"] =~ /6\.2(.*)/ | |
# Windows 2012 and it's SXS... | |
# Copy the SXS files from the Chef server. | |
remote_directory "#{node[:rb_net_framework][:sxs_dir]}" do | |
source "win_sxs_sources" | |
not_if { windows_feature.installed? "NetFx3" } # I'd like something in this direction, if possible. | |
end | |
windows_batch "install_netfx3" do | |
code <<-EOH | |
c:/windows/sysnative/dism.exe /online /enable-feature /featurename:NetFx3 /norestart /all /source:#{node[:rb_net_framework][:sxs_dir]} | |
EOH | |
action :run | |
end | |
windows_feature "NetFx4ServerFeatures" do | |
action :install | |
end | |
#Match for Windows 2008 | |
elsif node["platform"] == "windows" and node["os_version"] =~ /6\.1(.*)/ | |
windows_feature "NetFx3" do | |
action :install | |
end | |
else | |
# Unsupported platform. Bail out. | |
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment