Collect kayobe and kolla configuration in deployment CI jobs

This can help in analysing failures.

Change-Id: I9910f89fbeb5698a66659a835041dc564e2b64ae
This commit is contained in:
Mark Goddard 2018-05-16 19:11:40 +01:00
parent 48562bf305
commit d594faf657
6 changed files with 20 additions and 3 deletions

View File

@ -4,4 +4,5 @@
- role: kayobe-diagnostics - role: kayobe-diagnostics
kayobe_diagnostics_phase: "post" kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs" 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 }}" kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"

View File

@ -4,4 +4,5 @@
- role: kayobe-diagnostics - role: kayobe-diagnostics
kayobe_diagnostics_phase: "post" kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs" 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 }}" kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"

View File

@ -5,5 +5,8 @@ kayobe_diagnostics_phase:
# Directory on the remote host in which to save diagnostics. # Directory on the remote host in which to save diagnostics.
kayobe_diagnostics_logs_dir: 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. # Directory on the executor in which to save logs.
kayobe_diagnostics_executor_log_dir: kayobe_diagnostics_executor_log_dir:

View File

@ -3,13 +3,21 @@
# NOTE(mgoddard): This has been adapted from tests/get_logs.sh in Kolla # NOTE(mgoddard): This has been adapted from tests/get_logs.sh in Kolla
# Ansible. # Ansible.
# Environment variables:
# $LOG_DIR is the directory to copy logs to.
# $CONFIG_DIR is the directory to copy configuration from.
set +o errexit set +o errexit
copy_logs() { copy_logs() {
LOG_DIR=/tmp/logs
cp -rnL /var/lib/docker/volumes/kolla_logs/_data/* ${LOG_DIR}/kolla/ 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/ cp -rvnL /var/log/* ${LOG_DIR}/system_logs/

View File

@ -9,6 +9,9 @@
register: get_logs_result register: get_logs_result
become: true become: true
failed_when: false failed_when: false
environment:
LOG_DIR: "{{ kayobe_diagnostics_log_dir }}"
CONFIG_DIR: "{{ kayobe_diagnostics_config_dir }}"
- name: Print get_logs.sh output - name: Print get_logs.sh output
debug: debug:

View File

@ -11,6 +11,7 @@
mode: 0777 mode: 0777
with_items: with_items:
- "docker_logs" - "docker_logs"
- "kayobe_configs"
- "kolla_configs" - "kolla_configs"
- "system_logs" - "system_logs"
- "kolla" - "kolla"