Kaynağa Gözat

add disk management to snapraid role

Blaine Story 3 yıl önce
ebeveyn
işleme
dbabc6cfd7
1 değiştirilmiş dosya ile 26 ekleme ve 0 silme
  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 }}"