This repository has been archived on 2026-11-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openstack-deployment/ansible/playbooks/ceph_remove_all_osd.yml
T
2020-08-12 00:02:27 +03:00

25 lines
699 B
YAML

---
- hosts: bonchvisors
serial: 11
remote_user: cephadmin
become: true
become_user: root
become_method: sudo
tasks:
- name: detect osd number in array
shell: systemctl list-units --type=service --all | grep osd | awk '{print $1}' | awk -F "@" '{print $2}' | awk -F "." '{print $1}'
args:
executable: /bin/bash
register: osd_num
- name: delete osd
shell: ceph osd crush reweight osd.{{item}} 0.0; ceph osd out {{item}}; systemctl stop ceph-osd@{{item}}; ceph osd crush remove osd.{{item}}; ceph auth del osd.{{item}}; ceph osd rm {{item}}
args:
executable: /bin/bash
loop: "{{osd_num.stdout_lines}}"
when: osd_num.stdout != ""