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 notifies using a :before timer not working #8220

Open
username-is-already-taken2 opened this Issue Feb 7, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@username-is-already-taken2
Copy link
Contributor

username-is-already-taken2 commented Feb 7, 2019

Description

I use the notifies option within my windows_certificate resource to call a powershell resource which creates the pfx file but the windows_certificate resources errors saying the pfx file doesn't exist. Is this by design or should the notify be triggered first?

Chef Version

14.10.9

Platform Version

2016

@lamont-granquist

This comment has been minimized.

Copy link
Contributor

lamont-granquist commented Feb 7, 2019

You need to include more information about what you're doing, like the code and the output.

You should also consider not including the complexity of the :before notification. Just create the pfx file with the powershell resource, then call windows_certificate.

It is possible there is a why-run bug in windows_certificate, but my suspicion is that windows_certificate rightly requires that file to exist and you need to create it first no matter what and that you are attempting to over-use :before notifications in a situation where they do not apply.

:before notifications are ONLY for when you need to write something like "if I am going to update this DLL, then I must first stop the service, and I must not stop the service if I am not going to update the DLL". That latter part is actually the important bit. If you MUST NOT update the pfx file if windows_certificate will not update in the future, then you have a :before notification issue. If you just need to update the pfx file before the windows_certificate runs then you don't have a :before notification problem (even though I just used the word "before" in that sentence it does NOT imply :before notifications are appropriate -- trying to use plain-English logic won't work -- the common case is to just run a resource before another resource when it needs to run before another resource and not overcomplicate things).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment