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