-
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
salt schedule doesn't return jobs result info to master #12653
Comments
That seems very strange to me. It should definitely be returning the results to the master, so that you can check the results in the job cache. What version of salt are you using? |
Also, how are you verifying that the events are not firing, and have you checked the job cache for the results in question? |
salt version: salt-minion-01.example.com:
saltversion: 2014.1.3 schedule
minion log about schedule (in debug level)
check the job on master salt-run jobs.lookup_jid 20140513073918695801 there is nothing |
I can reproduce this. After asking around, this was just never designed to return to the master, so I'm actually going to mark this as a feature request. Right now it's only adding it to the |
Having an option for this would be really useful for the http://github.com/theforeman/foreman_salt plugin! For now, we'll be loading |
As an alternate workaround I am using returners as a way to send schedule's results back to master via events.. Something like the following may work for you too:
|
Would be interested in this too. Am looking into using the custom returner posted by @pruiz |
+1 My use case is: schedule state.highstate test=True on all minions once every hour and set up a reactor listening on job finish events and passing the event data to a custom email runner which will notify me about all pending highstate changes. Without the scheduler job events this pipeline doesn't work. Edit: I'm willing to contribute, but would need some beginner mentoring from more experienced person. |
@enblde that's a great scenario and I think a lot of people can benefit from such a workflow. We're using the master returner above which seems to work quite well for 2015.8 but not so well for 2015.5 (so wheezy machines still there...). Haven't found the time to debug yet. |
For everyone else wanting this I thought I should post my full solution for sending alerts via slack when a scheduled job fails.... In the schedule pillar I use a custom returner:
In the state directory (listed in file roots) I have a "_returners" directory with
It is important to note that if you have multiple salt environments, the _returners directory must exist in the file roots for every salt environment or it will not be distributed to all minions. On the master in
The
Finally the
|
@scubahub thanks for sharing your code. Maybe we could pool our needs together to contribute a master returner. The first thing I see would to make the tag configurable. And maybe determine what we want to return (or again, make it configurable). I use the function name in the tag by doing the following : def returner(ret):
'''
Return data to the master as an event
'''
fun = ret.get('fun','').replace('.','/')
_mminion().functions['event.send']('master/event_returner/{0}'.format(fun), ret) |
@arthurlogilab Sounds like a great idea. I would want the event to be more configurable, in my use case 'fun' is not sufficient but I could make it work if #36278 was resolved. Also, a note on the code. I am having some issues with reactor blowing up due to yaml issues with the |
Here is the promised update. To get around the issue of the json->yaml->json (from returner to reactor to runner) which sometimes results in a yaml render failure in the reactor, I have reworked the bits and rewritten the reactor in pure python. Here is the updated schedule-returner.py file (with code to handle #35784):
Here is the updated scheduled-job-return-reactor.sls file:
And here is the updated scheduled-job-runner.py file (with code to handle #36187, #35812 and #36114):
|
@scubahub In the meantime this would be a great item for the salt-contrib repo. Are you interested? |
@cro Sure, haven't run into salt-contrib before. |
I stumble over this case and wonder if there is an documentation fault here: Job Management
So i implement an schedule which runs once per minute (verified in the minion log that it runs) |
This is fixed and could be closed. FYI @rallytime @Ch3LL |
Hi all, I am currently running Salt 3004 and still seem to have this issue. Note this is a Proxy Minion, not a standard Minion. Schedule Config:
Job Cache (note nothing for test.ping over several minutes):
Proxy Minion debug log is showing up with this every 60 seconds:
|
salt schedule doesn't return jobs result info to master, and don't fire event to event bus. It's inconvenient for debugging or checking the schedule functions status.
The text was updated successfully, but these errors were encountered: