54 lines
1.9 KiB
YAML
Raw Normal View History

2021-10-05 16:52:47 +02:00
---
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | get latest release from GitHub'
2021-10-05 16:52:47 +02:00
shell: curl --silent "https://api.github.com/repos/Lusitaniae/phpfpm_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args:
warn: false
register: prometheus_phpfpm_exporter_latest_version
run_once: true
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | download'
2021-10-05 16:52:47 +02:00
get_url:
url: https://github.com/Lusitaniae/phpfpm_exporter/releases/download/v{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | unarchive'
2021-10-05 16:52:47 +02:00
unarchive:
remote_src: yes
src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | move to /usr/local/bin'
2021-10-05 16:52:47 +02:00
copy:
src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64/phpfpm_exporter
dest: /usr/local/bin/prometheus-phpfpm-exporter
remote_src: yes
owner: root
group: root
mode: 0755
notify:
2022-11-11 21:08:07 +01:00
- 'phpfpm exporter | restart service'
2021-10-05 16:52:47 +02:00
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | install startup script'
2021-10-05 16:52:47 +02:00
template:
src: scripts/prometheus-phpfpm-exporter-script.sh.j2
dest: /usr/local/bin/prometheus-phpfpm-exporter-script.sh
owner: root
group: root
mode: 0600
2022-11-11 19:10:30 +01:00
notify:
- 'prometheus | phpfpm exporter | restart service'
2021-10-05 16:52:47 +02:00
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | install unit file to systemd'
2021-10-05 16:52:47 +02:00
template:
src: systemd/prometheus-phpfpm-exporter.service.j2
dest: /etc/systemd/system/prometheus-phpfpm-exporter.service
owner: root
group: root
mode: 0600
2022-11-11 21:08:07 +01:00
- name: 'phpfpm exporter | configure systemd to use service'
2021-10-05 16:52:47 +02:00
systemd:
daemon_reload: yes
enabled: yes
name: prometheus-phpfpm-exporter.service