-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] salt-ssh test=True doesn't show a service is going to get restarted for a pkg, but will for a file #60120
Comments
@edgan Can you provide the contents of pkg.sls after you have added the 1:1.20.0-2.fc34 to it.
But you don't show this issue, will try with version of salt you used, but if could also test with the latest version of Salt for Fedora since this is what most will encounter. Thanks |
I think you are seeing the typo in services.sls. This should fix it.
|
@edgan Fixed one of my typos too, thanks, pored over the files and missed it, Hercule Poirot I am not :) |
Slight misstep in the description of commands given to produce the issue reported, correcting for above.
Compliant is that the command
doesn't inform that the service will be restarted when nginx is installed. with test:
with execution of the command
The problem is due to the following lines of code checking state of the service and returning before checking to see if test. Wonder if we have this coding flow error in other functions. Lines 472 to 503 in 9744971
|
I wanted to test some code before actually executing it, and hence used test=True. The service had a watch for the config file and the package. The output from salt-ssh with test=True would say the service is going to get restarted if the file is going to change, but won't when the package is going to change. Yet when salt-ssh is run without test=True the service is restarted for the package.
The reason for nginx.conf.test instead of nginx.conf is that the package upgrade will change the file. That would invalidate the test.
These tests were run with Fedora 34 locally and Fedora 34 remotely. Though I don't think this issue is Fedora specific or has anything to do with nginx. They are just used in the test case.
COMMANDS
Run on fqdn and it installs nginx-1.18.0-5.fc34:
Works as expected:
Add
: 1:1.20.0-2.fc34
to the end of pkgs.sls and run:Run this and see the service is restarted after all.
Run this and see that it says it will restart the service for the file when it didn't with test=True for the package:
FILES
nginx/init.sls:
nginx/pkgs.sls:
nginx/services.sls:
nginx/files/etc/nginx/nginx.conf.test:
The text was updated successfully, but these errors were encountered: