57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
#
|
|
# Copy OVN SB & NB database files: those files can be handy for debugging issues as the
|
|
# ovsdb files are stored as logs.
|
|
#
|
|
|
|
- name: Check whether OVNSB DB was created
|
|
stat:
|
|
path: /opt/stack/data/ovs/ovnsb_db.db
|
|
register: ovnsb_file
|
|
|
|
- name: Create destination directory to collect OVN database logs
|
|
file: path={{ ansible_user_dir }}/workspace/logs/ovs_dbs state=directory
|
|
when: ovnsb_file.stat.exists
|
|
|
|
- name: Collect OVN databases
|
|
copy:
|
|
remote_src: true
|
|
src: '/opt/stack/data/ovs/{{ item }}.db'
|
|
dest: '{{ ansible_user_dir }}/workspace/logs/ovs_dbs/{{ item }}.txt'
|
|
with_items:
|
|
- conf
|
|
- ovnnb_db
|
|
- ovnsb_db
|
|
when: ovnsb_file.stat.exists
|
|
|
|
- name: Copy OVN database logs
|
|
copy:
|
|
remote_src: true
|
|
src: '/opt/stack/new/{{ item }}.log'
|
|
dest: '{{ ansible_user_dir }}/workspace/logs/ovs_dbs/{{ item }}.log.txt'
|
|
with_items:
|
|
- ovsdb-server-nb
|
|
- ovsdb-server-sb
|
|
when: ovnsb_file.stat.exists
|
|
become: true
|
|
|
|
- name: Compress OVN databases in individual files
|
|
shell: gzip -9 {{ ansible_user_dir }}/workspace/logs/ovs_dbs/*
|
|
when: ovnsb_file.stat.exists
|
|
|
|
#
|
|
# Synchronize files from workspace in node to the zuul log_root which will be stored
|
|
#
|
|
|
|
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
|
|
synchronize:
|
|
src: '{{ ansible_user_dir }}/workspace/'
|
|
dest: '{{ zuul.executor.log_root }}'
|
|
mode: pull
|
|
copy_links: true
|
|
verify_host: true
|
|
rsync_opts:
|
|
- --include=/logs/**
|
|
- --include=*/
|
|
- --exclude=*
|
|
- --prune-empty-dirs
|