]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
build_utils: adds a method that creates a collect-logs.yml playbook
authorAndrew Schoen <aschoen@redhat.com>
Thu, 8 Mar 2018 18:06:30 +0000 (12:06 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 8 Mar 2018 18:08:54 +0000 (12:08 -0600)
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 <aschoen@redhat.com>
scripts/build_utils.sh

index 863895b675f4fbcb55657977551ccb53eb616eed..77373fba69c081242cb5cb89a386b4d655473e22 100644 (file)
@@ -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
+}