Skip to main content

saltstack equivalent of puppet last_run_summary.yaml [Resolved]

Does Salt have the equivalent of Puppet's last_run_summary.yaml? If not, what's the suggested way to monitor the success or failure of executions on individual salt minions?

Question Credit: user162988
Question Reference
Asked March 17, 2019
Tags: saltstack
Posted Under: Network
2 Answers

I think I found a reasonable way to get this information written to the file system. We can modify the minion config (on Linux I believe the default location is /etc/salt/minion) to add:

returners: rawfile_json

This will result in one JSON object per line being logged. Documented here. The default output file location for this is /var/log/salt/events. The JSON object has fields which we can use: retcode, success, and fun (the function name). In my case I want to filter for fun = "state.apply".

credit: user162988
Answered March 17, 2019

I think you can use the jobs.exit_success command to do so

The only thing is you need to retrieve the job_id first

salt-run jobs.list_jobs
salt-run jobs.exit_success <jobid>

credit: agm650
Answered March 17, 2019
Your Answer