- 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
- 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
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:
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
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
- 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
- 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
---
- 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"
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
- 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
- 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"
---
- 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
- 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
- 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
---
- 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
- 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")
- 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
- 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")
- 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")
- 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")