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: ceph-ansible-1.0.5-39~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c1c964ae668d0164f59a89bfac3434b09563805;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 (cherry picked from commit 673f54a10068f75b1812360d7ebcb7e9889c1150) Resolves: rhbz#1373736 and rhbz#1366808 --- diff --git a/group_vars/all.sample b/group_vars/all.sample index 709b458a5..9ca649dab 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -316,5 +316,20 @@ dummy: # Do not comment the variable mon_containerized_deployment_with_kv here. This variable is being used # by ceph.conf.j2 template. so it should always be defined #mon_containerized_deployment_with_kv: false - +#mon_containerized_deployment: false + + +################## +# Temporary Vars # +################## +# NOTE(SamYaple): These vars are set here to they are defined before use. They +# should be removed after a refactor has properly seperated all the checks into +# the appropriate roles. + +#journal_collocation: False +#raw_multi_journal: False +#osd_directory: False +#bluestore: False +#dmcrypt_journal_collocation: False +#dmcrypt_dedicated_journal: False diff --git a/group_vars/osds.sample b/group_vars/osds.sample index b786ba3c1..a200c4021 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 7f970d169..63419e9d1 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -308,4 +308,19 @@ docker: false # Do not comment the variable mon_containerized_deployment_with_kv here. This variable is being used # by ceph.conf.j2 template. so it should always be defined mon_containerized_deployment_with_kv: false - +mon_containerized_deployment: false + + +################## +# Temporary Vars # +################## +# NOTE(SamYaple): These vars are set here to they are defined before use. They +# should be removed after a refactor has properly seperated all the checks into +# the appropriate roles. + +journal_collocation: False +raw_multi_journal: False +osd_directory: False +bluestore: False +dmcrypt_journal_collocation: False +dmcrypt_dedicated_journal: False diff --git a/roles/ceph-common/tasks/checks/check_mandatory_vars.yml b/roles/ceph-common/tasks/checks/check_mandatory_vars.yml index 902463143..f8404894c 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 8269f4912..3f8aab69b 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 d46e99e29..f37c3eb82 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 316420338..ddd9b8dce 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 d764a1bb2..4397fcf15 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -25,7 +25,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