Open grichmond-salt opened 6 years ago
Yeah, we should reasonably be able to pass the __pub_jid
to the salt.utils.template.compile_template function so that the jid can be available in state files at the very least, then it can be passed to other templates using context.
Isn't the JobID only available for non-local calls? So a salt-call --local state.apply foo
would fail to render, as there's no JobID to be added to the Jinja context? So this would also effectively prevent local development of states outside a full-blown Minion/Master setup?
the __pub_jid is the jid assigned from the master, so if you run --local, aka masterless, it will never hit the publish bus, and won't get the pub_jid.
@saltstack/team-triage
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Thank you for updating this issue. It is no longer marked as stale.
This feature would be very beneficial for a use case I'm working with. Consider a case where we log into a device and create a session. We could make the session name include the job id so that we have an easier time cross referencing the execution on the remote device with the job results, located on the minion / master
I am working on a solution where we need like to correlate logs generated by salt and logs created by processes that are triggered by salt (perhaps via cmd.run or something like that).
It would be relatively easy to match up log entries if we could capture the jid
and pass it to these sub processes where it could be included it in those generated logs.
Having access to the JID would be useful for a use case of mine also
@waynew another good one for the Test Clinic, assigning you only in attempt to help write tests. We will still need tests written before we can commit to a release cycle for this issue and PR, but thank you all for your contributions!
Any news on this?
I want to create a link in an email that points to the job in SaltGUI (for example:
https://my.saltgui.com:3333/?id=20220316135831085312#job
).
Therefor, I need the JID.
Any news on this ?
Description of Issue/Question
The job id is not presently available via Jinja during state runs.
Note for starting point from @gtmanfred: https://github.com/saltstack/salt/blob/2018.3/salt/modules/state.py#L1053
Setup
N/A
Steps to Reproduce Issue
N/A
Versions Report
New request.