]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnodes: Clean up leftover Ceph artifacts from previous jobs 326/head
authorDavid Galloway <dgallowa@redhat.com>
Mon, 31 Jul 2017 20:53:22 +0000 (16:53 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 5 Sep 2017 19:02:47 +0000 (15:02 -0400)
Fixes: http://tracker.ceph.com/issues/20623
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/tasks/main.yml

index b060ed45bb55978c44e14a201d40b35d62b35d9d..339bbed53a9fc200f552f5cc42589f140b667201 100644 (file)
   tags:
     - resolvconf
 
+# http://tracker.ceph.com/issues/20623
+- name: List any leftover Ceph artifacts from previous jobs
+  shell: 'find {{ item }} -name "*ceph*"'
+  with_items:
+    - /var/run/
+    - /etc/systemd/system/
+    - /etc/ceph
+    - /var/log/
+  register: ceph_test_artifacts
+  changed_when: ceph_test_artifacts.stdout != ""
+  failed_when: ceph_test_artifacts.rc != 0 and "No such file or directory" not in ceph_test_artifacts.stderr
+
+- name: Delete any leftover Ceph artifacts from previous jobs
+  file:
+    path: "{{ item }}"
+    state: absent
+  with_items: "{{ ceph_test_artifacts.results|map(attribute='stdout_lines')|list }}"
+
 # Touch a file to indicate we are done. This is something chef did;
 # teuthology.task.internal.vm_setup() expects it.
 - name: Touch /ceph-qa-ready