File: collect-openstack-logs.yaml

package info (click to toggle)
python-diskimage-builder 3.37.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,572 kB
  • sloc: sh: 7,380; python: 6,444; makefile: 37
file content (21 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- hosts: all
  tasks:
    - name: Copy openstack logs
      ignore_errors: yes
      block:
        - name: Make openstack logs dir
          become: true
          file:
            path: /var/log/nodepool/openstack
            state: directory
            mode: '0755'
        - name: Write out openstack logs
          become: true
          shell:
            cmd: |
              u=""
              name=""
              for u in $(systemctl list-unit-files | grep devstack | awk '{print $1}'); do
                name=$(echo $u | sed 's/devstack@/screen-/' | sed 's/\.service//')
                journalctl -o short-precise --unit $u  > /var/log/nodepool/openstack/$name.txt
              done