exporters reorganization

This commit is contained in:
tom.chivert
2023-07-20 15:40:35 +02:00
parent f733ab6d2c
commit 78decc8f50
21 changed files with 135 additions and 145 deletions

View File

@ -0,0 +1,3 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_apache_exporter']

View File

@ -0,0 +1,15 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_blackbox_exporter']
- name: 'blackbox exporter | configuration'
template:
src: conf/prometheus-blackbox-exporter.j2
dest: /etc/default/prometheus-blackbox-exporter
owner: root
group: root
mode: 0600
register: prometheus_blackbox_exporter_configuration
notify:
- 'blackbox-exporter-restart'
tags: ['prometheus_blackbox_exporter']

View File

@ -0,0 +1,9 @@
---
- name: 'cloudflare exporter | check vars are defined'
assert:
that:
- cloudflare_api_key is defined
tags: ['prometheus_cloudflare']
- include_tasks: ../docker.yml
tags: ['prometheus_cloudflare']

View File

@ -0,0 +1,3 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_memcached_exporter']

View File

@ -0,0 +1,28 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_mongodb_exporter']
- name: 'mongodb exporter < v0.2 | move to /usr/local/bin'
copy:
src: /tmp/mongodb_exporter
dest: /usr/local/bin/prometheus-mongodb-exporter
remote_src: yes
owner: root
group: root
mode: 0755
notify:
- 'mongodb-exporter-restart'
when:
- prometheus_mongodb_exporter_latest_version.stdout < '0.2'
tags: ['prometheus_mongodb_exporter']
- name: 'mongodb exporter | configuration'
template:
src: conf/prometheus-mongodb-exporter.j2
dest: /etc/default/prometheus-mongodb-exporter
owner: root
group: root
mode: 0600
notify:
- 'mongodb-exporter-restart'
tags: ['prometheus_mongodb_exporter']

View File

@ -0,0 +1,17 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_mysqld_exporter']
- name: 'mysqld exporter | configuration'
template:
src: conf/prometheus-mysqld-exporter.j2
dest: /etc/default/prometheus-mysqld-exporter
owner: root
group: root
mode: 0600
when:
- prometheus_mysqld_exporter_user is defined
register: prometheus_mysqld_exporter_configuration
notify:
- 'mysqld-exporter-restart'
tags: ['prometheus_mysqld_exporter']

View File

@ -0,0 +1,3 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_nginx_exporter']

View File

@ -0,0 +1,3 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_node_exporter']

View File

@ -0,0 +1,15 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_opcache_exporter']
- name: 'opcache exporter | configuration'
template:
src: conf/prometheus-opcache-exporter.j2
dest: /etc/default/prometheus-opcache-exporter
owner: root
group: root
mode: 0600
register: prometheus_opcache_exporter_configuration
notify:
- 'opcache-exporter-restart'
tags: ['prometheus_opcache_exporter']

View File

@ -0,0 +1,14 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_phpfpm_exporter']
- name: 'phpfpm exporter | install startup script'
template:
src: scripts/prometheus-phpfpm-exporter-script.sh.j2
dest: /usr/local/bin/prometheus-phpfpm-exporter-script.sh
owner: root
group: root
mode: 0600
notify:
- 'phpfpm-exporter-restart'
tags: ['prometheus_phpfpm_exporter']

View File

@ -0,0 +1,15 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_postgres_exporter']
- name: 'postgres exporter | configuration'
template:
src: conf/prometheus-postgres-exporter.j2
dest: /etc/default/prometheus-postgres-exporter
owner: root
group: root
mode: 0600
register: prometheus_postgres_exporter_configuration
notify:
- 'postgres-exporter-restart'
tags: ['prometheus_postgres_exporter']

View File

@ -0,0 +1,48 @@
---
- name: 'proxmox exporter | check vars are defined'
assert:
that:
- prometheus_proxmox_exporter_user is defined
- prometheus_proxmox_exporter_password is defined
- prometheus_proxmox_exporter_node is defined
tags: ['prometheus_proxmox']
- name: 'proxmox exporter | install package through pip3'
pip:
name:
- prometheus-pve-exporter
executable: pip3
tags: ['prometheus_proxmox']
- name: 'proxmox exporter | configuration'
template:
src: conf/prometheus-proxmox-exporter.j2
dest: /etc/default/prometheus-proxmox-exporter
owner: root
group: root
mode: 0600
register: prometheus_proxmox_exporter_configuration
notify:
- 'proxmox-exporter-restart'
tags: ['prometheus_proxmox']
- name: 'proxmox exporter | systemd | copy unit file'
template:
src: systemd/prometheus-proxmox-exporter.service.j2
dest: /etc/systemd/system/prometheus-proxmox-exporter.service
owner: root
group: root
mode: 0600
notify:
- 'proxmox-exporter-restart'
#when: not stat_result.stat.exists or exporter_upgrade == "yes"
tags: ['prometheus_proxmox']
- name: 'proxmox exporter | systemd | enable service'
systemd:
daemon_reload: yes
enabled: yes
name: prometheus-{{ exporter }}-exporter.service
ignore_errors: '{{ ansible_check_mode }}'
#when: not stat_result.stat.exists or exporter_upgrade == "yes"
tags: ['prometheus_proxmox']

View File

@ -0,0 +1,15 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_redis_exporter']
- name: 'redis exporter | configuration'
template:
src: conf/prometheus-redis-exporter.j2
dest: /etc/default/prometheus-redis-exporter
owner: root
group: root
mode: 0600
register: prometheus_redis_exporter_configuration
notify:
- 'redis-exporter-restart'
tags: ['prometheus_redis_exporter']

View File

@ -0,0 +1,3 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_varnish_exporter']