I am using the following. Not sure if there is a better solution:
- name: Gather error reports in background
shell: |
while read line; do
grep -i "$line" "{{ log_source }}"* | uniq > "{{ dest_dir
}}/{{ ansible_hostname }}-$line.txt"
done < "{{ error_log }}"
failed_when: false
args:
executable: /bin/bash
async: 180
poll: 0
register: gather_sleeper
- 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
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5c9f7260-372b-4ef1-8cd5-ac78339d9e39%40googlegroups.com.