aroberts.zfs_exporter
Ansible Role: ZFS Exporter
Note: This role is based on Jeff Geerling's great zfs_exporter role, with some modifications to install and manage the similar zfs_exporter package.
This role installs zfs_exporter on Linux systems and sets up a systemd unit file to manage the service.
Requirements
None
Role Variables
Here are the available variables with their default values (found in defaults/main.yml):
zfs_exporter_version: '2.2.5'
This is the version of zfs_exporter to install. You can find available versions on the tags page in the zfs_exporter repository. Remove thevfrom the version tag.zfs_exporter_arch: 'amd64'
The architecture for zfs_exporter. If you're using a Raspberry Pi with Raspbian, you might need to set this toarmv7.zfs_exporter_download_url:
https://github.com/pdf/zfs_exporter/releases/download/v{{ zfs_exporter_version }}/zfs_exporter-{{ zfs_exporter_version }}.linux-{{ zfs_exporter_arch }}.tar.gz
This is the URL to download zfs_exporter.zfs_exporter_bin_path:
/usr/local/bin/zfs_exporter
This is where the zfs_exporter binary will be installed.zfs_exporter_output_path:
/tmp/zfs_exporter_output.prom
This is the path where the output from zfs_exporter will be saved.zfs_exporter_options:
''
Additional options to use when starting zfs_exporter, for example,--no-collector.dataset-filesystemto ignore zfs filesystem data. See usage here.zfs_exporter_sponge_package_name:
moreutils
This is the package needed for thespongebinary, which safely handles output. Set to''to skip installing it.zfs_exporter_state:
started
This controls whether the zfs_exporter service is running.zfs_exporter_enabled:
true
This allows the zfs_exporter service to be enabled on startup.
Dependencies
None.
Example Playbook
- hosts: all
roles:
- role: aroberts.zfs_exporter
License
MIT / BSD
Author Information
Created by Andrew Roberts in 2022, based on a role by Jeff Geerling.
Install and manage pdf/zfs_exporter for ZFS metrics in Prometheus
ansible-galaxy install aroberts.zfs_exporter