Commit df566382 authored by nimrod's avatar nimrod
Browse files

Fix for btrfs check.

The Nagios plugin doesn't work on the device, it needs a mountpoint.
parent 62973fbd
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
---
- name: Find a mountpoint for {{ device }}
  # There can be multiple once with bind mounts or subvolumes, we only need
  # one.
  set_fact:
    # yamllint disable rule:line-length
    btrfs_mountpoint: |-
      {{ (ansible_facts.mounts|selectattr("device", "equalto", device)|first)["mount"] }}
    # yamllint enable rule:line-length

- name: Install btrfs packages
  apt:
    cache_valid_time: 3600
+1 −1
Original line number Diff line number Diff line
@@ -6,4 +6,4 @@ After=network-online.target

[Service]
Type=exec
ExecStart=mnpw --warn -- /usr/lib/nagios-btrfs/plugins/check_btrfs --mountpoint {{ device }}
ExecStart=mnpw --warn -- /usr/lib/nagios-btrfs/plugins/check_btrfs --mountpoint {{ btrfs_mountpoint }}