2018-12-06 07:15:02 +08:00
|
|
|
---
|
|
|
|
# This playbook queries each OSD using `ceph-volume inventory` to report the
|
|
|
|
# entire storage device inventory of a cluster.
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# ansible-playbook storage-inventory.yml
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Gather facts and check the init system
|
|
|
|
hosts: osds
|
2018-12-06 07:15:02 +08:00
|
|
|
become: true
|
|
|
|
tasks:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Gather facts on all Ceph hosts
|
|
|
|
ansible.builtin.debug:
|
|
|
|
msg: "gather facts on all Ceph hosts for following reference"
|
2018-12-06 07:15:02 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Query each host for storage device inventory
|
|
|
|
hosts: osds
|
2018-12-06 07:15:02 +08:00
|
|
|
become: true
|
|
|
|
tasks:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Import ceph-defaults role
|
|
|
|
ansible.builtin.import_role:
|
2018-12-06 07:15:02 +08:00
|
|
|
name: ceph-defaults
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: List storage inventory
|
2018-12-06 07:15:02 +08:00
|
|
|
ceph_volume:
|
|
|
|
action: "inventory"
|
|
|
|
environment:
|
2020-08-06 00:02:48 +08:00
|
|
|
CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
2018-12-06 07:15:02 +08:00
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|