raid-array: Create udev rules to auto re-add disks
This udev rule will automatically re-add disks to the RAID array when they are connected. `mdadm --udev-rules` is supposed to be able to generate such a rule based on the `POLICY` definitions in `/etc/mdadm.conf`, but I was not able to get that to work; it always printed an empty rule file, no matter what I put in `mdadm.conf`.dynamic-inventory
parent
168bfee911
commit
abfd35a68e
|
@ -29,3 +29,22 @@
|
|||
tags:
|
||||
- mdadm
|
||||
- mdadm-create
|
||||
- name: ensure raid auto re-add udev rule exists
|
||||
copy:
|
||||
content: >+
|
||||
ENV{ID_FS_LABEL}=="{{ md_name }}",
|
||||
ENV{ID_FS_TYPE}=="linux_raid_member",
|
||||
ENV{ID_FS_USAGE}=="raid",
|
||||
RUN+="/usr/sbin/mdadm --re-add /dev/disk/by-id/md-name-{{ md_name }} $devnode"
|
||||
dest: /etc/udev/rules.d/80-{{ md_name }}.rules
|
||||
mode: u=rw,go=r
|
||||
owner: root
|
||||
group: root
|
||||
notify:
|
||||
- reload udev
|
||||
tags:
|
||||
- udev
|
||||
handlers:
|
||||
- name: reload udev
|
||||
command:
|
||||
udevadm control --reload
|
||||
|
|
Loading…
Reference in New Issue