Repository navigation
Expand file tree
/
Copy pathcollect-logs-devstack.yaml
More file actions
106 lines (94 loc) · 2.92 KB
/
Copy pathcollect-logs-devstack.yaml
File metadata and controls
106 lines (94 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
- hosts: devstack
vars_files:
- zuul-params.yaml
tasks:
- name: Include variables from group_vars/devstack
include_vars: "group_vars/devstack"
failed_when: False
tags: always
- name: Include variables from job_vars/{{ zuul_project | basename }}.yaml
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include variables from job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- name: Export logs to {{ devstack_dir.stack }}/logs using journalctl
shell: |
for u in $(sudo systemctl list-unit-files | grep devstack | awk '{print $1}'); do
name=$(echo $u | sed 's/devstack@//' | sed 's/\.service//')
sudo journalctl -o short-precise --unit $u > {{ devstack_dir.stack }}/logs/$name.txt
done
ignore_errors: True
- name: Create devstack folders
file:
path: "{{ item }}"
state: directory
mode: 0755
with_items:
- "{{ log_path }}/devstack/logs"
- "{{ log_path }}/devstack/conf"
- "{{ log_path }}/tempest"
ignore_errors: True
delegate_to: 127.0.0.1
- name: Dump pip list to file
shell: pip list > /opt/stack/logs/pip-list.txt
become: True
ignore_errors: True
- name: Dump OVS bridge config to file
shell: ovs-vsctl -v show > /opt/stack/logs/ovs-bridges.txt
become: True
ignore_errors: True
- name: Copy log files
synchronize:
mode: pull
src: "{{ item }}"
dest: "{{ log_path }}/devstack/logs"
rsync_opts:
- "--no-links"
ignore_errors: True
with_items:
- /opt/stack/logs/
- /var/log/cloud-init-output.log
- /var/log/cloud-init.log
- /var/log/syslog
- /var/log/mysql/error.log
- name: Fix permissions for log files
file:
path: "{{ log_path }}/devstack/logs/{{ item }}"
mode: 0644
ignore_errors: True
with_items:
- syslog
- error.log
delegate_to: 127.0.0.1
- name: Copy conf files
synchronize:
mode: pull
src: "{{ item }}"
dest: "{{ log_path }}/devstack/conf"
rsync_opts:
- "--no-links"
ignore_errors: True
with_items:
- /etc/neutron
- /etc/nova
- /etc/cinder
- /etc/glance
- /etc/keystone
- /etc/swift
- /etc/openvswitch
- name: Copy tempest files
synchronize:
mode: pull
src: "{{ item }}"
dest: "{{ log_path }}/tempest"
rsync_opts:
- "--no-links"
ignore_errors: True
with_items:
- /opt/stack/tempest/tempest.log
- /opt/stack/tempest/etc/tempest.conf
- /home/ubuntu/tempest/