|
|
@@ -1,17 +1,38 @@ |
|
|
|
--- |
|
|
|
|
|
|
|
- name: blkid |
|
|
|
command: blkid |
|
|
|
register: blkid |
|
|
|
#- name: mdadm detail scan |
|
|
|
# command: mdadm --detail --scan {{ item.device }} |
|
|
|
# register: _mdadm_detail_scan_output |
|
|
|
# with_items: "{{ mdraid_devices }}" |
|
|
|
# failed_when: false |
|
|
|
# changed_when: false |
|
|
|
# |
|
|
|
#- debug: msg={{_mdadm_detail_scan_output}} |
|
|
|
# |
|
|
|
#- name: set state |
|
|
|
|
|
|
|
- name: set devices |
|
|
|
set_fact: mdraid_devices={{ _mdraid_devices }} |
|
|
|
#- name: blkid |
|
|
|
# command: blkid |
|
|
|
# register: blkid |
|
|
|
|
|
|
|
#- name: set devices |
|
|
|
# set_fact: mdraid_devices={{ _mdraid_devices }} |
|
|
|
|
|
|
|
- name: stop |
|
|
|
command: |
|
|
|
mdadm --stop |
|
|
|
{{ item.devices | join(" ") }} |
|
|
|
with_items: "{{ mdraid_devices }}" |
|
|
|
when: |
|
|
|
mdraid_devices_state == "stopped" |
|
|
|
|
|
|
|
- name: zero superblock |
|
|
|
command: |
|
|
|
mdadm --zero-superblock |
|
|
|
{{ item.devices | join(" ") }} |
|
|
|
with_items: "{{ mdraid_devices }}" |
|
|
|
when: |
|
|
|
mdraid_devices_state == "created" |
|
|
|
|
|
|
|
- name: create |
|
|
|
command: |
|
|
@@ -22,3 +43,5 @@ |
|
|
|
--metadata={{ item.metadata | default("1.2") }} |
|
|
|
{{ item.devices | join(" ") }} |
|
|
|
with_items: "{{ mdraid_devices }}" |
|
|
|
when: |
|
|
|
mdraid_devices_state == "created" |