39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
---
|
||
- 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
|
||
|
||
- 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
|
||
notify:
|
||
- 'prometheus | mysqld exporter | restart service'
|
||
|