configure metric scraping from knot on auth-dns
Some checks failed
/ Ansible Lint (push) Failing after 6m12s

This commit is contained in:
lilly 2026-05-06 15:51:08 +02:00
commit 50beedbc62
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
7 changed files with 56 additions and 0 deletions

View file

@ -11,3 +11,11 @@
become: true
changed_when: true
ansible.builtin.command: "netplan apply"
- name: restart knot-exporter
tags: [ auth-dns ]
become: true
ansible.builtin.systemd:
name: knot-exporter.service
state: restarted
daemon_reload: true

View file

@ -0,0 +1,21 @@
- name: Deploy knot-exporter systemd unit
tags: [ auth-dns ]
become: true
register: deploy_service_file
notify: restart knot-exporter
ansible.builtin.template:
src: knot-exporter.service.j2
dest: /etc/systemd/system/knot-exporter.service
owner: root
group: root
mode: u=rw,g=r,o=r
- name: Ensure knot-exporter is running and enabled
tags: [ auth-dns ]
become: true
ansible.builtin.systemd:
name: knot-exporter.service
state: started
enabled: true
daemon_reload: "{{ deploy_service_file.changed }}"

View file

@ -1,3 +1,4 @@
---
- ansible.builtin.import_tasks: 01-install.yaml # noqa: name[missing]
- ansible.builtin.import_tasks: 02-configure.yaml # noqa: name[missing]
- ansible.builtin.import_tasks: 03-configure-exporter.yaml # noqa: name[missing]

View file

@ -0,0 +1,17 @@
# {{ ansible_managed }}
[Unit]
Description=knot prometheus exporter
Wants=network.target
Before=alloy.service
After=network.target
[Service]
User=knot
ExecStart=/usr/sbin/knot-exporter
ReadWritePaths=/run/knot/
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
PrivateIPC=true