python-tempestconf/playbooks/upload-logs.yaml
Chandan Kumar (raukadah) ca28815acc Collect openstack services logs after tempest run
Currently in packstack deployment, we are collecting logs
once the deployment finishes and then we run tempest tests and
collect tempest related logs.
If the tempest tests fails, we have no openstack services logs
with tempest api calls in service logs, it is very hard to find
out what is causing the failure.

Copying the openstack services logs just after tempest runs
finishes will more info about the failure.

It also disables the copy log operation once packstack
deployment finishes.

Change-Id: I5ab038a49eeabe564650894f50c3b51e33e93fd2
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
2019-11-13 16:29:35 +00:00

45 lines
1.2 KiB
YAML

- hosts: all
tasks:
# Copy openstack logs once tempest run finishes
- name: Copy openstack services logs once tempest run finish
shell:
cmd: |
set -e
set -x
source ./tools/copy-logs.sh
recover_default_logs
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace/packstack'
environment: '{{ zuul }}'
- name: Create tempest directory in /tmp/logs
file:
path: /tmp/logs/tempest
state: directory
become: true
- name: Copying tempest logs and config to /tmp/logs/tempest
copy:
src: "{{ item }}"
dest: /tmp/logs/tempest
remote_src: true
with_items:
- /opt/stack/tempest/etc/tempest.conf
- /opt/stack/tempest/tempest.log
- /etc/openstack/accounts.yaml
ignore_errors: true
become: true
- name: Upload logs
synchronize:
src: '/tmp/logs'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs