prometheus/tasks/exporter/opcache.yml

45 lines
1.7 KiB
YAML
Raw Normal View History

2022-01-05 15:44:39 +01:00
---
2022-01-05 16:08:37 +01:00
- name: 'prometheus | opcache exporter | get latest release from GitHub'
2022-01-05 15:44:39 +01:00
shell: curl --silent "https://api.github.com/repos/MyOnlineStore/opcache-exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args:
warn: false
2022-01-05 16:08:37 +01:00
register: prometheus_opcache_exporter_latest_version
2022-01-05 15:44:39 +01:00
run_once: true
2022-01-05 16:08:37 +01:00
- name: 'prometheus | opcache exporter | download'
2022-01-05 15:44:39 +01:00
get_url:
2022-01-05 16:08:37 +01:00
url: https://github.com/MyOnlineStore/opcache-exporter/releases/download/v{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64
2022-01-05 15:44:39 +01:00
dest: /tmp
2022-01-05 16:08:37 +01:00
- name: 'prometheus | opcache exporter | move to /usr/local/bin'
2022-01-05 15:44:39 +01:00
copy:
2022-01-05 16:08:37 +01:00
src: /tmp/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64
dest: /usr/local/bin/prometheus-opcache-exporter
2022-01-05 15:44:39 +01:00
remote_src: yes
owner: root
group: root
mode: 0755
2022-01-05 16:08:37 +01:00
- name: 'prometheus | opcache exporter | configuration'
2022-01-05 15:44:39 +01:00
template:
2022-01-05 16:08:37 +01:00
src: conf/prometheus-opcache-exporter.j2
dest: /etc/default/prometheus-opcache-exporter
2022-01-05 15:44:39 +01:00
owner: root
group: root
mode: 0600
2022-01-05 16:08:37 +01:00
register: prometheus_opcache_exporter_configuration
2022-01-05 15:44:39 +01:00
2022-01-05 16:08:37 +01:00
- name: 'prometheus | opcache exporter | install unit file to systemd'
2022-01-05 15:44:39 +01:00
template:
2022-01-05 16:08:37 +01:00
src: systemd/prometheus-opcache-exporter.service.j2
dest: /etc/systemd/system/prometheus-opcache-exporter.service
2022-01-05 15:44:39 +01:00
owner: root
group: root
mode: 0600
2022-01-05 16:08:37 +01:00
- name: 'prometheus | opcache exporter | configure systemd to use service'
2022-01-05 15:44:39 +01:00
systemd:
daemon_reload: yes
enabled: yes
2022-01-05 16:08:37 +01:00
name: prometheus-opcache-exporter.service