Sfoglia il codice sorgente

add disk management to snapraid role

Blaine Story 3 anni fa
parent
commit
dbabc6cfd7
1 ha cambiato i file con 26 aggiunte e 0 eliminazioni
  1. 26 0
      roles/snapraid/tasks/disks.yml

+ 26 - 0
roles/snapraid/tasks/disks.yml

@@ -0,0 +1,26 @@
+---
+- name: Create mount points
+  file:
+    path: "{{ item.path }}"
+    state: directory
+    owner: "{{ item.owner | default('root') }}"
+    group: "{{ item.group | default('root') }}"
+    mode: "{{ item.mode | default('0750') }}"
+  with_items:
+    - "{{ snapraid_parity_disks }}"
+    - "{{ snapraid_data_disks }}"
+  loop_control:
+    label: "{{ item.path }}"
+
+- name: Mount disks
+  mount:
+    path: "{{ item.path }}"
+    src: "{{ item.disk }}"
+    fstype: "{{ item.fs | default('xfs') }}"
+    opts: "{{ item.opts | default('defaults') }}"
+    state: mounted
+  with_items:
+    - "{{ snapraid_parity_disks }}"
+    - "{{ snapraid_data_disks }}"
+  loop_control:
+    label: "{{ item.disk }} -> {{ item.path }}"