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

Windowsfeature gives Corrective change every time #111

Closed WesselK closed 6 years ago

WesselK commented 6 years ago

Affected Puppet, Ruby, OS and module versions/distributions

Hi,

This may be a noob question as we are just starting to use Puppet to manage Windows machines. As we are building roles we are planning to use the module Windowsfeature. However, the module changes the machine everytime instead of checking first if it is necessary. This causes a incorrect report on the server as nothing was changed but still a corrective change is showed in the report. Is this by default or should i wrap some code around it to check? (which defeats the purpose of using this module instead of powershell code).

Regards, Wessel

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

windowsfeature { 'Web-Http-Redirect': ensure => present, }

What are you seeing

In report: Windowsfeature['Web-Http-Redirect'] created Corrective change absent present

What behaviour did you expect instead

The feature was already installed last run, so i don't expect a corrective change.

Output log

Debug: Executing: 'C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe Ins tall-WindowsFeature 'Web-Http-Redirect'' Debug: Powershell create response was ' Success Restart Needed Exit Code Feature Result


True No NoChangeNeeded {}

' Notice: /Stage[main]/Profile::Front_end_webserver/Windowsfeature['Web-Http-Redir ect']/ensure: created Debug: /Stage[main]/Profile::Front_end_webserver/Windowsfeature['Web-Http-Redire ct']: The container Class[Profile::Front_end_webserver] will propagate my refres h event Debug: Class[Profile::Front_end_webserver]: The container Stage[main] will propa gate my refresh event Debug: Finishing transaction 58703780 Debug: Storing state Debug: Stored state in 0.89 seconds Notice: Applied catalog in 11.20 seconds

Any additional information you'd like to impart

TraGicCode commented 6 years ago

Hey @WesselK , before i dive into looking at this can you please provide the following information:

  1. Puppet Agent Version
  2. Windows Server O/S Version
WesselK commented 6 years ago

Hi,

Thanks for responding. Here's the requested info:

  1. version 4.10.5
  2. Windows Server 2012 R2
TraGicCode commented 6 years ago

Awesome Thanks

TraGicCode commented 6 years ago

Hey @WesselK ,

Unfortunately i'm unable to reproduce your error. Could you try a a couple things for me?

  1. Your logs indicate a reboot is required to finish installation. Could you try to reboot to see if it resolves the issue?
  2. Can you post more debug logs to have more context?
TraGicCode commented 6 years ago

@WesselK Closing this issue out since there has been no response. Can reopen when more information is provided.

WesselK commented 6 years ago

Hoi Kevin,

Ja, met het volgende: https://github.com/voxpupuli/puppet-windowsfeature/issues/111#issuecomment-357681305

Met vriendelijke groet, CAK

Wessel Kamp Coördinator Team Technisch Beheer Microsoft, Infrastructuur, divisie ICT

T (088) 711 40 95 @ wkamp@hetcak.nl

CAK Postbus 84015 2508 AA Den Haag T (088) 711 40 00 www.hetcak.nl

Van: Michael Fyffe [mailto:notifications@github.com] Verzonden: maandag 15 januari 2018 14:22 Aan: voxpupuli/puppet-windowsfeature CC: Wessel Kamp; Mention Onderwerp: Re: [voxpupuli/puppet-windowsfeature] Windowsfeature gives Corrective change every time (#111)

Hey @WesselKhttps://github.com/wesselk ,

Unfortunately i'm unable to reproduce your error. Could you try a a couple things for me?

  1. Your logs indicate a reboot is required to finish installation. Could you try to reboot to see if it resolves the issue?
  2. Can you post more debug logs to have more context?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/voxpupuli/puppet-windowsfeature/issues/111#issuecomment-357681305, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhEc33lhEUYsmBq7ZM1xsIdl7z-oI_owks5tK1ECgaJpZM4RGn6L.