HAProxy supervision

This commit is contained in:
VC
2020-01-01 10:07:39 +01:00
parent fddbc1c9b4
commit 4f2bd402d4
2 changed files with 32 additions and 5 deletions

View File

@@ -69,19 +69,20 @@ frontend https
## {{ server }} configuration ## {{ server }} configuration
backend http_{{ server }} backend http_{{ server }}
mode http mode http
server host_{{ server }} {{ server }}:80 server host_{{ server.split('.')|join('_') }} {{ server }}:80
backend https_{{ server }} backend https_{{ server }}
mode tcp mode tcp
server host_{{ server }} {{ server }}:443 server host_{{ server.split('.')|join('_') }} {{ server }}:443
{% endfor %} {% endfor %}
## Stats ## Stats
listen stats listen stats
bind *:8080 bind localhost:80
mode http mode http
log global log global
stats enable stats enable
stats uri / stats show-legends
stats uri /haproxy-status
stats hide-version stats hide-version

View File

@@ -26,13 +26,39 @@
- restart munin-node - restart munin-node
when: munin_need_reconfigure when: munin_need_reconfigure
## Adding modules for specific functions
- name: install LWP::UserAgent - name: install LWP::UserAgent
package: package:
name: libwww-perl name: libwww-perl
state: present state: present
notify: notify:
- restart munin-node - restart munin-node
when: "'webservers' in group_names" when: "'webservers' in group_names or 'loadbalancers' in group_names"
- name: add HAProxy backend module
file:
src: /usr/share/munin/plugins/haproxy_
dest: /etc/munin/plugins/haproxy_current
state: link
notify:
- restart munin-node
when: "'loadbalancers' in group_names"
- name: install Cache::Cache
package:
name: libcache-cache-perl
state: present
notify:
- restart munin-node
when: "'mariadbservers' in group_names"
- name: install DBD::Pg
package:
name: libdbd-pg-perl
state: present
notify:
- restart munin-node
when: "'pgsqlservers' in group_names"
- name: reconfigure munin-node - name: reconfigure munin-node
shell: shell: