update exporter conf for mongoDB and mysql
This commit is contained in:
parent
78bceb35f7
commit
e51e4ce7a0
@ -53,18 +53,18 @@
|
||||
notify:
|
||||
- 'prometheus | mongodb exporter | restart service'
|
||||
|
||||
- name: 'prometheus | mongodb exporter | configuration'
|
||||
template:
|
||||
src: conf/mongodb-exporter.conf.j2
|
||||
dest: /etc/mongodb-exporter.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
notify:
|
||||
- 'prometheus | mongodb exporter | restart service'
|
||||
|
||||
- name: 'prometheus | mongodb exporter | configure systemd to use service'
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
enabled: yes
|
||||
name: prometheus-mongodb-exporter.service
|
||||
|
||||
- name: 'prometheus | mongodb exporter | configuration'
|
||||
template:
|
||||
src: conf/prometheus-mongodb-exporter.j2
|
||||
dest: /etc/default/prometheus-mongodb-exporter
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
notify:
|
||||
- 'prometheus | mongodb exporter | restart service'
|
||||
|
@ -44,20 +44,12 @@
|
||||
name: prometheus-postgres-exporter.service
|
||||
|
||||
- name: 'prometheus | postgres exporter | configuration'
|
||||
copy:
|
||||
dest: '/etc/default/prometheus-postgres-exporter'
|
||||
template:
|
||||
src: conf/prometheus-postgres-exporter.j2
|
||||
dest: /etc/default/prometheus-postgres-exporter
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
backup: yes
|
||||
content: |
|
||||
DATA_SOURCE_NAME='postgresql://{{ prometheus_exporter_postgresql_user }}:{{ prometheus_exporter_postgresql_password }}@{{ prometheus_exporter_postgresql_host }}:{{prometheus_exporter_postgresql_port }}/''
|
||||
ARGS=''
|
||||
when:
|
||||
- prometheus_postgres_exporter_user is defined
|
||||
- prometheus_postgres_exporter_password is defined
|
||||
- prometheus_postgres_exporter_host is defined
|
||||
- prometheus_postgres_exporter_port is defined
|
||||
mode: 0600
|
||||
register: prometheu_postgres_exporter_configuration
|
||||
notify:
|
||||
- 'prometheus | postgres exporter | restart service'
|
||||
|
2
templates/conf/prometheus-postgres-exporter.j2
Normal file
2
templates/conf/prometheus-postgres-exporter.j2
Normal file
@ -0,0 +1,2 @@
|
||||
# {{ ansible_managed }}
|
||||
DATA_SOURCE_NAME="user={{ prometheus_postgres_exporter_user|default("postgres") }} host={{ prometheus_postgres_exporter_host|default("/var/run/postgresql/") }} sslmode={{ prometheus_postgres_exporter_sslmode|default("disable") }}"
|
@ -5,7 +5,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/prometheus-mongodb-exporter
|
||||
EnvironmentFile=/etc/mongodb-exporter.conf
|
||||
EnvironmentFile=/etc/default/prometheus-mongodb-exporter
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -4,7 +4,9 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ prometheus_postgres_exporter_user|default("postgres") }}
|
||||
ExecStart=/usr/local/bin/prometheus-postgres-exporter
|
||||
EnvironmentFile=/etc/default/prometheus-postgres-exporter
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Loading…
x
Reference in New Issue
Block a user