Gather container runtime logs
Change-Id: I9d3bedd668a384c3baecb6ae1bd8404cd10baf1e
This commit is contained in:
parent
f66f94dc80
commit
f681c373e2
@ -19,6 +19,7 @@
|
||||
- gather-host-logs
|
||||
- airship-gather-sushy-logs
|
||||
- airship-gather-libvirt-logs
|
||||
- airship-gather-runtime-logs
|
||||
- airship-airshipctl-gather-configs
|
||||
environment:
|
||||
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…
Reference in New Issue
Block a user