From 883083c7dcaf094dfda6ac84cedcb44647b8af26 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 8 Mar 2018 12:06:30 -0600 Subject: [PATCH] build_utils: adds a method that creates a collect-logs.yml playbook This playbook is used to collect ceph-volume and ceph-osd logs from vms that have failed tests. We do it this way so that we don't have to clone ceph-build to get at the playbook we stored in the repo. Signed-off-by: Andrew Schoen --- scripts/build_utils.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 863895b6..77373fba 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -677,3 +677,30 @@ github_status_setup() { fi } + +write_collect_logs_playbook() { + cat > $WORKSPACE/collect-logs.yml << EOF +- hosts: all + become: yes + tasks: + - name: collect ceph-volume logs + fetch: + src: "{{ item }}" + dest: "{{ archive_path }}" + fail_on_missing: no + flat: yes + failed_when: false + with_fileglob: + - "/var/log/ceph-volume*" + + - name: collect ceph-osd logs + fetch: + src: "{{ item }}" + dest: "{{ archive_path }}" + fail_on_missing: no + flat: yes + failed_when: false + with_fileglob: + - "/var/log/ceph-osd*" +EOF +} -- 2.39.5