Files

36 lines
1.1 KiB
YAML

---
# Prometheus unbound exporter (optional, gated by unbound_exporter_enabled).
# Scrapes unbound-control stats_noreset over the local control interface.
- name: Assert exporter is supported (Arch Linux only)
ansible.builtin.assert:
that: ansible_facts['os_family'] == 'Archlinux'
fail_msg: |
The unbound exporter (prometheus-unbound-exporter) is only packaged for
Arch Linux. It is not available in Debian/Ubuntu repositories.
success_msg: "Unbound exporter supported"
- name: Load OS-specific exporter variables
ansible.builtin.include_vars: archlinux.yml
- name: Install prometheus-unbound-exporter
ansible.builtin.package:
name: "{{ unbound_exporter_package }}"
state: present
- name: Deploy exporter environment file
ansible.builtin.template:
src: exporter-env.conf.j2
dest: "{{ unbound_exporter_args_file }}"
owner: root
group: root
mode: "0644"
notify: Restart unbound exporter
- name: Enable and start prometheus-unbound-exporter
ansible.builtin.systemd:
name: "{{ unbound_exporter_service }}"
enabled: true
state: started
daemon_reload: true