prometheus/tasks/mongodb_exporter.yml

39 lines
1.2 KiB
YAML
Raw Normal View History

2021-04-29 18:53:56 +02:00
---
2021-05-26 12:01:00 +02:00
- name: 'prometheus | mongodb exporter | install unit file to systemd'
template:
src: systemd/prometheus-mongodb-exporter.service.j2
dest: /etc/systemd/system/prometheus-mongodb-exporter.service
owner: root
group: root
mode: 0600
- name: 'prometheus | mongodb exporter | configure systemd to use service'
systemd:
daemon_reload: yes
enabled: yes
state: started
name: prometheus-mongodb-exporter.service
2021-04-29 18:53:56 +02:00
- name: 'prometheus | mongodb exporter | download'
get_url:
url: https://github.com/percona/mongodb_exporter/releases/download/v{{ prometheus_mongodb_exporter_version }}/mongodb_exporter-{{ prometheus_mongodb_exporter_version }}.linux-amd64.tar.gz
dest: /tmp
- name: 'prometheus | mongodb exporter | unarchive'
unarchive:
remote_src: yes
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version }}.linux-amd64.tar.gz
dest: /tmp
- name: 'prometheus | mongodb exporter | move to /usr/local/bin'
copy:
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version }}.linux-amd64/mongodb_exporter
dest: /usr/local/bin/prometheus-mongodb-exporter
remote_src: yes
owner: root
group: root
mode: 0755
2021-05-26 12:01:00 +02:00
notify:
2021-05-26 15:52:55 +02:00
- 'prometheus | mongodb exporter | restart service'
2021-04-29 18:53:56 +02:00