]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-docker-cluster: ensure old logs are removed 2152/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 9 Nov 2017 09:42:14 +0000 (10:42 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 9 Nov 2017 16:49:20 +0000 (17:49 +0100)
purge-docker-cluster must remove all osd_disk_prepare logs in
`{{ ceph_osd_docker_run_script_path }}`, otherwise if you purge your
cluster and try to redeploy it, osds will fail to start since because it
will try to retrieve find a partition uuid which doesn't exist.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1510470
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/purge-docker-cluster.yml

index 4526a4a566fb50fcddf8647d282bea76d62bc412..846cab95b159ea9b9711b0b9a89f7b0eb023fcf6 100644 (file)
     tags:
       remove_img
 
+  - name: include vars from group_vars/osds.yml
+    include_vars:
+      file: "{{ item }}"
+    with_first_found:
+      - files:
+        - "{{ playbook_dir }}/group_vars/osds"
+        - "{{ playbook_dir }}/group_vars/osds.yml"
+        skip: true
+
+  - name: ensure all osd_disk_prepare logs are removed
+    file:
+      path: "{{ item }}"
+      state: absent
+    with_fileglob:
+      - "{{ ceph_osd_docker_run_script_path | default('/usr/share') }}/ceph-osd-prepare-*.log"
 
 - name: purge ceph mon cluster