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 containerized osd disk collocated
|
|
|
|
shell: |
|
|
|
|
docker run --net=host \
|
|
|
|
--pid=host \
|
|
|
|
--privileged=true \
|
2017-09-28 06:17:12 +08:00
|
|
|
--name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.1 | regex_replace('/dev/', '') }} \
|
2017-07-25 23:54:26 +08:00
|
|
|
-v /etc/ceph:/etc/ceph \
|
|
|
|
-v /var/lib/ceph/:/var/lib/ceph/ \
|
|
|
|
-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 \
|
2017-09-13 05:31:19 +08:00
|
|
|
-e OSD_DEVICE={{ item.1 }} \
|
2017-07-25 23:54:26 +08:00
|
|
|
{{ docker_env_args }} \
|
|
|
|
{{ ceph_osd_docker_prepare_env }} \
|
|
|
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
|
|
|
with_together:
|
2017-09-05 05:22:12 +08:00
|
|
|
- "{{ parted_results.results | default([]) }}"
|
2017-07-25 23:54:26 +08:00
|
|
|
- "{{ devices }}"
|
2017-07-24 17:35:08 +08:00
|
|
|
when:
|
2017-07-25 23:54:26 +08:00
|
|
|
- not osd_auto_discovery
|
|
|
|
- containerized_deployment
|
2017-09-28 06:17:12 +08:00
|
|
|
- not item.0.get("skipped")
|
|
|
|
- item.0.get("rc", 0) != 0
|
2017-06-29 23:34:54 +08:00
|
|
|
|
2017-07-25 23:54:26 +08:00
|
|
|
- name: automatic prepare ceph containerized osd disk collocated
|
|
|
|
shell: |
|
|
|
|
docker run --net=host \
|
|
|
|
--pid=host \
|
|
|
|
--privileged=true \
|
2017-11-08 15:47:39 +08:00
|
|
|
--name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.split('/')[-1] }} \
|
2017-07-25 23:54:26 +08:00
|
|
|
-v /etc/ceph:/etc/ceph \
|
|
|
|
-v /var/lib/ceph/:/var/lib/ceph/ \
|
|
|
|
-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 \
|
2017-11-08 15:47:39 +08:00
|
|
|
-e OSD_DEVICE={{ item }} \
|
2017-07-25 23:54:26 +08:00
|
|
|
{{ docker_env_args }} \
|
|
|
|
{{ ceph_osd_docker_prepare_env }} \
|
|
|
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
2017-11-08 15:47:39 +08:00
|
|
|
with_items: "{{ devices }}"
|
2017-07-24 17:35:08 +08:00
|
|
|
when:
|
2017-09-28 06:17:12 +08:00
|
|
|
- osd_auto_discovery
|
|
|
|
- containerized_deployment
|
2017-11-08 15:47:39 +08:00
|
|
|
- devices is defined
|
2017-07-24 17:35:08 +08:00
|
|
|
|
2017-07-25 23:54:26 +08:00
|
|
|
- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with collocated osd data and journal
|
2017-09-13 05:31:19 +08:00
|
|
|
command: "ceph-disk prepare {{ ceph_disk_cli_options }} {{ item.1 }}"
|
2017-06-29 23:34:54 +08:00
|
|
|
with_together:
|
2017-09-05 05:22:12 +08:00
|
|
|
- "{{ parted_results.results | default([]) }}"
|
2017-06-29 23:34:54 +08:00
|
|
|
- "{{ devices }}"
|
|
|
|
when:
|
2017-09-28 06:17:12 +08:00
|
|
|
- not containerized_deployment
|
2017-06-29 23:34:54 +08:00
|
|
|
- not item.0.get("skipped")
|
|
|
|
- item.0.get("rc", 0) != 0
|