2014-03-10 23:52:31 +08:00
|
|
|
---
|
2017-07-25 23:54:26 +08:00
|
|
|
# use shell rather than docker module
|
|
|
|
# to ensure osd disk prepare finishes before
|
|
|
|
# starting the next task
|
|
|
|
- name: prepare ceph "{{ osd_objectstore }}" containerized osd disk(s) non-collocated
|
|
|
|
shell: |
|
|
|
|
docker run --net=host \
|
2019-06-22 05:19:07 +08:00
|
|
|
--ulimit nofile=1024:1024 \
|
2017-07-25 23:54:26 +08:00
|
|
|
--pid=host \
|
|
|
|
--privileged=true \
|
2017-09-28 06:17:12 +08:00
|
|
|
--name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.1 | regex_replace('/dev/', '') }} \
|
2018-04-17 21:32:53 +08:00
|
|
|
-v /etc/ceph:/etc/ceph:z \
|
|
|
|
-v /var/lib/ceph/:/var/lib/ceph/:z \
|
2017-07-25 23:54:26 +08:00
|
|
|
-v /dev:/dev \
|
|
|
|
-v /etc/localtime:/etc/localtime:ro \
|
2017-10-05 22:22:04 +08:00
|
|
|
-e DEBUG=verbose \
|
2017-07-25 23:54:26 +08:00
|
|
|
-e CLUSTER={{ cluster }} \
|
|
|
|
-e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \
|
|
|
|
-e OSD_DEVICE={{ item.1 }} \
|
|
|
|
-e OSD_JOURNAL={{ item.2 }} \
|
|
|
|
{{ docker_env_args }} \
|
|
|
|
{{ ceph_osd_docker_prepare_env }} \
|
|
|
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
|
|
|
with_together:
|
2017-09-13 05:31:19 +08:00
|
|
|
- "{{ parted_results.results | default([]) }}"
|
2017-07-25 23:54:26 +08:00
|
|
|
- "{{ devices }}"
|
|
|
|
- "{{ dedicated_devices }}"
|
2015-06-26 05:40:07 +08:00
|
|
|
when:
|
2017-07-25 23:54:26 +08:00
|
|
|
- containerized_deployment
|
2017-07-24 17:35:08 +08:00
|
|
|
- osd_objectstore == 'filestore'
|
2018-04-13 22:36:43 +08:00
|
|
|
- item.0.partitions|length == 0
|
2017-07-24 17:35:08 +08:00
|
|
|
|
2019-04-25 00:21:38 +08:00
|
|
|
- name: prepare ceph "{{ osd_objectstore }}" containerized osd disk(s) non-collocated with a dedicated device for db
|
|
|
|
shell: |
|
|
|
|
docker run --net=host \
|
2019-06-22 05:19:07 +08:00
|
|
|
--ulimit nofile=1024:1024 \
|
2019-04-25 00:21:38 +08:00
|
|
|
--pid=host \
|
|
|
|
--privileged=true \
|
|
|
|
--name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.1 | regex_replace('/dev/', '') }} \
|
|
|
|
-v /etc/ceph:/etc/ceph:z \
|
|
|
|
-v /var/lib/ceph/:/var/lib/ceph/:z \
|
|
|
|
-v /dev:/dev \
|
|
|
|
-v /etc/localtime:/etc/localtime:ro \
|
|
|
|
-e DEBUG=verbose \
|
|
|
|
-e CLUSTER={{ cluster }} \
|
|
|
|
-e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \
|
|
|
|
-e OSD_DEVICE={{ item.1 }} \
|
|
|
|
-e OSD_BLUESTORE_BLOCK_DB={{ item.2 }} \
|
|
|
|
{{ docker_env_args }} \
|
|
|
|
{{ ceph_osd_docker_prepare_env }} \
|
|
|
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
|
|
|
with_together:
|
|
|
|
- "{{ parted_results.results | default([]) }}"
|
|
|
|
- "{{ devices }}"
|
|
|
|
- "{{ dedicated_devices }}"
|
|
|
|
when:
|
|
|
|
- containerized_deployment
|
|
|
|
- osd_objectstore == 'bluestore'
|
|
|
|
- item.0.partitions|length == 0
|
|
|
|
- bluestore_wal_devices|length == 0
|
|
|
|
|
2017-07-25 23:54:26 +08:00
|
|
|
- name: prepare ceph "{{ osd_objectstore }}" containerized osd disk(s) non-collocated with a dedicated device for db and wal
|
|
|
|
shell: |
|
|
|
|
docker run --net=host \
|
2019-06-22 05:19:07 +08:00
|
|
|
--ulimit nofile=1024:1024 \
|
2017-07-25 23:54:26 +08:00
|
|
|
--pid=host \
|
|
|
|
--privileged=true \
|
2017-09-28 06:17:12 +08:00
|
|
|
--name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.1 | regex_replace('/dev/', '') }} \
|
2018-04-17 21:32:53 +08:00
|
|
|
-v /etc/ceph:/etc/ceph:z \
|
|
|
|
-v /var/lib/ceph/:/var/lib/ceph/:z \
|
2017-07-25 23:54:26 +08:00
|
|
|
-v /dev:/dev \
|
|
|
|
-v /etc/localtime:/etc/localtime:ro \
|
2017-10-05 22:22:04 +08:00
|
|
|
-e DEBUG=verbose \
|
2017-07-25 23:54:26 +08:00
|
|
|
-e CLUSTER={{ cluster }} \
|
|
|
|
-e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \
|
|
|
|
-e OSD_DEVICE={{ item.1 }} \
|
|
|
|
-e OSD_BLUESTORE_BLOCK_DB={{ item.2 }} \
|
|
|
|
-e OSD_BLUESTORE_BLOCK_WAL={{ item.3 }} \
|
|
|
|
{{ docker_env_args }} \
|
|
|
|
{{ ceph_osd_docker_prepare_env }} \
|
|
|
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
|
|
|
with_together:
|
2017-09-13 05:31:19 +08:00
|
|
|
- "{{ parted_results.results | default([]) }}"
|
2017-07-25 23:54:26 +08:00
|
|
|
- "{{ devices }}"
|
|
|
|
- "{{ dedicated_devices }}"
|
|
|
|
- "{{ bluestore_wal_devices }}"
|
2017-07-24 17:35:08 +08:00
|
|
|
when:
|
2017-07-25 23:54:26 +08:00
|
|
|
- containerized_deployment
|
2017-07-24 17:35:08 +08:00
|
|
|
- osd_objectstore == 'bluestore'
|
2018-04-13 22:36:43 +08:00
|
|
|
- item.0.partitions|length == 0
|
2019-04-25 00:21:38 +08:00
|
|
|
- bluestore_wal_devices|length > 0
|
2017-06-29 23:34:54 +08:00
|
|
|
|
2017-07-25 23:54:26 +08:00
|
|
|
- name: prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) non-collocated
|
2017-09-13 05:31:19 +08:00
|
|
|
command: "ceph-disk prepare {{ ceph_disk_cli_options }} {{ item.1 }} {{ item.2 }}"
|
2017-07-27 23:05:59 +08:00
|
|
|
with_together:
|
2017-09-13 05:31:19 +08:00
|
|
|
- "{{ parted_results.results | default([]) }}"
|
2017-07-27 23:05:59 +08:00
|
|
|
- "{{ devices }}"
|
|
|
|
- "{{ dedicated_devices }}"
|
|
|
|
changed_when: false
|
2017-06-29 23:34:54 +08:00
|
|
|
when:
|
2017-07-27 23:05:59 +08:00
|
|
|
- osd_objectstore == 'filestore'
|
2017-07-25 23:54:26 +08:00
|
|
|
- not containerized_deployment
|
2018-04-13 22:36:43 +08:00
|
|
|
- item.0.partitions|length == 0
|
2017-06-29 23:34:54 +08:00
|
|
|
|
2018-12-13 15:42:49 +08:00
|
|
|
- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with a dedicated device for db
|
|
|
|
command: "ceph-disk prepare {{ ceph_disk_cli_options }} --block.db {{ item.1 }} {{ item.2 }}"
|
|
|
|
with_together:
|
|
|
|
- "{{ parted_results.results | default([]) }}"
|
|
|
|
- "{{ dedicated_devices }}"
|
|
|
|
- "{{ devices | unique }}"
|
|
|
|
when:
|
|
|
|
- osd_objectstore == 'bluestore'
|
|
|
|
- not containerized_deployment
|
|
|
|
- item.0.partitions|length == 0
|
|
|
|
- bluestore_wal_devices|length == 0
|
|
|
|
|
2017-07-25 23:54:26 +08:00
|
|
|
- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with a dedicated device for db and wal
|
2017-07-27 23:05:59 +08:00
|
|
|
command: "ceph-disk prepare {{ ceph_disk_cli_options }} --block.db {{ item.1 }} --block.wal {{ item.2 }} {{ item.3 }}"
|
2017-06-29 23:34:54 +08:00
|
|
|
with_together:
|
2017-09-13 05:31:19 +08:00
|
|
|
- "{{ parted_results.results | default([]) }}"
|
2017-07-27 23:05:59 +08:00
|
|
|
- "{{ dedicated_devices }}"
|
|
|
|
- "{{ bluestore_wal_devices }}"
|
2017-09-28 06:17:12 +08:00
|
|
|
- "{{ devices | unique }}"
|
2017-06-29 23:34:54 +08:00
|
|
|
when:
|
2017-07-27 23:05:59 +08:00
|
|
|
- osd_objectstore == 'bluestore'
|
2017-07-25 23:54:26 +08:00
|
|
|
- not containerized_deployment
|
2018-12-13 15:42:49 +08:00
|
|
|
- item.0.partitions|length == 0
|
|
|
|
- bluestore_wal_devices|length > 0
|