forked from evolix/ansible-roles
[WIP] configure munin graphs for HAProxy
This commit is contained in:
parent
b3f4e4683e
commit
1b0ee50d8d
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -34,3 +34,6 @@
|
|||
- config
|
||||
|
||||
- include: nagios.yml
|
||||
|
||||
- include: munin.yml
|
||||
when: haproxy_munin
|
||||
|
|
23
haproxy/tasks/munin.yml
Normal file
23
haproxy/tasks/munin.yml
Normal 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
|
8
haproxy/templates/munin/haproxy_ng.j2
Normal file
8
haproxy/templates/munin/haproxy_ng.j2
Normal 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 %}
|
Loading…
Reference in a new issue