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
|
|
|
|
|
|
|
|
- name: gather facts and check the init system
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ osd_group_name|default('osds') }}"
|
2018-12-06 07:15:02 +08:00
|
|
|
|
|
|
|
become: true
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- debug: msg="gather facts on all Ceph hosts for following reference"
|
|
|
|
|
|
|
|
- name: query each host for storage device inventory
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ osd_group_name|default('osds') }}"
|
2018-12-06 07:15:02 +08:00
|
|
|
|
|
|
|
become: true
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
|
|
|
- name: list storage inventory
|
|
|
|
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 }}"
|