k8s TTLAfterFinished feature cleans up finished jobs, and the
absence of those jobs was making the AnsibleJob reconciliation loop
create a new job to replace it, thus re-running the automation.
For scenarios where the job fails, the "rescue" block re-runs the job in a new pod, and if that also fails, it will now set the isFinished status to true, which short-circuits the reconciliation loop on the next run, meaning that no other attempts are made. Example output from the AnsibleJob resource's status:
Summary
Details
For scenarios where the job fails, the "rescue" block re-runs the job in a new pod, and if that also fails, it will now set the
isFinished
status totrue
, which short-circuits the reconciliation loop on the next run, meaning that no other attempts are made. Example output from the AnsibleJob resource's status:For success scenarios, the
isFinished
status on the AnsibleJob resource is set totrue
along with the other statuses that denote a successful job run.Extra Information
A new parameter called
job_ttl
can now be configured on the AnsibleJob spec to set the time-to-live for a job that is in the finished state.For example: