Explorar o código

add disk management to snapraid role

Blaine Story %!s(int64=3) %!d(string=hai) anos
pai
achega
dbabc6cfd7
Modificáronse 1 ficheiros con 26 adicións e 0 borrados
  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 }}"