|
6 | 6 | state: directory |
7 | 7 | owner: "{{ ansible_user }}" |
8 | 8 |
|
9 | | -# TODO: convert this to ansible |
10 | | -- name: Export journal files |
| 9 | +- name: Export legacy stack screen log files |
11 | 10 | become: true |
12 | 11 | shell: |
13 | 12 | cmd: | |
14 | 13 | u="" |
15 | 14 | name="" |
16 | | - for u in `systemctl list-unit-files | grep devstack | awk '{print $1}'`; do |
| 15 | + for u in $(systemctl list-unit-files | grep devstack | awk '{print $1}'); do |
17 | 16 | name=$(echo $u | sed 's/devstack@/screen-/' | sed 's/\.service//') |
18 | 17 | journalctl -o short-precise --unit $u | gzip - > {{ stage_dir }}/logs/$name.txt.gz |
19 | 18 | done |
20 | 19 |
|
21 | | - # Export the journal in export format to make it downloadable |
22 | | - # for later searching. It can then be rewritten to a journal native |
23 | | - # format locally using systemd-journal-remote. This makes a class of |
24 | | - # debugging much easier. We don't do the native conversion here as |
25 | | - # some distros do not package that tooling. |
26 | | - journalctl -u 'devstack@*' -o export | \ |
27 | | - xz --threads=0 - > {{ stage_dir }}/logs/devstack.journal.xz |
28 | | -
|
29 | | - # The journal contains everything running under systemd, we'll |
30 | | - # build an old school version of the syslog with just the |
31 | | - # kernel and sudo messages. |
| 20 | +- name: Export legacy syslog.txt |
| 21 | + become: true |
| 22 | + shell: |
| 23 | + # The journal contains everything running under systemd, we'll |
| 24 | + # build an old school version of the syslog with just the |
| 25 | + # kernel and sudo messages. |
| 26 | + cmd: | |
32 | 27 | journalctl \ |
33 | 28 | -t kernel \ |
34 | 29 | -t sudo \ |
35 | 30 | --no-pager \ |
36 | 31 | --since="$(cat {{ devstack_base_dir }}/log-start-timestamp.txt)" \ |
37 | 32 | | gzip - > {{ stage_dir }}/logs/syslog.txt.gz |
| 33 | +
|
| 34 | +# TODO: convert this to ansible |
| 35 | +# - make a list of the above units |
| 36 | +# - iterate the list here |
| 37 | +- name: Export journal |
| 38 | + become: true |
| 39 | + shell: |
| 40 | + # Export the journal in export format to make it downloadable |
| 41 | + # for later searching. It can then be rewritten to a journal native |
| 42 | + # format locally using systemd-journal-remote. This makes a class of |
| 43 | + # debugging much easier. We don't do the native conversion here as |
| 44 | + # some distros do not package that tooling. |
| 45 | + cmd: | |
| 46 | + journalctl -o export \ |
| 47 | + --since="$(cat {{ devstack_base_dir }}/log-start-timestamp.txt)" \ |
| 48 | + | xz --threads=0 - > {{ stage_dir }}/logs/devstack.journal.xz |
| 49 | +
|
| 50 | +- name: Save journal README |
| 51 | + become: true |
| 52 | + template: |
| 53 | + src: devstack.journal.README.txt.j2 |
| 54 | + dest: '{{ stage_dir }}/logs/devstack.journal.README.txt' |
0 commit comments