2017-07-26 02:46:22 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
- hosts: osds
|
|
|
|
gather_facts: false
|
|
|
|
become: yes
|
|
|
|
tasks:
|
2017-08-31 21:33:23 +08:00
|
|
|
|
2017-07-26 02:46:22 +08:00
|
|
|
- name: create physical volume
|
2017-08-05 04:57:56 +08:00
|
|
|
command: pvcreate /dev/sdb
|
2017-07-26 02:46:22 +08:00
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
- name: create volume group
|
2017-08-05 04:57:56 +08:00
|
|
|
command: vgcreate test_group /dev/sdb
|
2017-07-26 02:46:22 +08:00
|
|
|
failed_when: false
|
|
|
|
|
2017-08-31 04:53:28 +08:00
|
|
|
- name: create logical volume 1
|
|
|
|
command: lvcreate --yes -l 50%FREE -n data-lv1 test_group
|
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
- name: create logical volume 2
|
|
|
|
command: lvcreate --yes -l 50%FREE -n data-lv2 test_group
|
|
|
|
failed_when: false
|
|
|
|
|
2017-09-14 04:02:54 +08:00
|
|
|
# purge-cluster.yml does not properly destroy partitions
|
|
|
|
# used for lvm osd journals, this ensures they are removed
|
|
|
|
# for that testing scenario
|
|
|
|
- name: remove /dev/sdc1 if it exists
|
|
|
|
parted:
|
|
|
|
device: /dev/sdc
|
|
|
|
number: 1
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: remove /dev/sdc2 if it exists
|
|
|
|
parted:
|
|
|
|
device: /dev/sdc
|
|
|
|
number: 2
|
|
|
|
state: absent
|
|
|
|
|
2017-08-31 04:53:28 +08:00
|
|
|
- name: partition /dev/sdc for journals
|
|
|
|
parted:
|
|
|
|
device: /dev/sdc
|
|
|
|
number: 1
|
|
|
|
part_start: 0%
|
|
|
|
part_end: 50%
|
|
|
|
unit: '%'
|
2017-08-31 21:33:23 +08:00
|
|
|
label: gpt
|
2017-08-31 04:53:28 +08:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: partition /dev/sdc for journals
|
|
|
|
parted:
|
|
|
|
device: /dev/sdc
|
|
|
|
number: 2
|
|
|
|
part_start: 50%
|
|
|
|
part_end: 100%
|
|
|
|
unit: '%'
|
|
|
|
state: present
|
2017-10-31 04:31:04 +08:00
|
|
|
label: gpt
|
2017-08-31 04:53:28 +08:00
|
|
|
|
|
|
|
- name: create journals vg from /dev/sdc2
|
|
|
|
lvg:
|
|
|
|
vg: journals
|
|
|
|
pvs: /dev/sdc2
|
|
|
|
|
|
|
|
- name: create journal1 lv
|
|
|
|
command: lvcreate --yes -l 100%FREE -n journal1 journals
|
2017-07-26 02:46:22 +08:00
|
|
|
failed_when: false
|