Add Promehteus Exporter
This commit is contained in:
parent
146716ad9c
commit
872179cbcd
6 changed files with 53 additions and 9 deletions
21
tasks/prometheus.yml
Normal file
21
tasks/prometheus.yml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue