chef-boneyard / windows

Development repository for Chef Cookbook windows
https://supermarket.chef.io/cookbooks/windows
Apache License 2.0
252 stars 270 forks source link

windows_feature does not install when single string is used and install_method is :windows_feature_powershell #480

Closed roberto-mardeni closed 6 years ago

roberto-mardeni commented 7 years ago

Cookbook version

3.1.1

Chef-client version

13.1.31

Platform Details

Windows 2012 R2

Scenario:

Install windows features via powershell one at a time inside a loop of an array of features

Steps to Reproduce:

Here is the code that would not work:

features = [
  'Web-Default-Doc',
  'Web-Dir-Browsing',
  'Web-Http-Errors',
  'Web-Static-Content',
  'Web-Http-Redirect',
  'Web-Health',
  'Web-Http-Logging',
  'Web-Custom-Logging',
  'Web-Log-Libraries',
  'Web-ODBC-Logging',
  'Web-Request-Monitor',
  'Web-Http-Tracing',
  'Web-Stat-Compression',
  'Web-Dyn-Compression',
  'Web-Security',
  'Web-Filtering',
  'Web-Basic-Auth',
  'Web-CertProvider',
  'Web-Client-Auth',
  'Web-Digest-Auth',
  'Web-IP-Security',
  'Web-Url-Auth',
  'Web-Windows-Auth',
  'Web-App-Dev',
  'Web-Net-Ext',
  'Web-Net-Ext45',
  'Web-AppInit',
  'Web-ASP',
  'Web-Asp-Net',
  'Web-Asp-Net45',
  'Web-CGI',
  'Web-ISAPI-Ext',
  'Web-ISAPI-Filter',
  'Web-Includes',
  'Web-WebSockets',
  'Web-Mgmt-Console',
  'Web-Metabase',
  'Web-Lgcy-Mgmt-Console',
  'Web-Lgcy-Scripting',
  'Web-WMI',
  'Web-Scripting-Tools',
  'Web-Mgmt-Service',
  'NET-Framework-Core',
  'NET-HTTP-Activation',
  'NET-Non-HTTP-Activ',
  'NET-Framework-45-Core',
  'NET-Framework-45-ASPNET',
  'NET-WCF-Services45',
  'NET-WCF-HTTP-Activation45',
  'NET-WCF-TCP-Activation45',
  'NET-WCF-TCP-PortSharing45',
  'WAS-Process-Model',
  'WAS-NET-Environment',
  'WAS-Config-APIs',
]

features.each do |feature|
  windows_feature feature do
    action :install
    install_method :windows_feature_powershell
  end
end

Had to replace with:

features = [
  'Web-Default-Doc',
  'Web-Dir-Browsing',
  'Web-Http-Errors',
  'Web-Static-Content',
  'Web-Http-Redirect',
  'Web-Health',
  'Web-Http-Logging',
  'Web-Custom-Logging',
  'Web-Log-Libraries',
  'Web-ODBC-Logging',
  'Web-Request-Monitor',
  'Web-Http-Tracing',
  'Web-Stat-Compression',
  'Web-Dyn-Compression',
  'Web-Security',
  'Web-Filtering',
  'Web-Basic-Auth',
  'Web-CertProvider',
  'Web-Client-Auth',
  'Web-Digest-Auth',
  'Web-IP-Security',
  'Web-Url-Auth',
  'Web-Windows-Auth',
  'Web-App-Dev',
  'Web-Net-Ext',
  'Web-Net-Ext45',
  'Web-AppInit',
  'Web-ASP',
  'Web-Asp-Net',
  'Web-Asp-Net45',
  'Web-CGI',
  'Web-ISAPI-Ext',
  'Web-ISAPI-Filter',
  'Web-Includes',
  'Web-WebSockets',
  'Web-Mgmt-Console',
  'Web-Metabase',
  'Web-Lgcy-Mgmt-Console',
  'Web-Lgcy-Scripting',
  'Web-WMI',
  'Web-Scripting-Tools',
  'Web-Mgmt-Service',
  'NET-Framework-Core',
  'NET-HTTP-Activation',
  'NET-Non-HTTP-Activ',
  'NET-Framework-45-Core',
  'NET-Framework-45-ASPNET',
  'NET-WCF-Services45',
  'NET-WCF-HTTP-Activation45',
  'NET-WCF-TCP-Activation45',
  'NET-WCF-TCP-PortSharing45',
  'WAS-Process-Model',
  'WAS-NET-Environment',
  'WAS-Config-APIs',
]

windows_feature 'sitecore windows features' do
  feature_name features
  action :install
  install_method :windows_feature_powershell
end

Expected Result:

The windows_feature should work as described in the documentation.

Actual Result:

The recipe executes and shows each of the features as already up to date and does not install them.

tas50 commented 6 years ago

This should be resolved with the latest cookbook release. Give that a try and feel free to open this back up if you're still having issues