Add Promehteus Exporter

This commit is contained in:
phil 2023-11-15 12:32:00 +01:00
parent 146716ad9c
commit 872179cbcd
6 changed files with 53 additions and 9 deletions

21
tasks/prometheus.yml Normal file
View file

@ -0,0 +1,21 @@
---
- name: "Prometheus | Get Download URL"
ansible.builtin.shell:
cmd: curl -sL "{{ phpfpm_exporter_github_api_url }}" | jq -r '.assets[].browser_download_url' | grep -E linux-amd64.tar.gz
register: exporter_download_url
- name: "Prometheus | Download binary"
ansible.builtin.unarchive:
src: "{{ exporter_download_url.stdout }}"
dest: /usr/local/bin
remote_src: true
exclude:
- LICENSE
mode: "0755"
- name: "Prometheus | Copy systemd service file"
ansible.builtin.template:
src: systemd/phpfpm_exporter.service.j2
dest: /etc/systemd/system/phpfpm_exporter.service
mode: "0644"
notify: Start phpfpm_exporter