0b491376e9a5040e2dd97bca42ea19499cae011f
[genesis.git] / compass / deploy / ansible / roles / ha / templates / keepalived.conf
1 global_defs {
2
3     notification_email{
4         root@huawei.com
5     }
6
7     notification_email_from keepalived@huawei.com
8
9     smtp_server localhost
10
11     smtp_connect_timeout 30
12
13     router_id  NodeA
14
15 }
16
17 vrrp_instance VI_1 {
18     
19     interface {{ INTERNAL_INTERFACE }}
20     virtual_router_id 51
21     state BACKUP
22     nopreempt
23     advert_int 1
24 {% for host in groups['controller'] %}
25 {% if host == inventory_hostname %}
26     priority {{ 100 - loop.index0 * 5 }}
27 {% endif %}
28 {% endfor %}
29
30     authentication {
31         auth_type PASS
32         auth_pass 1111
33     }
34
35     virtual_ipaddress {
36         {{ HA_VIP }} dev {{ INTERNAL_INTERFACE }}
37     }
38
39     notify_master "/usr/local/bin/notify.sh master"
40     notify_backup "/usr/local/bin/notify.sh backup"
41 }
42