This guide provides a full Ansible playbook to install RRDtool with distro-aware package handling for Debian 10+, Ubuntu LTS, and RHEL 9+ compatible systems.
RRDtool is a command-line utility, not a daemon. It’s typically used within scripts or as part of other monitoring tools (collectd, MRTG, etc.).
- name: Install RRDtool
hosts: rrdtool
become: true
vars:
rrd_data_dir: /var/lib/rrd
tasks:
- name: Install RRDtool (Debian/Ubuntu)
apt:
name:
- rrdtool
- librrd-dev
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install RRDtool (RHEL)
dnf:
name:
- rrdtool
- rrdtool-devel
state: present
enablerepo: epel
when: ansible_os_family == "RedHat"
- name: Verify RRDtool installation
command: rrdtool --version
register: rrd_version
changed_when: false
- name: Display RRDtool version
debug:
var: rrd_version.stdout
- name: Create RRD data directory
file:
path: "{{ rrd_data_dir }}"
state: directory
mode: "0755"
owner: root
group: root
rrdtool - Command-line utilitylibrrd-dev / rrdtool-devel - Development libraries.rrd files in a persistent locationAny questions?
Feel free to contact us. Find all contact information on our contact page.