Merge pull request #1024 from eduardegorov/egorove_make_devices_optional

Make {{ devices }} list optional
pull/1066/head
Leseb 2016-11-02 15:12:02 +01:00 committed by GitHub
commit 899c8b309f
8 changed files with 20 additions and 12 deletions

View File

@ -368,7 +368,8 @@ dummy:
#bluestore: False
#dmcrypt_journal_collocation: False
#dmcrypt_dedicated_journal: False
#raw_journal_devices: {}
#raw_journal_devices: []
#devices: []
#osd_auto_discovery: False

View File

@ -86,6 +86,8 @@ dummy:
# - /dev/sdd
# - /dev/sde
#devices: []
#'osd_auto_discovery' mode prevents you from filling out the 'devices' variable above.
# You can use this option with First and Forth and Fifth OSDS scenario.
@ -132,6 +134,7 @@ dummy:
# - /dev/sdf
# - /dev/sdg
# - /dev/sdg
#raw_journal_devices: []
# III. Use directory instead of disk for OSDs

View File

@ -402,7 +402,7 @@
- name: zap osd disks
shell: ceph-disk zap "{{ item }}"
with_items: "{{ devices | default([]) }}"
with_items: "{{ devices }}"
when:
ceph_disk_present.rc == 0 and
ceph_data_partlabels.rc == 0 and

View File

@ -360,7 +360,8 @@ osd_directory: False
bluestore: False
dmcrypt_journal_collocation: False
dmcrypt_dedicated_journal: False
raw_journal_devices: {}
raw_journal_devices: []
devices: []
osd_auto_discovery: False

View File

@ -106,17 +106,17 @@
- osd_group_name in group_names
- journal_collocation
- not osd_auto_discovery
- devices is not defined
- devices|length == 0
- name: verify journal devices have been provided
fail:
msg: "please provide devices to your osd scenario"
msg: "please provide devices and raw journal devices to your osd scenario"
when:
- osd_group_name is defined
- osd_group_name in group_names
- raw_multi_journal
- raw_journal_devices is not defined
or devices is not defined
- raw_journal_devices|length == 0
or devices|length == 0
- name: verify directories have been provided
fail:

View File

@ -78,6 +78,8 @@ cephx: true
# - /dev/sdd
# - /dev/sde
devices: []
#'osd_auto_discovery' mode prevents you from filling out the 'devices' variable above.
# You can use this option with First and Forth and Fifth OSDS scenario.
@ -124,6 +126,7 @@ raw_multi_journal: false
# - /dev/sdf
# - /dev/sdg
# - /dev/sdg
raw_journal_devices: []
# III. Use directory instead of disk for OSDs

View File

@ -17,7 +17,7 @@
command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
with_together:
- "{{ ispartition_results.results }}"
- "{{ devices|default([])|unique }}"
- "{{ devices|unique }}"
changed_when: false
failed_when: false
register: activate_osd_disk
@ -42,7 +42,7 @@
command: ceph-disk activate --dmcrypt {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
with_together:
- "{{ ispartition_results.results }}"
- "{{ devices|default([])|unique }}"
- "{{ devices|unique }}"
changed_when: false
failed_when: false
register: activate_osd_disk_dmcrypt
@ -70,7 +70,7 @@
command: "ceph-disk activate {{ item.1 }}"
with_together:
- "{{ ispartition_results.results }}"
- "{{ devices|default([])|unique }}"
- "{{ devices|unique }}"
changed_when: false
failed_when: false
when:

View File

@ -22,7 +22,7 @@
- name: check the partition status of the journal devices
shell: "parted --script {{ item }} print > /dev/null 2>&1"
with_items: "{{ raw_journal_devices|default([])|unique }}"
with_items: "{{ raw_journal_devices|unique }}"
changed_when: false
failed_when: false
register: journal_partition_status
@ -32,7 +32,7 @@
shell: "sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }} || sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }}"
with_together:
- "{{ journal_partition_status.results }}"
- "{{ raw_journal_devices|default([])|unique }}"
- "{{ raw_journal_devices|unique }}"
changed_when: false
when:
- raw_multi_journal