diff --git a/haproxy/defaults/main.yml b/haproxy/defaults/main.yml index ea4a8e38..31f054ab 100644 --- a/haproxy/defaults/main.yml +++ b/haproxy/defaults/main.yml @@ -1,3 +1,3 @@ --- - haproxy_jessie_backports: False +haproxy_stats_url: "http://127.0.0.1:8080/" diff --git a/haproxy/handlers/main.yml b/haproxy/handlers/main.yml index 55af4ec5..9cf3b9cb 100644 --- a/haproxy/handlers/main.yml +++ b/haproxy/handlers/main.yml @@ -8,3 +8,8 @@ service: name: haproxy state: restarted + +- name: restart munin-node + service: + name: munin-node + state: restarted diff --git a/haproxy/tasks/main.yml b/haproxy/tasks/main.yml index 054aec1a..37afe8df 100644 --- a/haproxy/tasks/main.yml +++ b/haproxy/tasks/main.yml @@ -34,3 +34,4 @@ - config - include: nagios.yml +- include: munin.yml diff --git a/haproxy/tasks/munin.yml b/haproxy/tasks/munin.yml new file mode 100644 index 00000000..4dacd11f --- /dev/null +++ b/haproxy/tasks/munin.yml @@ -0,0 +1,18 @@ +--- +- name: Enable Munin Haproxy plugins + file: + src: /usr/share/munin/plugins/haproxy_ng + dest: /etc/munin/plugins/haproxy_ng + state: link + notify: restart munin-node + tags: + - haproxy + +- name: Copy Munin Haproxy config + template: + src: munin.conf.j2 + dest: /etc/munin/plugin-conf.d/haproxy + mode: "0644" + notify: restart munin-node + tags: + - haproxy diff --git a/haproxy/templates/munin.conf.j2 b/haproxy/templates/munin.conf.j2 new file mode 100644 index 00000000..c7500521 --- /dev/null +++ b/haproxy/templates/munin.conf.j2 @@ -0,0 +1,2 @@ +[haproxy_*] +env.url {{ haproxy_stats_url }};csv;norefresh