mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-11 12:10:20 +01:00
22 lines
570 B
Django/Jinja
22 lines
570 B
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
define hostgroup {
|
|
hostgroup_name loadbalancers
|
|
alias Load Balancers
|
|
}
|
|
|
|
{% for host in groups['lbservers'] %}
|
|
define host {
|
|
use linux-server
|
|
host_name {{ host }}
|
|
alias {{ host }}
|
|
address {{ hostvars[host].ansible_default_ipv4.address }}
|
|
hostgroups loadbalancers
|
|
}
|
|
define service {
|
|
use local-service
|
|
host_name {{ host }}
|
|
service_description HAProxy Load Balancer
|
|
check_command check_http!-p{{ hostvars[host].listenport }}
|
|
}
|
|
{% endfor %}
|