Merge "Gather container runtime logs"
This commit is contained in:
commit
7ce111b282
@ -19,6 +19,7 @@
|
|||||||
- gather-host-logs
|
- gather-host-logs
|
||||||
- airship-gather-sushy-logs
|
- airship-gather-sushy-logs
|
||||||
- airship-gather-libvirt-logs
|
- airship-gather-libvirt-logs
|
||||||
|
- airship-gather-runtime-logs
|
||||||
- airship-airshipctl-gather-configs
|
- airship-airshipctl-gather-configs
|
||||||
environment:
|
environment:
|
||||||
LIBVIRT_DEFAULT_URI: qemu:///system
|
LIBVIRT_DEFAULT_URI: qemu:///system
|
||||||
|
33
roles/airship-gather-runtime-logs/tasks/main.yaml
Normal file
33
roles/airship-gather-runtime-logs/tasks/main.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
- name: populate service facts
|
||||||
|
service_facts:
|
||||||
|
|
||||||
|
- name: set runtime logs dir
|
||||||
|
set_fact:
|
||||||
|
runtime_logs_dir: "{{ logs_dir }}/runtime"
|
||||||
|
|
||||||
|
- name: ensure directory for runtime logs exists
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: "{{ runtime_logs_dir }}"
|
||||||
|
|
||||||
|
- name: dump docker logs
|
||||||
|
shell: |-
|
||||||
|
journalctl --unit "docker" --no-pager > "{{ runtime_logs_dir }}/docker.log"
|
||||||
|
when: ansible_facts.services['docker'] is defined
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: dump containerd logs
|
||||||
|
shell: |-
|
||||||
|
journalctl --unit "containerd" --no-pager > "{{ runtime_logs_dir }}/containerd.log"
|
||||||
|
when: ansible_facts.services['containerd'] is defined
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: "Downloads logs to executor"
|
||||||
|
synchronize:
|
||||||
|
src: "{{ runtime_logs_dir }}"
|
||||||
|
dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
|
||||||
|
mode: pull
|
Loading…
x
Reference in New Issue
Block a user