An Ansible role for aggregating logs from different nodes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

33 lines
971 B

---
- hosts: all
tasks:
- name: Ls {{ ansible_user_dir }}/workspace/logs/ # remove before merge
command: ls -la {{ ansible_user_dir }}/workspace/logs/
changed_when: false
register: test_output
- name: debug test # remove before merge
debug: var=test_output
- name: Ensure all files exists
stat:
path: "{{ item }}"
register: failures_file
loop:
- "{{ ansible_user_dir }}/workspace/logs/failures_file"
# TODO: Revert back after bug #1947133 is fixed
loop_control:
label: '{{ item.split("/")[-1] }}'
- name: Ensure all files exists - test
assert:
that:
- item.stat.exists
loop: "{{ failures_file.results }}"
- name: Check if we have strings in failures_file
command: grep 'No valid host was found' {{ ansible_user_dir }}/workspace/logs/failures_file
changed_when: false
# TODO: Revert back after bug #1947133 is fixed