prometheus/tasks/mongodb_exporter.yml

36 lines
1.2 KiB
YAML
Raw Normal View History

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
- name: 'prometheus | mongodb exporter | install unit file to systemd'
template:
2021-05-25 18:25:22 +02:00
src: systemd/prometheus-mongodb-exporter.service.j2
2021-04-29 18:53:56 +02:00
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
2021-05-25 18:25:22 +02:00
name: prometheus-mongodb-exporter.service