Skip to content
Snippets Groups Projects
Commit d594faf6 authored by Mark Goddard's avatar Mark Goddard
Browse files

Collect kayobe and kolla configuration in deployment CI jobs

This can help in analysing failures.

Change-Id: I9910f89fbeb5698a66659a835041dc564e2b64ae
parent 48562bf3
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,5 @@
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs"
kayobe_diagnostics_config_dir: "{{ zuul.project.src_dir }}/config/src/kayobe-config"
kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
......@@ -4,4 +4,5 @@
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs"
kayobe_diagnostics_config_dir: "{{ zuul.project.src_dir }}/config/src/kayobe-config"
kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
......@@ -5,5 +5,8 @@ kayobe_diagnostics_phase:
# Directory on the remote host in which to save diagnostics.
kayobe_diagnostics_logs_dir:
# Directory on the remote host in which configuration is stored.
kayobe_diagnostics_config_dir:
# Directory on the executor in which to save logs.
kayobe_diagnostics_executor_log_dir:
......@@ -3,13 +3,21 @@
# NOTE(mgoddard): This has been adapted from tests/get_logs.sh in Kolla
# Ansible.
# Environment variables:
# $LOG_DIR is the directory to copy logs to.
# $CONFIG_DIR is the directory to copy configuration from.
set +o errexit
copy_logs() {
LOG_DIR=/tmp/logs
cp -rnL /var/lib/docker/volumes/kolla_logs/_data/* ${LOG_DIR}/kolla/
# TODO(mgoddard): Copy kayobe config
if [[ -d ${CONFIG_DIR} ]]; then
cp -rnL ${CONFIG_DIR}/etc/kayobe/* ${LOG_DIR}/kayobe_configs
cp -rnL ${CONFIG_DIR}/etc/kolla/* ${LOG_DIR}/kolla_configs
# Don't save the IPA images.
rm ${LOG_DIR}/kayobe_configs/kolla/config/ironic/ironic-agent.{kernel,initramfs}
rm ${LOG_DIR}/kolla_configs/config/ironic/ironic-agent.{kernel,initramfs}
fi
cp -rvnL /var/log/* ${LOG_DIR}/system_logs/
......
......@@ -9,6 +9,9 @@
register: get_logs_result
become: true
failed_when: false
environment:
LOG_DIR: "{{ kayobe_diagnostics_log_dir }}"
CONFIG_DIR: "{{ kayobe_diagnostics_config_dir }}"
- name: Print get_logs.sh output
debug:
......
......@@ -11,6 +11,7 @@
mode: 0777
with_items:
- "docker_logs"
- "kayobe_configs"
- "kolla_configs"
- "system_logs"
- "kolla"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment