Playbooks I use for my homelab
1---
2- hosts: prom_clients
3 tasks:
4 - name: Import Node Exporter role
5 import_role:
6 name: prometheus.prometheus.node_exporter
7 when: ansible_service_mgr == "systemd"
8
9 - name: Install Node Exporter on FreeBSD
10 community.general.pkgng:
11 name: "node_exporter"
12 state: latest
13 when: ansible_service_mgr == "bsdinit"
14 become: true
15
16 - name: Enable node_exporter service on FreeBSD
17 ansible.builtin.service:
18 name: node_exporter
19 enabled: true
20 state: started
21 when: ansible_service_mgr == "bsdinit"
22 become: true