update mysqld exporter config
This commit is contained in:
parent
e51e4ce7a0
commit
c24529d657
@ -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
|
||||
|
4
templates/conf/prometheus-mysqld-exporter.j2
Normal file
4
templates/conf/prometheus-mysqld-exporter.j2
Normal file
@ -0,0 +1,4 @@
|
||||
# {{ ansible_managed }}
|
||||
[client]
|
||||
user={{ prometheus_mysqld_exporter_user }}
|
||||
password={{ prometheus_mysqld_exporter_password }}
|
@ -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 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user