blob: b9af02a591ac8536a80605bc731445dd2d3b990d [file] [log] [blame]
Monty Taylor36ddea32017-10-02 10:05:17 -05001# TODO: convert this to ansible
2- name: Export journal files
3 become: true
4 shell:
5 cmd: |
6 u=""
7 name=""
8 for u in `systemctl list-unit-files | grep devstack | awk '{print $1}'`; do
9 name=$(echo $u | sed 's/devstack@/screen-/' | sed 's/\.service//')
10 journalctl -o short-precise --unit $u | tee {{ devstack_base_dir }}/logs/$name.txt > /dev/null
11 done
12
13 # Export the journal in export format to make it downloadable
14 # for later searching. It can then be rewritten to a journal native
15 # format locally using systemd-journal-remote. This makes a class of
16 # debugging much easier. We don't do the native conversion here as
17 # some distros do not package that tooling.
18 journalctl -u 'devstack@*' -o export | \
19 xz --threads=0 - > {{ devstack_base_dir }}/logs/devstack.journal.xz
20
21 # The journal contains everything running under systemd, we'll
22 # build an old school version of the syslog with just the
23 # kernel and sudo messages.
24 journalctl \
25 -t kernel \
26 -t sudo \
27 --no-pager \
28 --since="$(cat {{ devstack_base_dir }}/log-start-timestamp.txt)" \
29 | tee {{ devstack_base_dir }}/logs/syslog.txt > /dev/null