From: Sébastien Han Date: Wed, 10 Aug 2016 08:34:23 +0000 (+0200) Subject: osd: fix collocation spelling and declare dmcrypt variables X-Git-Tag: v1.0.6~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F927%2Fhead;p=ceph-ansible.git osd: fix collocation spelling and declare dmcrypt variables * changed s/colocation/collocation/ * declare dmcrypt variable in ceph-common so the variables check does not fail Signed-off-by: Sébastien Han --- diff --git a/group_vars/all.sample b/group_vars/all.sample index d9732ab4c..941a2da99 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -352,6 +352,8 @@ dummy: #raw_multi_journal: False #osd_directory: False #bluestore: False +#dmcrypt_journal_collocation: False +#dmcrypt_dedicated_journal: False #osd_auto_discovery: False diff --git a/group_vars/osds.sample b/group_vars/osds.sample index b2241ba04..f04ddbd47 100644 --- a/group_vars/osds.sample +++ b/group_vars/osds.sample @@ -121,7 +121,7 @@ dummy: # Keys are stored into the monitors k/v store # Use 'true' to enable this scenario # Both journal and data are stored on the same dm-crypt encrypted device -#dmcrypt_journal_colocation: false +#dmcrypt_journal_collocation: false # VI. Encrypt osd data and/or journal devices with dm-crypt. diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index aefdd012b..bfc5d023b 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -344,5 +344,7 @@ journal_collocation: False raw_multi_journal: False osd_directory: False bluestore: False +dmcrypt_journal_collocation: False +dmcrypt_dedicated_journal: False osd_auto_discovery: False diff --git a/roles/ceph-common/tasks/checks/check_mandatory_vars.yml b/roles/ceph-common/tasks/checks/check_mandatory_vars.yml index 4ab6dd1f3..499d593c0 100644 --- a/roles/ceph-common/tasks/checks/check_mandatory_vars.yml +++ b/roles/ceph-common/tasks/checks/check_mandatory_vars.yml @@ -71,7 +71,7 @@ - not raw_multi_journal - not osd_directory - not bluestore - - not dmcrypt_journal_colocation + - not dmcrypt_journal_collocation - not dmcrypt_dedicated_journal - name: verify only one osd scenario was chosen @@ -86,14 +86,15 @@ or (raw_multi_journal and osd_directory) or (raw_multi_journal and bluestore) or (osd_directory and bluestore) - or (dmcrypt_journal_colocation and journal_collocation) - or (dmcrypt_journal_colocation and raw_multi_journal) - or (dmcrypt_journal_colocation and osd_directory) - or (dmcrypt_journal_colocation 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) - name: verify devices have been provided fail: diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml index f2927b56e..97002b1f5 100644 --- a/roles/ceph-osd/defaults/main.yml +++ b/roles/ceph-osd/defaults/main.yml @@ -113,7 +113,7 @@ bluestore: false # Keys are stored into the monitors k/v store # Use 'true' to enable this scenario # Both journal and data are stored on the same dm-crypt encrypted device -dmcrypt_journal_colocation: false +dmcrypt_journal_collocation: false # VI. Encrypt osd data and/or journal devices with dm-crypt. diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index 4219e005f..6a9724a97 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -36,7 +36,7 @@ - item.value.removable == "0" - item.value.partitions|count == 0 - osd_auto_discovery - - dmcrypt_journal_colocation + - dmcrypt_journal_collocation - name: activate osd(s) when device is a disk (dmcrypt) command: ceph-disk activate --dmcrypt {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 @@ -56,7 +56,7 @@ # https://github.com/ansible/ansible/issues/4297 - name: combine ispartition results set_fact: - combined_activate_osd_disk_results: "{{ activate_osd_disk if not dmcrypt_journal_colocation else activate_osd_disk_dmcrypt }}" + combined_activate_osd_disk_results: "{{ activate_osd_disk if not dmcrypt_journal_collocation else activate_osd_disk_dmcrypt }}" - name: fail if ceph-disk cannot create an OSD fail: diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index d965a558c..4550816b6 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -22,9 +22,9 @@ - osd_objectstore == 'bluestore' - not osd_containerized_deployment -- include: ./scenarios/dmcrypt-journal-colocation.yml +- include: ./scenarios/dmcrypt-journal-collocation.yml when: - - dmcrypt_journal_colocation + - dmcrypt_journal_collocation - not osd_containerized_deployment - include: ./scenarios/dmcrypt-dedicated-journal.yml diff --git a/roles/ceph-osd/tasks/pre_requisite.yml b/roles/ceph-osd/tasks/pre_requisite.yml index 9e2afda17..4941471b3 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -35,7 +35,7 @@ set_fact: copy_admin_key: true when: - - dmcrypt_journal_colocation or dmcrypt_dedicated_journal + - dmcrypt_journal_collocation or dmcrypt_dedicated_journal - name: copy osd bootstrap key copy: diff --git a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml new file mode 100644 index 000000000..91057b5aa --- /dev/null +++ b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml @@ -0,0 +1,36 @@ +--- +## SCENARIO 5: DMCRYPT + +- include: ../check_devices.yml + +# 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 + +# NOTE (alahouze): if the device is a partition, the parted command below has +# failed, this is why we check if the device is a partition too. +- name: automatic prepare osd disk(s) without partitions (dmcrypt) + command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "/dev/{{ item.key }}" + with_dict: ansible_devices + when: + - ansible_devices is defined + - item.value.removable == "0" + - item.value.partitions|count == 0 + - dmcrypt_journal_collocation + - osd_auto_discovery + +- name: manually prepare osd disk(s) (dmcrypt) + command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "{{ item.2 }}" + with_together: + - combined_parted_results.results + - combined_ispartition_results.results + - devices + when: + - not item.0.get("skipped") + - not item.1.get("skipped") + - item.0.get("rc", 0) != 0 + - item.1.get("rc", 0) != 0 + - dmcrypt_journal_collocation + - not osd_auto_discovery + +- include: ../activate_osds.yml diff --git a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml deleted file mode 100644 index 534fd3c57..000000000 --- a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -## SCENARIO 5: DMCRYPT - -- include: ../check_devices.yml - -# 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 - -# NOTE (alahouze): if the device is a partition, the parted command below has -# failed, this is why we check if the device is a partition too. -- name: automatic prepare osd disk(s) without partitions (dmcrypt) - command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "/dev/{{ item.key }}" - with_dict: ansible_devices - when: - - ansible_devices is defined - - item.value.removable == "0" - - item.value.partitions|count == 0 - - dmcrypt_journal_colocation - - osd_auto_discovery - -- name: manually prepare osd disk(s) (dmcrypt) - command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "{{ item.2 }}" - with_together: - - combined_parted_results.results - - combined_ispartition_results.results - - devices - when: - - not item.0.get("skipped") - - not item.1.get("skipped") - - item.0.get("rc", 0) != 0 - - item.1.get("rc", 0) != 0 - - dmcrypt_journal_colocation - - not osd_auto_discovery - -- include: ../activate_osds.yml