voxpupuli / puppet-windowsfeature

Library that uses ServerAdministration api that comes with Windows Server 2008 and Windows Server 2012 to add / remove windows features
https://forge.puppet.com/puppet/windowsfeature
MIT License
30 stars 50 forks source link

Using array of features - slow #33

Closed BrianMBeaulieu closed 8 years ago

BrianMBeaulieu commented 9 years ago

This is probably me being lazy... and paying for it. If I give a full list of all features, subsequent runs of puppet spend a lot of time validating that features are actually installed.

Any suggestions for speeding this up or maybe using a different method for validating ? This takes about 5 minutes to run.

$windowsfeatures = [ "Application-Server","AS-NET-Framework","FileAndStorage-Services","File-Services","FS-FileServer","Storage-Services","NPAS","NPAS-Policy-Server","Remote-Desktop-Services","RDS-Connection-Broker","RDS-Gateway","Web-Server","Web-WebServer","Web-Common-Http","Web-Default-Doc","Web-Dir-Browsing","Web-Http-Errors","Web-Static-Content","Web-Http-Redirect","Web-Health","Web-Http-Logging","Web-Log-Libraries","Web-Request-Monitor","Web-Http-Tracing","Web-Performance","Web-Stat-Compression","Web-Security","Web-Filtering","Web-Basic-Auth","Web-Windows-Auth","Web-App-Dev","Web-Net-Ext","Web-Net-Ext45","Web-AppInit","Web-ASP","Web-Asp-Net","Web-Asp-Net45","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Ftp-Server","Web-Ftp-Service","Web-Ftp-Ext","Web-Mgmt-Tools","Web-Mgmt-Console","Web-Scripting-Tools","Web-Mgmt-Service","NET-Framework-Features","NET-Framework-Core","NET-Framework-45-Features","NET-Framework-45-Core","NET-Framework-45-ASPNET","NET-WCF-Services45","NET-WCF-HTTP-Activation45","NET-WCF-TCP-PortSharing45","RSAT","RSAT-Role-Tools","RSAT-NPAS","RPC-over-HTTP-Proxy","FS-SMB1","Telnet-Client","User-Interfaces-Infra","Server-Gui-Mgmt-Infra","Desktop-Experience","Server-Gui-Shell","PowerShellRoot","PowerShell","PowerShell-V2","WAS","WAS-Process-Model","WAS-Config-APIs","WoW64-Support"]

windowsfeature { $windowsfeatures: installmanagementtools => true }

Brian

liamjbennett commented 9 years ago

The only thing that will probably speed this up is for it to get refactored into a proper type/provider. This has been on the backlog for some time.

matthewrstone commented 9 years ago

So...I have a rewrite as a type and provider, but am completely lost on writing tests for a custom type/provider so I haven't submitted the pr yet...does anyone want to help with that?

cyberious commented 8 years ago

Let me know where you have it, I am well versed in writing unit tests for Type and Provider

matthewrstone commented 8 years ago

Thanks! Here ya go: https://github.com/matthewrstone/puppet-windowsfeature/tree/33-create_type_and_provider

petems commented 8 years ago

Should be fixed by #47, please re-open if not!