Collect journald logs
It is helpful when systemd fails for our services, to collect logs and see why that is. Change-Id: I084e4985d33caa77607b3ff1211837fe86a753ca Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
8b849814b6
commit
20729b2f30
|
@ -2,10 +2,37 @@
|
|||
tasks:
|
||||
- name: Ensure logs directory exists
|
||||
file:
|
||||
path: "{{ zuul.executor.log_root }}/logs"
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- "{{ zuul.executor.log_root }}/logs"
|
||||
- "{{ zuul.executor.log_root }}/logs/var/log"
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Ensure journald logs directory exists
|
||||
file:
|
||||
path: ~/logs/journal
|
||||
state: directory
|
||||
|
||||
- name: Collect journald logs
|
||||
become: yes
|
||||
shell: "journalctl -u {{ item }}.service > /home/{{ ansible_user }}/logs/journal/{{ item }}.service.log"
|
||||
args:
|
||||
creates: "/home/{{ ansible_user }}/logs/journal/{{ item }}.service.log"
|
||||
with_items:
|
||||
- zuul-executor
|
||||
- zuul-fingergw
|
||||
- zuul-merger
|
||||
- zuul-scheduler
|
||||
- zuul-web
|
||||
|
||||
- name: Collect journald log files
|
||||
synchronize:
|
||||
dest: "{{ zuul.executor.log_root }}/logs/var/log"
|
||||
mode: pull
|
||||
src: ~/logs/journal
|
||||
verify_host: true
|
||||
|
||||
- name: Collect zuul log files
|
||||
synchronize:
|
||||
dest: "{{ zuul.executor.log_root }}/logs"
|
||||
|
|
Loading…
Reference in New Issue