Welcome to mirror list, hosted at ThFree Co, Russian Federation.

lbservers.cfg.j2 « templates « nagios « roles « aws « lamp_haproxy - github.com/ansible/ansible-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f933962043df60b68ded38c2a1f00d4391b9bb70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# {{ ansible_managed }}

define hostgroup {
	hostgroup_name loadbalancers 
        alias Load Balancers
}

{% for host in groups.tag_ansible_group_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 %}