update mysqld exporter config

This commit is contained in:
Ludovic Cartier 2021-05-31 16:59:06 +02:00
parent e51e4ce7a0
commit c24529d657
3 changed files with 9 additions and 17 deletions

View File

@ -42,25 +42,13 @@
enabled: yes
name: prometheus-mysqld-exporter.service
- name: 'prometheus | mysqld exporter | create configuration directory'
file:
path: /var/lib/prometheus
state: directory
mode: '0755'
tags:
- prometheus
- name: 'prometheus | mysqld exporter | configuration'
copy:
dest: '/var/lib/prometheus/.my.cnf'
template:
src: conf/prometheus-mysqld-exporter.j2
dest: /etc/default/prometheus-mysqld-exporter
owner: root
group: root
mode: 0644
backup: yes
content: |
[client]
user={{ prometheus_mysqld_exporter_user }}
password={{ prometheus_mysqld_exporter_password }}
mode: 0600
when:
- prometheus_mysqld_exporter_user is defined
register: prometheus_mysqld_exporter_configuration

View File

@ -0,0 +1,4 @@
# {{ ansible_managed }}
[client]
user={{ prometheus_mysqld_exporter_user }}
password={{ prometheus_mysqld_exporter_password }}

View File

@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/prometheus-mysqld-exporter \
--config.my-cnf /var/lib/prometheus/.my.cnf \
--config.my-cnf /etc/default/prometheus-mysqld-exporter \
--collect.global_status \
--collect.info_schema.innodb_metrics \
--collect.auto_increment.columns \