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 49 forks source link

Does not appear to function properly in Windows Server 2016 #70

Closed rychannel closed 7 years ago

rychannel commented 7 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Run puppet agent. Assign code that attempts to install a windows feature

What are you seeing

Puppet run shows that each feature was installed successfully. When puppet is run again, it says everything installed successfully.

What behaviour did you expect instead

install succesfully and not show up on subsequent runs

Output log

Notice: Local environment: 'production' doesn't match server specified node environment 'test', switching agent to 'test'. Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for tst-box-as-3.hoad.local Info: Applying configuration version '1481319198' Notice: /Stage[main]/Profiles::Java::Jre8u111x64/Package[Java 8 Update 111]/ensure: created Notice: /Stage[main]/Profiles::Base::Applications/Windowsfeature[Telnet-Server]/Exec[remove-feature-Telnet-Server]/returns: executed successfully Notice: /Stage[main]/Profiles::Base::Applications/Windowsfeature[PowerShell-ISE]/Exec[add-feature-PowerShell-ISE]/returns: executed successfully Notice: /Stage[main]/Profiles::Iis/Windowsfeature[IIS]/Exec[add-feature-IIS]/returns: executed successfully Notice: /Stage[main]/Profiles::Iis/Windowsfeature[Net-Framework]/Exec[add-feature-Net-Framework]/returns: executed successfully Notice: /Stage[main]/Profiles::Iis/Windowsfeature[Net-Framework-45]/Exec[add-feature-Net-Framework-45]/returns: executed successfully Notice: Applied catalog in 27.87 seconds

Any additional information you'd like to impart

cmachler commented 7 years ago

I am seeing similar behavior in 2008 R2 where it does install the Windows Features but does not recognize they are installed on subsequent runs:

Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[Application-Server]/ensure
: created
Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[AS-NET-Framework]/ensure:
created
Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[AS-Web-Support]/ensure: cr
eated
Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[AS-WAS-Support]/ensure: cr
eated
Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[AS-HTTP-Activation]/ensure
: created
Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[Web-Server]/ensure: create
d
Notice: /Stage[main]/Fsscheduler::Base/Windowsfeature[Web-Mgmt-Tools]/ensure: cr
eated
Notice: Finished catalog run in 36.83 seconds
cmachler commented 7 years ago

My issue went away in version 2.1.0 of the module.

rychannel commented 7 years ago

Reopening... here are error messages...

Error: /Stage[main]/Profiles::Iis/Windowsfeature[NET-Framework-Core]/ensure: change from absent to present failed: Execution of 'C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe Install-WindowsFeature NET-Framework-Core' returned 1: Install-WindowsFeature : The request to add or remove features on the specified server failed.
Installation of one or more roles, role services, or features failed.
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more
information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f081f
At line:1 char:1
+ Install-WindowsFeature NET-Framework-Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],
    Exception
    + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWind
   owsFeatureCommand

Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
False   No             Failed         {}

here is the code

windowsfeature { 'NET-Framework-Core': ensure => 'present', source => $feature_source, }

rychannel commented 7 years ago

Wait, maybe this is a perms issue on my side... looking in to it more

rychannel commented 7 years ago

I think this is an issue related to source files and not Puppet or this module. Closing issue. If I learn any differently, I'll reopen