-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows_certificate create action does not appear to be idempotent #296
Comments
The default Could you provide debug output of a non idempotent run? |
What version of chef client is your node running? 11.18.6? I'll see if I can reproduce there today. |
The converge this morning was with Chef client 12.4.1. Thank you |
Oh OK. Good to know. |
Matt, sorry I was incorrect, the windows_certificate does not appear to be idempotent in Chef client 11.18.6 but does appear to work perfectly well in Chef client 12.4.1, I assume because of the wrapper code that the Chef client adds to PowerShell script (as seen in the debug output). Please accept my apologies, I'll understand if you want to close the issue due to us using an outdated Chef client. |
Hey no problem at all. We'd certainly like this to be backward compatible to v11 so thanks a bunch for the update and I will test there. |
Tested the v1.38.4 release of the windows cookbook. windows_certificate is idempotent in Chef 11. Thank you. |
Ah great to hear! |
Converging on a Windows 2012 RTM virtual box the windows_certificate resource always runs irrespective of whether the certificate is installed in the certificate store.
Example usage of the windows_certificate resource
Having looked at the code I think the powershell resource used in the create method needs changing to specify the guard interpreter
Alternatively if a guard_interpreter is not specified the resource can be made idempotent by returning an exit code of 0 or 1 from the script by changing it to
Both solutions above tested with Chef 11.18.6 and 12.4.1.
The text was updated successfully, but these errors were encountered: