ansible-role-php/tasks/prometheus.yml
2023-11-15 12:50:37 +01:00

21 lines
662 B
YAML

---
- 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