diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index 4219e005f..542b95167 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -16,8 +16,8 @@ - name: activate osd(s) when device is a disk command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 with_together: - - combined_ispartition_results.results - - devices + - "{{ ispartition_results.results }}" + - "{{ devices }}" changed_when: false failed_when: false register: activate_osd_disk @@ -41,8 +41,8 @@ - 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 with_together: - - combined_ispartition_results.results - - devices + - "{{ ispartition_results.results }}" + - "{{ devices }}" changed_when: false failed_when: false register: activate_osd_disk_dmcrypt @@ -63,14 +63,14 @@ msg: "ceph-disk failed to create an OSD" when: " 'ceph-disk: Error: ceph osd create failed' in item.get('stderr', '') " - with_items: "{{combined_activate_osd_disk_results.results}}" + with_items: "{{ combined_activate_osd_disk_results.results }}" # NOTE (leseb): this task is for partitions because we don't explicitly use a partition. - name: activate osd(s) when device is a partition command: "ceph-disk activate {{ item.1 }}" with_together: - - combined_ispartition_results.results - - devices + - "{{ ispartition_results.results }}" + - "{{ devices }}" changed_when: false failed_when: false when: @@ -113,7 +113,7 @@ command: systemctl enable ceph-osd@{{ item }} changed_when: false failed_when: false - with_items: osd_id.stdout_lines + with_items: "{{ osd_id.stdout_lines }}" when: - use_systemd - is_after_hammer @@ -123,7 +123,7 @@ name: ceph-osd@{{ item }} state: started enabled: yes - with_items: osd_id.stdout_lines + with_items: "{{ osd_id.stdout_lines }}" changed_when: false when: - use_systemd diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml index 72dfa90e5..4a07ea49a 100644 --- a/roles/ceph-osd/tasks/check_devices.yml +++ b/roles/ceph-osd/tasks/check_devices.yml @@ -12,13 +12,17 @@ - include: ./check_devices_static.yml when: not osd_auto_discovery + # 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 + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - name: check the partition status of the journal devices shell: "parted --script {{ item }} print > /dev/null 2>&1" - with_items: '{{ raw_journal_devices }}' + with_items: "{{ raw_journal_devices }}" changed_when: false failed_when: false register: journal_partition_status @@ -27,8 +31,8 @@ - name: fix partitions gpt header or labels of the journal devices shell: "sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }} || sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }}" with_together: - - '{{ journal_partition_status.results }}' - - '{{ raw_journal_devices }}' + - "{{ journal_partition_status.results }}" + - "{{ raw_journal_devices }}" changed_when: false when: - raw_multi_journal diff --git a/roles/ceph-osd/tasks/check_devices_auto.yml b/roles/ceph-osd/tasks/check_devices_auto.yml index d44ae5e60..7d17a57d5 100644 --- a/roles/ceph-osd/tasks/check_devices_auto.yml +++ b/roles/ceph-osd/tasks/check_devices_auto.yml @@ -1,10 +1,10 @@ --- - name: check if the device is a partition (autodiscover disks) shell: "echo '/dev/{{ item.key }}' | egrep '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p)[0-9]{1,2}$'" - with_dict: '{{ ansible_devices }}' + with_dict: "{{ ansible_devices }}" changed_when: false failed_when: false - register: '{{ combined_ispartition_results }}' + register: "{{ ispartition_results }}" when: - ansible_devices is defined - item.value.removable == "0" @@ -14,7 +14,7 @@ with_dict: '{{ ansible_devices }}' changed_when: false failed_when: false - register: combined_osd_partition_status_results + register: osd_partition_status_results when: - journal_collocation or raw_multi_journal - ansible_devices is defined @@ -24,8 +24,8 @@ - name: fix partitions gpt header or labels of the osd disks (autodiscover disks) shell: "sgdisk --zap-all --clear --mbrtogpt -- '/dev/{{ item.0.item.key }}' || sgdisk --zap-all --clear --mbrtogpt -- '/dev/{{ item.0.item.key }}'" with_together: - - '{{ combined_osd_partition_status_results.results }}' - - '{{ ansible_devices }}' + - "{{ osd_partition_status_results.results }}" + - "{{ ansible_devices }}" changed_when: false when: - journal_collocation @@ -36,10 +36,10 @@ - name: check if a partition named 'ceph' exists (autodiscover disks) shell: "parted --script /dev/{{ item.key }} print | egrep -sq '^ 1.*ceph'" - with_dict: '{{ ansible_devices }}' + with_dict: "{{ ansible_devices }}" changed_when: false failed_when: false - register: combined_parted_results + register: parted_results when: - ansible_devices is defined - item.value.removable == "0" diff --git a/roles/ceph-osd/tasks/check_devices_static.yml b/roles/ceph-osd/tasks/check_devices_static.yml index 1de6067d9..23d2f3b34 100644 --- a/roles/ceph-osd/tasks/check_devices_static.yml +++ b/roles/ceph-osd/tasks/check_devices_static.yml @@ -1,17 +1,17 @@ --- - name: check if the device is a partition shell: "echo '{{ item }}' | egrep '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p)[0-9]{1,2}$'" - with_items: '{{ devices }}' + with_items: "{{ devices }}" changed_when: false failed_when: false - register: combined_ispartition_results + register: ispartition_results - name: check the partition status of the osd disks shell: "parted --script {{ item }} print > /dev/null 2>&1" - with_items: '{{ devices }}' + with_items: "{{ devices }}" changed_when: false failed_when: false - register: combined_osd_partition_status_results + register: osd_partition_status_results when: - journal_collocation or raw_multi_journal @@ -23,8 +23,8 @@ - name: fix partitions gpt header or labels of the osd disks shell: "sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }} || sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }}" with_together: - - '{{ combined_osd_partition_status_results.results }}' - - '{{ devices }}' + - "{{ osd_partition_status_results.results }}" + - "{{ devices }}" changed_when: false when: - journal_collocation or raw_multi_journal @@ -32,7 +32,7 @@ - name: check if a partition named 'ceph' exists shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'" - with_items: '{{ devices }}' + with_items: "{{ devices }}" changed_when: false failed_when: false - register: combined_parted_results + register: parted_results diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index d965a558c..c5769f1bb 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -1,36 +1,52 @@ --- - include: pre_requisite.yml when: 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/journal_collocation.yml when: - journal_collocation - 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/raw_multi_journal.yml when: - raw_multi_journal - 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/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' - 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/dmcrypt-journal-colocation.yml when: - dmcrypt_journal_colocation - 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/dmcrypt-dedicated-journal.yml when: - dmcrypt_dedicated_journal - 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: ./docker/main.yml when: osd_containerized_deployment + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False diff --git a/roles/ceph-osd/tasks/scenarios/bluestore.yml b/roles/ceph-osd/tasks/scenarios/bluestore.yml index 21cdf565c..68ab01a61 100644 --- a/roles/ceph-osd/tasks/scenarios/bluestore.yml +++ b/roles/ceph-osd/tasks/scenarios/bluestore.yml @@ -23,8 +23,8 @@ - name: manually prepare osd disk(s) command: ceph-disk prepare --bluestore --cluster "{{ cluster }}" "{{ item.2 }}" with_together: - - combined_parted_results.results - - combined_ispartition_results.results + - parted_results.results + - ispartition_results.results - devices when: - not item.0.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml b/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml index effc39d98..60acfd5b1 100644 --- a/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml +++ b/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml @@ -12,8 +12,8 @@ - name: prepare osd disk(s) command: "ceph-disk prepare --dmcrypt --cluster {{ cluster }} {{ item.2 }} {{ item.3 }}" with_together: - - combined_parted_results.results - - combined_ispartition_results.results + - parted_results.results + - ispartition_results.results - devices - raw_journal_devices changed_when: false diff --git a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml index 534fd3c57..8de1a252f 100644 --- a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml +++ b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-colocation.yml @@ -22,8 +22,8 @@ - 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 + - parted_results.results + - ispartition_results.results - devices when: - not item.0.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/journal_collocation.yml b/roles/ceph-osd/tasks/scenarios/journal_collocation.yml index e6fa42c44..ba0fbb41f 100644 --- a/roles/ceph-osd/tasks/scenarios/journal_collocation.yml +++ b/roles/ceph-osd/tasks/scenarios/journal_collocation.yml @@ -23,8 +23,8 @@ - name: manually prepare osd disk(s) command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }}" with_together: - - combined_parted_results.results - - combined_ispartition_results.results + - parted_results.results + - ispartition_results.results - devices when: - not item.0.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml b/roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml index 36b64cc20..e1c4fce88 100644 --- a/roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml +++ b/roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml @@ -12,10 +12,10 @@ - name: prepare osd disk(s) command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }} {{ item.3 }}" with_together: - - combined_parted_results.results - - combined_ispartition_results.results - - devices - - raw_journal_devices + - "{{ parted_results.results }}" + - "{{ ispartition_results.results }}" + - "{{ devices }}" + - "{{ raw_journal_devices }}" changed_when: false when: - not item.0.get("skipped")