Proof-of-concept clusters or actual production clusters will never want to use this. We also do not test it anywhere for this same reason.
Signed-off-by: Gregory Meno <gmeno@redhat.com>
#raw_journal_devices: []
-# III. Use directory instead of disk for OSDs
-# Use 'true' to enable this scenario
-
-#osd_directory: false
-#osd_directories:
-# - /var/lib/ceph/osd/mydir1
-# - /var/lib/ceph/osd/mydir2
-#osd_directories: []
-
-
# IV. This will partition disks for BlueStore
# Use 'true' to enable this scenario
#bluestore: false
* `journal_collocation`
* `raw_multi_journal`
-* `osd_directory`
Then:
* `devices`
* `raw_journal_devices` (**only if** you activated `raw_multi_journal`)
-* `osd_directories` (**only if** you activated `osd_directory`)
# Dependencies
raw_journal_devices: []
-# III. Use directory instead of disk for OSDs
-# Use 'true' to enable this scenario
-
-osd_directory: false
-#osd_directories:
-# - /var/lib/ceph/osd/mydir1
-# - /var/lib/ceph/osd/mydir2
-osd_directories: []
-
-
# IV. This will partition disks for BlueStore
# Use 'true' to enable this scenario
bluestore: false
- include: ./check_devices_static.yml
when:
- not osd_auto_discovery
- - not osd_directory
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- include: ./check_devices_auto.yml
when:
- osd_auto_discovery
- - not osd_directory
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- not osd_containerized_deployment
- not journal_collocation
- not raw_multi_journal
- - not osd_directory
- not bluestore
- not dmcrypt_journal_collocation
- not dmcrypt_dedicated_journal
- osd_group_name in group_names
- not osd_containerized_deployment
- (journal_collocation and raw_multi_journal)
- or (journal_collocation and osd_directory)
or (journal_collocation and bluestore)
- or (raw_multi_journal and osd_directory)
or (raw_multi_journal and bluestore)
- or (osd_directory and bluestore)
or (dmcrypt_journal_collocation and journal_collocation)
or (dmcrypt_journal_collocation and raw_multi_journal)
- or (dmcrypt_journal_collocation and osd_directory)
or (dmcrypt_journal_collocation and bluestore)
or (dmcrypt_dedicated_journal and journal_collocation)
or (dmcrypt_dedicated_journal and raw_multi_journal)
- or (dmcrypt_dedicated_journal and osd_directory)
or (dmcrypt_dedicated_journal and bluestore)
or (dmcrypt_dedicated_journal and dmcrypt_journal_collocation)
- raw_journal_devices|length == 0
or devices|length == 0
-- name: verify directories have been provided
- fail:
- msg: "please provide directories to your osd scenario"
- when:
- - osd_group_name is defined
- - osd_group_name in group_names
- - not osd_containerized_deployment
- - osd_directory
- - osd_directories is not defined
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
-- include: ./scenarios/osd_directory.yml
- when:
- - osd_directory
- - not osd_containerized_deployment
- # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
- static: False
-
- include: ./scenarios/bluestore.yml
when:
- osd_objectstore == 'bluestore'
failed_when: false
always_run: true
register: osd_path
- when: not osd_directory
- name: get osd id
command: cat {{ item.stdout }}/whoami
failed_when: false
always_run: true
register: osd_id_non_dir_scenario
- when: not osd_directory
-
-- name: get osd id for directory scenario
- command: cat {{ item.stdout }}/whoami
- with_items: "{{ osd_directories }}"
- changed_when: false
- failed_when: false
- always_run: true
- register: osd_id_dir_scenario
- when: osd_directory
# NOTE (leseb): we must do this because of
# https://github.com/ansible/ansible/issues/4297
- name: combine osd_path results
set_fact:
- combined_osd_id: "{{ osd_id_non_dir_scenario if not osd_directory else osd_id_dir_scenario }}"
+ combined_osd_id: "{{ osd_id_non_dir_scenario }}"
- name: create a ceph fragment and assemble directory
file:
+++ /dev/null
----
-## SCENARIO 4: USE A DIRECTORY INSTEAD OF A DISK FOR OSD
-
-# NOTE (leseb): we do not check the filesystem underneath the directory
-# so it is really up to you to configure this properly.
-# Declaring more than one directory on the same filesystem will confuse Ceph.
-- name: create osd directories
- file:
- path: "{{ item }}"
- state: directory
- owner: "ceph"
- group: "ceph"
- with_items: "{{ osd_directories }}"
-
-# NOTE (leseb): the prepare process must be parallelized somehow...
-# if you have 64 disks with 4TB each, this will take a while
-# since Ansible will sequential process the loop
-- name: prepare osd directory disk(s)
- command: "ceph-disk prepare --cluster {{ cluster }} {{ item }}"
- with_items: "{{ osd_directories }}"
- changed_when: false
- when: osd_directory
-
-- name: activate osd(s)
- command: "ceph-disk activate {{ item }}"
- with_items: "{{ osd_directories }}"
- changed_when: false
-
-- name: start and add osd target(s) to the systemd sequence
- service:
- name: ceph.target
- state: started
- enabled: yes