[WIP] configure munin graphs for HAProxy

This commit is contained in:
Jérémy Lecour 2017-11-23 08:39:58 +01:00 committed by Jérémy Lecour
parent b3f4e4683e
commit 1b0ee50d8d
5 changed files with 42 additions and 1 deletions

View File

@ -8,7 +8,8 @@ Everything is in the `tasks/main.yml` file.
## Available variables
* `haproxy_jessie_backports` : on Debian Jessie, we can prefer v1.7 from backports (default: `False`)
* `haproxy_jessie_backports` : on Debian Jessie, we can prefer v1.7 from backports (default: `False`) ;
* `haproxy_munin` : install and configure Munin for HAProxy stats (default: `False`).
## Configuration templates

View File

@ -1,3 +1,9 @@
---
haproxy_jessie_backports: False
haproxy_munin: False
haproxy_status_url: "http://localhost/haproxy-status;csv;norefresh"
haproxy_status_login: Null
haproxy_status_passwd: Null

View File

@ -34,3 +34,6 @@
- config
- include: nagios.yml
- include: munin.yml
when: haproxy_munin

23
haproxy/tasks/munin.yml Normal file
View File

@ -0,0 +1,23 @@
---
- include_role: munin
- name: Enable haproxy_ng munin plugin
file:
src: "/usr/local/share/munin/plugins/haproxy_ng"
dest: "/etc/munin/plugins/haproxy_ng"
state: link
notify: restart munin-node
tags:
- haproxy
- munin
- name: Copy Munin plugin conf
template:
src: munin/haproxy_ng.j2
dest: /etc/munin/plugin-conf.d/haproxy_ng
mode: "0644"
notify: restart munin-node
tags:
- haproxy
- munin

View File

@ -0,0 +1,8 @@
[haproxy_*]
env.url {{ haproxy_status_url }}
{% if haproxy_status_login %}
env.username {{ haproxy_status_login }}
{% endif %}
{% if haproxy_status_passwd %}
env.password {{ haproxy_status_passwd }}
{% endif %}