Extract system logs after each job run
Change-Id: I5881bf36c15d0a6c60c1f1f20bcc5eed9f7adcdf
diff --git a/roles/collect-system-logs/tasks/main.yaml b/roles/collect-system-logs/tasks/main.yaml
new file mode 100644
index 0000000..4ddf3de
--- /dev/null
+++ b/roles/collect-system-logs/tasks/main.yaml
@@ -0,0 +1,12 @@
+- name: Create logs directory
+ file:
+ path: "{{ ansible_user_dir }}/zuul-output/logs"
+ state: directory
+ mode: 0755
+
+- name: Save system journal
+ shell: "journalctl -b &> {{ ansible_user_dir }}/zuul-output/logs/journal.txt"
+ args:
+ executable: /bin/bash
+ become: yes
+ failed_when: false