I have a task that searches logs for specific errors in various logs (up to 7 days worth of logs). When searching through just one log I never had an issue, but when searching through the 7 logs (used a wildcard to accomplish this), sometimes Ansible goes to lunch and doesn’t recover. It just sits there like it is still executing. We have let it run for many hours in that state just to make sure. I think it has a lot to do with timing and/or the size of the files (and the number of errors found int he files). Wondering if there is a more robust way to address this so that it will either not hang, continue on after a certain point (maybe a 5 minute timeout) or be more efficient (such as searching logs and writing to a file with an ansible module I don’t know of)?
name: Check on report gathering – This can take a while
async_status:
jid: “{{ gather_sleeper.ansible_job_id }}”
register: job_result
until: job_result.finished
retries: 37
failed_when: false
I have a task that searches logs for specific errors in various logs (up to 7 days worth of logs). When searching
through just one log I never had an issue, but when searching through the 7 logs (used a wildcard to accomplish this),
sometimes Ansible goes to lunch and doesn't recover. It just sits there like it is still executing. We have let it run
for many hours in that state just to make sure. I think it has a lot to do with timing and/or the size of the files
(and the number of errors found int he files). Wondering if there is a more robust way to address this so that it will
either not hang, continue on after a certain point (maybe a 5 minute timeout) or be more efficient (such as searching
logs and writing to a file with an ansible module I don't know of)?