From feb1a76396eb3298600e54ffe36b0202ce7d4e99 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Mon, 7 Dec 2020 08:37:11 +0100 Subject: [PATCH] Extends mdstat playbook and script to optionally repair other partitions as well --- playbooks/mdstat.yml | 8 ++++---- scripts/mdstat.yml | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/playbooks/mdstat.yml b/playbooks/mdstat.yml index d1df016a..01335f1f 100644 --- a/playbooks/mdstat.yml +++ b/playbooks/mdstat.yml @@ -11,19 +11,19 @@ become: yes tasks: - name: Write to action file - shell: echo 'repair' >/sys/block/md2/md/sync_action + shell: echo 'repair' >/sys/block/{{ partition }}/md/sync_action - name: Wait for repair to complete wait_for: - path: /sys/block/md2/md/sync_action + path: /sys/block/{{ partition }}/md/sync_action search_regex: idle delay: 60 sleep: 60 timeout: 18000 - name: Write to action file - shell: echo 'check' >/sys/block/md2/md/sync_action + shell: echo 'check' >/sys/block/{{ partition }}/md/sync_action - name: Wait for check to complete wait_for: - path: /sys/block/md2/md/sync_action + path: /sys/block/{{ partition }}/md/sync_action search_regex: idle delay: 60 sleep: 60 diff --git a/scripts/mdstat.yml b/scripts/mdstat.yml index 5ff9f3e0..73155480 100644 --- a/scripts/mdstat.yml +++ b/scripts/mdstat.yml @@ -1,5 +1,15 @@ --- description: Run mdstat tasks +cli: + options: + - name: partition + default: md2 + help: Which partition to repair arguments: playbook: mdstat +command: + - name: extra-vars + value: partition=%s + args: + - partition -- GitLab